]>
Commit | Line | Data |
---|---|---|
0085ce49 | 1 | # This file was created automatically by SWIG 1.3.29. |
d14a1e28 RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
54f9ee45 | 4 | import _core_ |
0085ce49 RD |
5 | import new |
6 | new_instancemethod = new.instancemethod | |
093d3ff1 | 7 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
0085ce49 | 8 | if (name == "thisown"): return self.this.own(value) |
093d3ff1 | 9 | if (name == "this"): |
0085ce49 RD |
10 | if type(value).__name__ == 'PySwigObject': |
11 | self.__dict__[name] = value | |
093d3ff1 RD |
12 | return |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
0085ce49 | 15 | if (not static) or hasattr(self,name): |
093d3ff1 RD |
16 | self.__dict__[name] = value |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
0085ce49 | 24 | if (name == "thisown"): return self.this.own() |
093d3ff1 RD |
25 | method = class_type.__swig_getmethods__.get(name,None) |
26 | if method: return method(self) | |
27 | raise AttributeError,name | |
28 | ||
0085ce49 RD |
29 | def _swig_repr(self): |
30 | try: strthis = "proxy of " + self.this.__repr__() | |
31 | except: strthis = "" | |
32 | return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) | |
33 | ||
093d3ff1 RD |
34 | import types |
35 | try: | |
36 | _object = types.ObjectType | |
37 | _newclass = 1 | |
38 | except AttributeError: | |
39 | class _object : pass | |
40 | _newclass = 0 | |
41 | del types | |
42 | ||
43 | ||
44 | def _swig_setattr_nondynamic_method(set): | |
45 | def set_attr(self,name,value): | |
0085ce49 RD |
46 | if (name == "thisown"): return self.this.own(value) |
47 | if hasattr(self,name) or (name == "this"): | |
093d3ff1 RD |
48 | set(self,name,value) |
49 | else: | |
50 | raise AttributeError("You cannot add attributes to %s" % self) | |
51 | return set_attr | |
52 | ||
53 | ||
d14a1e28 RD |
54 | #// Give a reference to the dictionary of this module to the C++ extension |
55 | #// code. | |
54f9ee45 | 56 | _core_._wxPySetDictionary(vars()) |
d14a1e28 RD |
57 | |
58 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
59 | #// be used here. | |
60 | import sys as _sys | |
61 | wx = _sys.modules[__name__] | |
62 | ||
66c033b4 RD |
63 | |
64 | #---------------------------------------------------------------------------- | |
65 | ||
66 | def _deprecated(callable, msg=None): | |
67 | """ | |
68 | Create a wrapper function that will raise a DeprecationWarning | |
69 | before calling the callable. | |
70 | """ | |
71 | if msg is None: | |
72 | msg = "%s is deprecated" % callable | |
73 | def deprecatedWrapper(*args, **kwargs): | |
74 | import warnings | |
75 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
76 | return callable(*args, **kwargs) | |
77 | deprecatedWrapper.__doc__ = msg | |
78 | return deprecatedWrapper | |
79 | ||
80 | ||
81 | #---------------------------------------------------------------------------- | |
82 | ||
54f9ee45 RD |
83 | NOT_FOUND = _core_.NOT_FOUND |
84 | VSCROLL = _core_.VSCROLL | |
85 | HSCROLL = _core_.HSCROLL | |
86 | CAPTION = _core_.CAPTION | |
87 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
88 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
89 | RAISED_BORDER = _core_.RAISED_BORDER | |
90 | BORDER = _core_.BORDER | |
91 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
92 | STATIC_BORDER = _core_.STATIC_BORDER | |
93 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
94 | NO_BORDER = _core_.NO_BORDER | |
bcd0d7b6 | 95 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER |
6d88e192 | 96 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
54f9ee45 RD |
97 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL |
98 | WANTS_CHARS = _core_.WANTS_CHARS | |
99 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
100 | CENTER_FRAME = _core_.CENTER_FRAME | |
101 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
102 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
54f9ee45 RD |
103 | CLIP_CHILDREN = _core_.CLIP_CHILDREN |
104 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
092f0ed7 | 105 | WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK |
54f9ee45 RD |
106 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB |
107 | RETAINED = _core_.RETAINED | |
108 | BACKINGSTORE = _core_.BACKINGSTORE | |
109 | COLOURED = _core_.COLOURED | |
110 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
111 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
112 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
113 | LB_SORT = _core_.LB_SORT | |
114 | LB_SINGLE = _core_.LB_SINGLE | |
115 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
116 | LB_EXTENDED = _core_.LB_EXTENDED | |
117 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
118 | LB_HSCROLL = _core_.LB_HSCROLL | |
119 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
120 | PASSWORD = _core_.PASSWORD | |
121 | CB_SIMPLE = _core_.CB_SIMPLE | |
122 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
123 | CB_SORT = _core_.CB_SORT | |
124 | CB_READONLY = _core_.CB_READONLY | |
125 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
126 | RA_VERTICAL = _core_.RA_VERTICAL | |
127 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
128 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
fef4c27a | 129 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX |
54f9ee45 RD |
130 | RB_GROUP = _core_.RB_GROUP |
131 | RB_SINGLE = _core_.RB_SINGLE | |
54f9ee45 RD |
132 | SB_HORIZONTAL = _core_.SB_HORIZONTAL |
133 | SB_VERTICAL = _core_.SB_VERTICAL | |
fef4c27a | 134 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX |
54f9ee45 RD |
135 | ST_SIZEGRIP = _core_.ST_SIZEGRIP |
136 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
e9d6f3a4 RD |
137 | ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE |
138 | ST_DOTS_END = _core_.ST_DOTS_END | |
54f9ee45 RD |
139 | FLOOD_SURFACE = _core_.FLOOD_SURFACE |
140 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
141 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
142 | WINDING_RULE = _core_.WINDING_RULE | |
143 | TOOL_TOP = _core_.TOOL_TOP | |
144 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
145 | TOOL_LEFT = _core_.TOOL_LEFT | |
146 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
147 | OK = _core_.OK | |
148 | YES_NO = _core_.YES_NO | |
149 | CANCEL = _core_.CANCEL | |
150 | YES = _core_.YES | |
151 | NO = _core_.NO | |
152 | NO_DEFAULT = _core_.NO_DEFAULT | |
153 | YES_DEFAULT = _core_.YES_DEFAULT | |
154 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
155 | ICON_HAND = _core_.ICON_HAND | |
156 | ICON_QUESTION = _core_.ICON_QUESTION | |
157 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
158 | ICON_STOP = _core_.ICON_STOP | |
159 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
160 | ICON_MASK = _core_.ICON_MASK | |
161 | ICON_WARNING = _core_.ICON_WARNING | |
162 | ICON_ERROR = _core_.ICON_ERROR | |
163 | FORWARD = _core_.FORWARD | |
164 | BACKWARD = _core_.BACKWARD | |
165 | RESET = _core_.RESET | |
166 | HELP = _core_.HELP | |
167 | MORE = _core_.MORE | |
168 | SETUP = _core_.SETUP | |
169 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
170 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
171 | SIZE_AUTO = _core_.SIZE_AUTO | |
172 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
173 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
943e8dfd | 174 | SIZE_FORCE = _core_.SIZE_FORCE |
54f9ee45 RD |
175 | PORTRAIT = _core_.PORTRAIT |
176 | LANDSCAPE = _core_.LANDSCAPE | |
177 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
178 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
179 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
180 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
181 | ID_ANY = _core_.ID_ANY | |
182 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
943e8dfd | 183 | ID_NONE = _core_.ID_NONE |
54f9ee45 RD |
184 | ID_LOWEST = _core_.ID_LOWEST |
185 | ID_OPEN = _core_.ID_OPEN | |
186 | ID_CLOSE = _core_.ID_CLOSE | |
187 | ID_NEW = _core_.ID_NEW | |
188 | ID_SAVE = _core_.ID_SAVE | |
189 | ID_SAVEAS = _core_.ID_SAVEAS | |
190 | ID_REVERT = _core_.ID_REVERT | |
191 | ID_EXIT = _core_.ID_EXIT | |
192 | ID_UNDO = _core_.ID_UNDO | |
193 | ID_REDO = _core_.ID_REDO | |
194 | ID_HELP = _core_.ID_HELP | |
195 | ID_PRINT = _core_.ID_PRINT | |
196 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
fc46b7f3 | 197 | ID_PAGE_SETUP = _core_.ID_PAGE_SETUP |
54f9ee45 RD |
198 | ID_PREVIEW = _core_.ID_PREVIEW |
199 | ID_ABOUT = _core_.ID_ABOUT | |
200 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
201 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
202 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
203 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
10044bf1 RD |
204 | ID_HELP_INDEX = _core_.ID_HELP_INDEX |
205 | ID_HELP_SEARCH = _core_.ID_HELP_SEARCH | |
54f9ee45 RD |
206 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL |
207 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
97ab0f6a | 208 | ID_EDIT = _core_.ID_EDIT |
54f9ee45 RD |
209 | ID_CUT = _core_.ID_CUT |
210 | ID_COPY = _core_.ID_COPY | |
211 | ID_PASTE = _core_.ID_PASTE | |
212 | ID_CLEAR = _core_.ID_CLEAR | |
213 | ID_FIND = _core_.ID_FIND | |
214 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
215 | ID_SELECTALL = _core_.ID_SELECTALL | |
216 | ID_DELETE = _core_.ID_DELETE | |
217 | ID_REPLACE = _core_.ID_REPLACE | |
218 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
219 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
220 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
221 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
222 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
223 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
224 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
225 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
226 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
227 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
97ab0f6a | 228 | ID_FILE = _core_.ID_FILE |
54f9ee45 RD |
229 | ID_FILE1 = _core_.ID_FILE1 |
230 | ID_FILE2 = _core_.ID_FILE2 | |
231 | ID_FILE3 = _core_.ID_FILE3 | |
232 | ID_FILE4 = _core_.ID_FILE4 | |
233 | ID_FILE5 = _core_.ID_FILE5 | |
234 | ID_FILE6 = _core_.ID_FILE6 | |
235 | ID_FILE7 = _core_.ID_FILE7 | |
236 | ID_FILE8 = _core_.ID_FILE8 | |
237 | ID_FILE9 = _core_.ID_FILE9 | |
238 | ID_OK = _core_.ID_OK | |
239 | ID_CANCEL = _core_.ID_CANCEL | |
240 | ID_APPLY = _core_.ID_APPLY | |
241 | ID_YES = _core_.ID_YES | |
242 | ID_NO = _core_.ID_NO | |
243 | ID_STATIC = _core_.ID_STATIC | |
244 | ID_FORWARD = _core_.ID_FORWARD | |
245 | ID_BACKWARD = _core_.ID_BACKWARD | |
246 | ID_DEFAULT = _core_.ID_DEFAULT | |
247 | ID_MORE = _core_.ID_MORE | |
248 | ID_SETUP = _core_.ID_SETUP | |
249 | ID_RESET = _core_.ID_RESET | |
250 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
251 | ID_YESTOALL = _core_.ID_YESTOALL | |
252 | ID_NOTOALL = _core_.ID_NOTOALL | |
253 | ID_ABORT = _core_.ID_ABORT | |
254 | ID_RETRY = _core_.ID_RETRY | |
255 | ID_IGNORE = _core_.ID_IGNORE | |
7bc1e663 RD |
256 | ID_ADD = _core_.ID_ADD |
257 | ID_REMOVE = _core_.ID_REMOVE | |
258 | ID_UP = _core_.ID_UP | |
259 | ID_DOWN = _core_.ID_DOWN | |
260 | ID_HOME = _core_.ID_HOME | |
261 | ID_REFRESH = _core_.ID_REFRESH | |
262 | ID_STOP = _core_.ID_STOP | |
263 | ID_INDEX = _core_.ID_INDEX | |
264 | ID_BOLD = _core_.ID_BOLD | |
265 | ID_ITALIC = _core_.ID_ITALIC | |
266 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
267 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
268 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
269 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
270 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
271 | ID_INDENT = _core_.ID_INDENT | |
272 | ID_UNINDENT = _core_.ID_UNINDENT | |
273 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
274 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
275 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
276 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
277 | ID_UNDELETE = _core_.ID_UNDELETE | |
278 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
54f9ee45 | 279 | ID_HIGHEST = _core_.ID_HIGHEST |
54f9ee45 RD |
280 | MENU_TEAROFF = _core_.MENU_TEAROFF |
281 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
282 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
283 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
284 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
285 | LI_VERTICAL = _core_.LI_VERTICAL | |
286 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
287 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
288 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
289 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
290 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
291 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
292 | MM_TEXT = _core_.MM_TEXT | |
293 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
294 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
295 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
296 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
297 | MM_TWIPS = _core_.MM_TWIPS | |
298 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
299 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
300 | MM_POINTS = _core_.MM_POINTS | |
301 | MM_METRIC = _core_.MM_METRIC | |
302 | CENTRE = _core_.CENTRE | |
303 | CENTER = _core_.CENTER | |
304 | HORIZONTAL = _core_.HORIZONTAL | |
305 | VERTICAL = _core_.VERTICAL | |
306 | BOTH = _core_.BOTH | |
307 | LEFT = _core_.LEFT | |
308 | RIGHT = _core_.RIGHT | |
309 | UP = _core_.UP | |
310 | DOWN = _core_.DOWN | |
311 | TOP = _core_.TOP | |
312 | BOTTOM = _core_.BOTTOM | |
313 | NORTH = _core_.NORTH | |
314 | SOUTH = _core_.SOUTH | |
315 | WEST = _core_.WEST | |
316 | EAST = _core_.EAST | |
317 | ALL = _core_.ALL | |
318 | ALIGN_NOT = _core_.ALIGN_NOT | |
319 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
320 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
321 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
322 | ALIGN_TOP = _core_.ALIGN_TOP | |
323 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
324 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
325 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
326 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
327 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
328 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
329 | ALIGN_MASK = _core_.ALIGN_MASK | |
330 | STRETCH_NOT = _core_.STRETCH_NOT | |
331 | SHRINK = _core_.SHRINK | |
332 | GROW = _core_.GROW | |
333 | EXPAND = _core_.EXPAND | |
334 | SHAPED = _core_.SHAPED | |
335 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
336 | TILE = _core_.TILE | |
337 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
338 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
339 | BORDER_NONE = _core_.BORDER_NONE | |
340 | BORDER_STATIC = _core_.BORDER_STATIC | |
341 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
342 | BORDER_RAISED = _core_.BORDER_RAISED | |
343 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
344 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
345 | BORDER_MASK = _core_.BORDER_MASK | |
7bc1e663 RD |
346 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
347 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
348 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
54f9ee45 RD |
349 | DEFAULT = _core_.DEFAULT |
350 | DECORATIVE = _core_.DECORATIVE | |
351 | ROMAN = _core_.ROMAN | |
352 | SCRIPT = _core_.SCRIPT | |
353 | SWISS = _core_.SWISS | |
354 | MODERN = _core_.MODERN | |
355 | TELETYPE = _core_.TELETYPE | |
356 | VARIABLE = _core_.VARIABLE | |
357 | FIXED = _core_.FIXED | |
358 | NORMAL = _core_.NORMAL | |
359 | LIGHT = _core_.LIGHT | |
360 | BOLD = _core_.BOLD | |
361 | ITALIC = _core_.ITALIC | |
362 | SLANT = _core_.SLANT | |
363 | SOLID = _core_.SOLID | |
364 | DOT = _core_.DOT | |
365 | LONG_DASH = _core_.LONG_DASH | |
366 | SHORT_DASH = _core_.SHORT_DASH | |
367 | DOT_DASH = _core_.DOT_DASH | |
368 | USER_DASH = _core_.USER_DASH | |
369 | TRANSPARENT = _core_.TRANSPARENT | |
370 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
371 | STIPPLE_MASK = _core_.STIPPLE_MASK |
372 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
54f9ee45 RD |
373 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
374 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
375 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
376 | CROSS_HATCH = _core_.CROSS_HATCH | |
377 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
378 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
379 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
380 | JOIN_MITER = _core_.JOIN_MITER | |
381 | JOIN_ROUND = _core_.JOIN_ROUND | |
382 | CAP_ROUND = _core_.CAP_ROUND | |
383 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
384 | CAP_BUTT = _core_.CAP_BUTT | |
385 | CLEAR = _core_.CLEAR | |
386 | XOR = _core_.XOR | |
387 | INVERT = _core_.INVERT | |
388 | OR_REVERSE = _core_.OR_REVERSE | |
389 | AND_REVERSE = _core_.AND_REVERSE | |
390 | COPY = _core_.COPY | |
391 | AND = _core_.AND | |
392 | AND_INVERT = _core_.AND_INVERT | |
393 | NO_OP = _core_.NO_OP | |
394 | NOR = _core_.NOR | |
395 | EQUIV = _core_.EQUIV | |
396 | SRC_INVERT = _core_.SRC_INVERT | |
397 | OR_INVERT = _core_.OR_INVERT | |
398 | NAND = _core_.NAND | |
399 | OR = _core_.OR | |
400 | SET = _core_.SET | |
401 | WXK_BACK = _core_.WXK_BACK | |
402 | WXK_TAB = _core_.WXK_TAB | |
403 | WXK_RETURN = _core_.WXK_RETURN | |
404 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
405 | WXK_SPACE = _core_.WXK_SPACE | |
406 | WXK_DELETE = _core_.WXK_DELETE | |
407 | WXK_START = _core_.WXK_START | |
408 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
409 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
410 | WXK_CANCEL = _core_.WXK_CANCEL | |
411 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
412 | WXK_CLEAR = _core_.WXK_CLEAR | |
413 | WXK_SHIFT = _core_.WXK_SHIFT | |
414 | WXK_ALT = _core_.WXK_ALT | |
415 | WXK_CONTROL = _core_.WXK_CONTROL | |
416 | WXK_MENU = _core_.WXK_MENU | |
417 | WXK_PAUSE = _core_.WXK_PAUSE | |
418 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
419 | WXK_PRIOR = _core_.WXK_PRIOR | |
420 | WXK_NEXT = _core_.WXK_NEXT | |
421 | WXK_END = _core_.WXK_END | |
422 | WXK_HOME = _core_.WXK_HOME | |
423 | WXK_LEFT = _core_.WXK_LEFT | |
424 | WXK_UP = _core_.WXK_UP | |
425 | WXK_RIGHT = _core_.WXK_RIGHT | |
426 | WXK_DOWN = _core_.WXK_DOWN | |
427 | WXK_SELECT = _core_.WXK_SELECT | |
428 | WXK_PRINT = _core_.WXK_PRINT | |
429 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
430 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
431 | WXK_INSERT = _core_.WXK_INSERT | |
432 | WXK_HELP = _core_.WXK_HELP | |
433 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
434 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
435 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
436 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
437 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
438 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
439 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
440 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
441 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
442 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
443 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
444 | WXK_ADD = _core_.WXK_ADD | |
445 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
446 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
447 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
448 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
449 | WXK_F1 = _core_.WXK_F1 | |
450 | WXK_F2 = _core_.WXK_F2 | |
451 | WXK_F3 = _core_.WXK_F3 | |
452 | WXK_F4 = _core_.WXK_F4 | |
453 | WXK_F5 = _core_.WXK_F5 | |
454 | WXK_F6 = _core_.WXK_F6 | |
455 | WXK_F7 = _core_.WXK_F7 | |
456 | WXK_F8 = _core_.WXK_F8 | |
457 | WXK_F9 = _core_.WXK_F9 | |
458 | WXK_F10 = _core_.WXK_F10 | |
459 | WXK_F11 = _core_.WXK_F11 | |
460 | WXK_F12 = _core_.WXK_F12 | |
461 | WXK_F13 = _core_.WXK_F13 | |
462 | WXK_F14 = _core_.WXK_F14 | |
463 | WXK_F15 = _core_.WXK_F15 | |
464 | WXK_F16 = _core_.WXK_F16 | |
465 | WXK_F17 = _core_.WXK_F17 | |
466 | WXK_F18 = _core_.WXK_F18 | |
467 | WXK_F19 = _core_.WXK_F19 | |
468 | WXK_F20 = _core_.WXK_F20 | |
469 | WXK_F21 = _core_.WXK_F21 | |
470 | WXK_F22 = _core_.WXK_F22 | |
471 | WXK_F23 = _core_.WXK_F23 | |
472 | WXK_F24 = _core_.WXK_F24 | |
473 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
474 | WXK_SCROLL = _core_.WXK_SCROLL | |
475 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
476 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
477 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
478 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
479 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
480 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
481 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
482 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
483 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
484 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
485 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
486 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
487 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
488 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
489 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
490 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
491 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
492 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
493 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
494 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
495 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
496 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
497 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
498 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
499 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
500 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
501 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
502 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
503 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
504 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
505 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
506 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
507 | WXK_COMMAND = _core_.WXK_COMMAND |
508 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
509 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
510 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
511 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
512 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
513 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
514 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
515 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
516 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
517 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
518 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
519 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
520 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
521 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
522 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
523 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
524 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
525 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
526 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
527 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
54f9ee45 RD |
528 | PAPER_NONE = _core_.PAPER_NONE |
529 | PAPER_LETTER = _core_.PAPER_LETTER | |
530 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
531 | PAPER_A4 = _core_.PAPER_A4 | |
532 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
533 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
534 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
535 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
536 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
537 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
538 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
539 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
540 | PAPER_A3 = _core_.PAPER_A3 | |
541 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
542 | PAPER_A5 = _core_.PAPER_A5 | |
543 | PAPER_B4 = _core_.PAPER_B4 | |
544 | PAPER_B5 = _core_.PAPER_B5 | |
545 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
546 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
547 | PAPER_10X14 = _core_.PAPER_10X14 | |
548 | PAPER_11X17 = _core_.PAPER_11X17 | |
549 | PAPER_NOTE = _core_.PAPER_NOTE | |
550 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
551 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
552 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
553 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
554 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
555 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
556 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
557 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
558 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
559 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
560 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
561 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
562 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
563 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
564 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
565 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
566 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
567 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
568 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
569 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
570 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
571 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
572 | PAPER_9X11 = _core_.PAPER_9X11 | |
573 | PAPER_10X11 = _core_.PAPER_10X11 | |
574 | PAPER_15X11 = _core_.PAPER_15X11 | |
575 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
576 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
577 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
578 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
579 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
580 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
581 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
582 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
583 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
584 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
585 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
586 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
587 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
588 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
589 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
590 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
591 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
592 | PAPER_A2 = _core_.PAPER_A2 | |
593 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
594 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
6c75a4cf RD |
595 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
596 | PAPER_A6 = _core_.PAPER_A6 | |
597 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
598 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
599 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
600 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
601 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
602 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
603 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
604 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
605 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
606 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
607 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
608 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
609 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
610 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
611 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
612 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
613 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
614 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
615 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
616 | PAPER_12X11 = _core_.PAPER_12X11 | |
617 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
618 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
619 | PAPER_P16K = _core_.PAPER_P16K | |
620 | PAPER_P32K = _core_.PAPER_P32K | |
621 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
622 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
623 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
624 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
625 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
626 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
627 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
628 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
629 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
630 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
631 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
632 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
633 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
634 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
635 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
636 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
637 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
638 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
639 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
640 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
641 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
642 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
643 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
644 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
54f9ee45 RD |
645 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
646 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
647 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
648 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
649 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
650 | ITEM_CHECK = _core_.ITEM_CHECK | |
651 | ITEM_RADIO = _core_.ITEM_RADIO | |
652 | ITEM_MAX = _core_.ITEM_MAX | |
653 | HT_NOWHERE = _core_.HT_NOWHERE | |
654 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
655 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
656 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
657 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
658 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
659 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
660 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
661 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
662 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
663 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
664 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
665 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
666 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
667 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
668 | HT_MAX = _core_.HT_MAX | |
669 | MOD_NONE = _core_.MOD_NONE | |
670 | MOD_ALT = _core_.MOD_ALT | |
671 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 672 | MOD_ALTGR = _core_.MOD_ALTGR |
54f9ee45 | 673 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 674 | MOD_META = _core_.MOD_META |
54f9ee45 | 675 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
676 | MOD_CMD = _core_.MOD_CMD |
677 | MOD_ALL = _core_.MOD_ALL | |
54f9ee45 RD |
678 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
679 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
680 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
994453b8 RD |
681 | Layout_Default = _core_.Layout_Default |
682 | Layout_LeftToRight = _core_.Layout_LeftToRight | |
683 | Layout_RightToLeft = _core_.Layout_RightToLeft | |
d14a1e28 RD |
684 | #--------------------------------------------------------------------------- |
685 | ||
686 | class Object(object): | |
0df68c9f RD |
687 | """ |
688 | The base class for most wx objects, although in wxPython not | |
689 | much functionality is needed nor exposed. | |
690 | """ | |
0085ce49 RD |
691 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
692 | def __init__(self): raise AttributeError, "No constructor defined" | |
693 | __repr__ = _swig_repr | |
e811c8ce | 694 | def GetClassName(*args, **kwargs): |
0df68c9f | 695 | """ |
a95a7133 | 696 | GetClassName(self) -> String |
e811c8ce | 697 | |
a95a7133 | 698 | Returns the class name of the C++ class using wxRTTI. |
0df68c9f | 699 | """ |
54f9ee45 | 700 | return _core_.Object_GetClassName(*args, **kwargs) |
e811c8ce RD |
701 | |
702 | def Destroy(*args, **kwargs): | |
0df68c9f | 703 | """ |
a95a7133 | 704 | Destroy(self) |
e811c8ce | 705 | |
0df68c9f RD |
706 | Deletes the C++ object this Python object is a proxy for. |
707 | """ | |
7e08d4ef RD |
708 | val = _core_.Object_Destroy(*args, **kwargs) |
709 | args[0].thisown = 0 | |
710 | return val | |
e811c8ce | 711 | |
33d6fd3b | 712 | ClassName = property(GetClassName,doc="See `GetClassName`") |
2131d850 | 713 | _core_.Object_swigregister(Object) |
54f9ee45 | 714 | _wxPySetDictionary = _core_._wxPySetDictionary |
54f9ee45 | 715 | cvar = _core_.cvar |
196addbf | 716 | EmptyString = cvar.EmptyString |
d14a1e28 RD |
717 | |
718 | #--------------------------------------------------------------------------- | |
719 | ||
54f9ee45 RD |
720 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
721 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
722 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
723 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
724 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
725 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
726 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
727 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
728 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
729 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
730 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
731 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
732 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
733 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
734 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
735 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
736 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
737 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
738 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
739 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
740 | CURSOR_NONE = _core_.CURSOR_NONE | |
741 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
742 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
743 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
744 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
745 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
746 | CURSOR_HAND = _core_.CURSOR_HAND | |
747 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
748 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
749 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
750 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
751 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
752 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
753 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
754 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
755 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
756 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
757 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
758 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
759 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
760 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
761 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
762 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
763 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
764 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
765 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
766 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
767 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
768 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
769 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
770 | CURSOR_MAX = _core_.CURSOR_MAX | |
d14a1e28 RD |
771 | #--------------------------------------------------------------------------- |
772 | ||
773 | class Size(object): | |
0df68c9f | 774 | """ |
41e2b43e | 775 | wx.Size is a useful data structure used to represent the size of |
0085ce49 RD |
776 | something. It simply contains integer width and height |
777 | properties. In most places in wxPython where a wx.Size is | |
093d3ff1 | 778 | expected a (width, height) tuple can be used instead. |
0df68c9f | 779 | """ |
0085ce49 RD |
780 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
781 | __repr__ = _swig_repr | |
54f9ee45 RD |
782 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
783 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
242b7b46 | 784 | x = width; y = height |
0085ce49 | 785 | def __init__(self, *args, **kwargs): |
0df68c9f | 786 | """ |
a95a7133 | 787 | __init__(self, int w=0, int h=0) -> Size |
e811c8ce | 788 | |
0df68c9f RD |
789 | Creates a size object. |
790 | """ | |
0085ce49 RD |
791 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) |
792 | __swig_destroy__ = _core_.delete_Size | |
793 | __del__ = lambda self : None; | |
e811c8ce | 794 | def __eq__(*args, **kwargs): |
0df68c9f | 795 | """ |
e9d6f3a4 | 796 | __eq__(self, PyObject other) -> bool |
e811c8ce | 797 | |
0df68c9f RD |
798 | Test for equality of wx.Size objects. |
799 | """ | |
54f9ee45 | 800 | return _core_.Size___eq__(*args, **kwargs) |
e811c8ce RD |
801 | |
802 | def __ne__(*args, **kwargs): | |
0df68c9f | 803 | """ |
e9d6f3a4 | 804 | __ne__(self, PyObject other) -> bool |
e811c8ce | 805 | |
e9d6f3a4 | 806 | Test for inequality of wx.Size objects. |
0df68c9f | 807 | """ |
54f9ee45 | 808 | return _core_.Size___ne__(*args, **kwargs) |
e811c8ce RD |
809 | |
810 | def __add__(*args, **kwargs): | |
0df68c9f | 811 | """ |
a95a7133 | 812 | __add__(self, Size sz) -> Size |
e811c8ce | 813 | |
0df68c9f RD |
814 | Add sz's proprties to this and return the result. |
815 | """ | |
54f9ee45 | 816 | return _core_.Size___add__(*args, **kwargs) |
e811c8ce RD |
817 | |
818 | def __sub__(*args, **kwargs): | |
0df68c9f | 819 | """ |
a95a7133 | 820 | __sub__(self, Size sz) -> Size |
e811c8ce | 821 | |
0df68c9f RD |
822 | Subtract sz's properties from this and return the result. |
823 | """ | |
54f9ee45 | 824 | return _core_.Size___sub__(*args, **kwargs) |
e811c8ce RD |
825 | |
826 | def IncTo(*args, **kwargs): | |
0df68c9f | 827 | """ |
a95a7133 | 828 | IncTo(self, Size sz) |
e811c8ce | 829 | |
0df68c9f RD |
830 | Increments this object so that both of its dimensions are not less |
831 | than the corresponding dimensions of the size. | |
832 | """ | |
54f9ee45 | 833 | return _core_.Size_IncTo(*args, **kwargs) |
e811c8ce RD |
834 | |
835 | def DecTo(*args, **kwargs): | |
0df68c9f | 836 | """ |
a95a7133 | 837 | DecTo(self, Size sz) |
e811c8ce | 838 | |
0df68c9f RD |
839 | Decrements this object so that both of its dimensions are not greater |
840 | than the corresponding dimensions of the size. | |
841 | """ | |
54f9ee45 | 842 | return _core_.Size_DecTo(*args, **kwargs) |
e811c8ce | 843 | |
f5263701 RD |
844 | def IncBy(*args, **kwargs): |
845 | """IncBy(self, int dx, int dy)""" | |
846 | return _core_.Size_IncBy(*args, **kwargs) | |
847 | ||
848 | def DecBy(*args, **kwargs): | |
849 | """DecBy(self, int dx, int dy)""" | |
850 | return _core_.Size_DecBy(*args, **kwargs) | |
851 | ||
10044bf1 RD |
852 | def Scale(*args, **kwargs): |
853 | """ | |
854 | Scale(self, float xscale, float yscale) | |
855 | ||
856 | Scales the dimensions of this object by the given factors. | |
857 | """ | |
858 | return _core_.Size_Scale(*args, **kwargs) | |
859 | ||
e811c8ce | 860 | def Set(*args, **kwargs): |
0df68c9f | 861 | """ |
a95a7133 | 862 | Set(self, int w, int h) |
e811c8ce | 863 | |
0df68c9f RD |
864 | Set both width and height. |
865 | """ | |
54f9ee45 | 866 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
867 | |
868 | def SetWidth(*args, **kwargs): | |
a95a7133 | 869 | """SetWidth(self, int w)""" |
54f9ee45 | 870 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
871 | |
872 | def SetHeight(*args, **kwargs): | |
a95a7133 | 873 | """SetHeight(self, int h)""" |
54f9ee45 | 874 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
875 | |
876 | def GetWidth(*args, **kwargs): | |
a95a7133 | 877 | """GetWidth(self) -> int""" |
54f9ee45 | 878 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
879 | |
880 | def GetHeight(*args, **kwargs): | |
a95a7133 | 881 | """GetHeight(self) -> int""" |
54f9ee45 | 882 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 883 | |
74a57fcd RD |
884 | def IsFullySpecified(*args, **kwargs): |
885 | """ | |
a95a7133 | 886 | IsFullySpecified(self) -> bool |
74a57fcd RD |
887 | |
888 | Returns True if both components of the size are non-default values. | |
889 | """ | |
54f9ee45 | 890 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
891 | |
892 | def SetDefaults(*args, **kwargs): | |
893 | """ | |
a95a7133 | 894 | SetDefaults(self, Size size) |
74a57fcd | 895 | |
41e2b43e RD |
896 | Combine this size with the other one replacing the default components |
897 | of this object (i.e. equal to -1) with those of the other. | |
74a57fcd | 898 | """ |
54f9ee45 | 899 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 900 | |
e811c8ce | 901 | def Get(*args, **kwargs): |
0df68c9f RD |
902 | """ |
903 | Get() -> (width,height) | |
e811c8ce | 904 | |
0df68c9f RD |
905 | Returns the width and height properties as a tuple. |
906 | """ | |
54f9ee45 | 907 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 908 | |
41e2b43e | 909 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
910 | def __str__(self): return str(self.Get()) |
911 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
912 | def __len__(self): return len(self.Get()) | |
913 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
914 | def __setitem__(self, index, val): |
915 | if index == 0: self.width = val | |
916 | elif index == 1: self.height = val | |
917 | else: raise IndexError | |
e811c8ce | 918 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
919 | __safe_for_unpickling__ = True |
920 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 | 921 | |
2131d850 | 922 | _core_.Size_swigregister(Size) |
d14a1e28 RD |
923 | |
924 | #--------------------------------------------------------------------------- | |
925 | ||
926 | class RealPoint(object): | |
0df68c9f | 927 | """ |
41e2b43e RD |
928 | A data structure for representing a point or position with floating |
929 | point x and y properties. In wxPython most places that expect a | |
930 | wx.RealPoint can also accept a (x,y) tuple. | |
0df68c9f | 931 | """ |
0085ce49 RD |
932 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
933 | __repr__ = _swig_repr | |
54f9ee45 RD |
934 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
935 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
0085ce49 | 936 | def __init__(self, *args, **kwargs): |
0df68c9f | 937 | """ |
a95a7133 | 938 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 939 | |
0df68c9f RD |
940 | Create a wx.RealPoint object |
941 | """ | |
0085ce49 RD |
942 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
943 | __swig_destroy__ = _core_.delete_RealPoint | |
944 | __del__ = lambda self : None; | |
e811c8ce | 945 | def __eq__(*args, **kwargs): |
0df68c9f | 946 | """ |
e9d6f3a4 | 947 | __eq__(self, PyObject other) -> bool |
e811c8ce | 948 | |
0df68c9f RD |
949 | Test for equality of wx.RealPoint objects. |
950 | """ | |
54f9ee45 | 951 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
952 | |
953 | def __ne__(*args, **kwargs): | |
0df68c9f | 954 | """ |
e9d6f3a4 | 955 | __ne__(self, PyObject other) -> bool |
e811c8ce | 956 | |
0df68c9f RD |
957 | Test for inequality of wx.RealPoint objects. |
958 | """ | |
54f9ee45 | 959 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
960 | |
961 | def __add__(*args, **kwargs): | |
0df68c9f | 962 | """ |
a95a7133 | 963 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 964 | |
0df68c9f RD |
965 | Add pt's proprties to this and return the result. |
966 | """ | |
54f9ee45 | 967 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
968 | |
969 | def __sub__(*args, **kwargs): | |
0df68c9f | 970 | """ |
a95a7133 | 971 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 972 | |
0df68c9f RD |
973 | Subtract pt's proprties from this and return the result |
974 | """ | |
54f9ee45 | 975 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
976 | |
977 | def Set(*args, **kwargs): | |
0df68c9f | 978 | """ |
a95a7133 | 979 | Set(self, double x, double y) |
e811c8ce | 980 | |
0df68c9f RD |
981 | Set both the x and y properties |
982 | """ | |
54f9ee45 | 983 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
984 | |
985 | def Get(*args, **kwargs): | |
0df68c9f RD |
986 | """ |
987 | Get() -> (x,y) | |
e811c8ce | 988 | |
0df68c9f RD |
989 | Return the x and y properties as a tuple. |
990 | """ | |
54f9ee45 | 991 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 992 | |
41e2b43e | 993 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
994 | def __str__(self): return str(self.Get()) |
995 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
996 | def __len__(self): return len(self.Get()) | |
997 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 998 | def __setitem__(self, index, val): |
e811c8ce RD |
999 | if index == 0: self.x = val |
1000 | elif index == 1: self.y = val | |
d14a1e28 | 1001 | else: raise IndexError |
e811c8ce | 1002 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1003 | __safe_for_unpickling__ = True |
1004 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 | 1005 | |
2131d850 | 1006 | _core_.RealPoint_swigregister(RealPoint) |
d14a1e28 RD |
1007 | |
1008 | #--------------------------------------------------------------------------- | |
1009 | ||
1010 | class Point(object): | |
0df68c9f | 1011 | """ |
41e2b43e RD |
1012 | A data structure for representing a point or position with integer x |
1013 | and y properties. Most places in wxPython that expect a wx.Point can | |
1014 | also accept a (x,y) tuple. | |
0df68c9f | 1015 | """ |
0085ce49 RD |
1016 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1017 | __repr__ = _swig_repr | |
54f9ee45 RD |
1018 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1019 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
0085ce49 | 1020 | def __init__(self, *args, **kwargs): |
0df68c9f | 1021 | """ |
a95a7133 | 1022 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1023 | |
0df68c9f RD |
1024 | Create a wx.Point object |
1025 | """ | |
0085ce49 RD |
1026 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1027 | __swig_destroy__ = _core_.delete_Point | |
1028 | __del__ = lambda self : None; | |
e811c8ce | 1029 | def __eq__(*args, **kwargs): |
0df68c9f | 1030 | """ |
e9d6f3a4 | 1031 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1032 | |
0df68c9f RD |
1033 | Test for equality of wx.Point objects. |
1034 | """ | |
54f9ee45 | 1035 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1036 | |
1037 | def __ne__(*args, **kwargs): | |
0df68c9f | 1038 | """ |
e9d6f3a4 | 1039 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1040 | |
0df68c9f RD |
1041 | Test for inequality of wx.Point objects. |
1042 | """ | |
54f9ee45 | 1043 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1044 | |
1045 | def __add__(*args, **kwargs): | |
0df68c9f | 1046 | """ |
a95a7133 | 1047 | __add__(self, Point pt) -> Point |
e811c8ce | 1048 | |
0df68c9f RD |
1049 | Add pt's proprties to this and return the result. |
1050 | """ | |
54f9ee45 | 1051 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1052 | |
1053 | def __sub__(*args, **kwargs): | |
0df68c9f | 1054 | """ |
a95a7133 | 1055 | __sub__(self, Point pt) -> Point |
e811c8ce | 1056 | |
0df68c9f RD |
1057 | Subtract pt's proprties from this and return the result |
1058 | """ | |
54f9ee45 | 1059 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1060 | |
1061 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1062 | """ |
a95a7133 | 1063 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1064 | |
0df68c9f RD |
1065 | Add pt to this object. |
1066 | """ | |
54f9ee45 | 1067 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1068 | |
1069 | def __isub__(*args, **kwargs): | |
0df68c9f | 1070 | """ |
a95a7133 | 1071 | __isub__(self, Point pt) -> Point |
e811c8ce | 1072 | |
0df68c9f RD |
1073 | Subtract pt from this object. |
1074 | """ | |
54f9ee45 | 1075 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1076 | |
1077 | def Set(*args, **kwargs): | |
0df68c9f | 1078 | """ |
a95a7133 | 1079 | Set(self, long x, long y) |
e811c8ce | 1080 | |
0df68c9f RD |
1081 | Set both the x and y properties |
1082 | """ | |
54f9ee45 | 1083 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1084 | |
1085 | def Get(*args, **kwargs): | |
0df68c9f RD |
1086 | """ |
1087 | Get() -> (x,y) | |
e811c8ce | 1088 | |
0df68c9f RD |
1089 | Return the x and y properties as a tuple. |
1090 | """ | |
54f9ee45 | 1091 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1092 | |
41e2b43e | 1093 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1094 | def __str__(self): return str(self.Get()) |
1095 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1096 | def __len__(self): return len(self.Get()) | |
1097 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1098 | def __setitem__(self, index, val): |
1099 | if index == 0: self.x = val | |
1100 | elif index == 1: self.y = val | |
1101 | else: raise IndexError | |
e811c8ce | 1102 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1103 | __safe_for_unpickling__ = True |
1104 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 | 1105 | |
2131d850 | 1106 | _core_.Point_swigregister(Point) |
d14a1e28 RD |
1107 | |
1108 | #--------------------------------------------------------------------------- | |
1109 | ||
1110 | class Rect(object): | |
0df68c9f | 1111 | """ |
41e2b43e RD |
1112 | A class for representing and manipulating rectangles. It has x, y, |
1113 | width and height properties. In wxPython most palces that expect a | |
1114 | wx.Rect can also accept a (x,y,width,height) tuple. | |
0df68c9f | 1115 | """ |
0085ce49 RD |
1116 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1117 | __repr__ = _swig_repr | |
1118 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1119 | """ |
a95a7133 | 1120 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1121 | |
0df68c9f RD |
1122 | Create a new Rect object. |
1123 | """ | |
0085ce49 RD |
1124 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1125 | __swig_destroy__ = _core_.delete_Rect | |
1126 | __del__ = lambda self : None; | |
e811c8ce | 1127 | def GetX(*args, **kwargs): |
a95a7133 | 1128 | """GetX(self) -> int""" |
54f9ee45 | 1129 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1130 | |
1131 | def SetX(*args, **kwargs): | |
a95a7133 | 1132 | """SetX(self, int x)""" |
54f9ee45 | 1133 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1134 | |
1135 | def GetY(*args, **kwargs): | |
a95a7133 | 1136 | """GetY(self) -> int""" |
54f9ee45 | 1137 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1138 | |
1139 | def SetY(*args, **kwargs): | |
a95a7133 | 1140 | """SetY(self, int y)""" |
54f9ee45 | 1141 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1142 | |
1143 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1144 | """GetWidth(self) -> int""" |
54f9ee45 | 1145 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1146 | |
1147 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1148 | """SetWidth(self, int w)""" |
54f9ee45 | 1149 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1150 | |
1151 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1152 | """GetHeight(self) -> int""" |
54f9ee45 | 1153 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1154 | |
1155 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1156 | """SetHeight(self, int h)""" |
54f9ee45 | 1157 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1158 | |
1159 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1160 | """GetPosition(self) -> Point""" |
54f9ee45 | 1161 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1162 | |
1163 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1164 | """SetPosition(self, Point p)""" |
54f9ee45 | 1165 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1166 | |
1167 | def GetSize(*args, **kwargs): | |
a95a7133 | 1168 | """GetSize(self) -> Size""" |
54f9ee45 | 1169 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1170 | |
1171 | def SetSize(*args, **kwargs): | |
a95a7133 | 1172 | """SetSize(self, Size s)""" |
54f9ee45 | 1173 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1174 | |
aff4cc5c RD |
1175 | def IsEmpty(*args, **kwargs): |
1176 | """IsEmpty(self) -> bool""" | |
1177 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1178 | ||
c9c7117a | 1179 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1180 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1181 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1182 | |
1183 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1184 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1185 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1186 | |
1187 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1188 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1189 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1190 | |
1191 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1192 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1193 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1194 | |
5acb46e0 RD |
1195 | def GetTopRight(*args, **kwargs): |
1196 | """GetTopRight(self) -> Point""" | |
1197 | return _core_.Rect_GetTopRight(*args, **kwargs) | |
1198 | ||
1199 | def SetTopRight(*args, **kwargs): | |
1200 | """SetTopRight(self, Point p)""" | |
1201 | return _core_.Rect_SetTopRight(*args, **kwargs) | |
1202 | ||
1203 | def GetBottomLeft(*args, **kwargs): | |
1204 | """GetBottomLeft(self) -> Point""" | |
1205 | return _core_.Rect_GetBottomLeft(*args, **kwargs) | |
1206 | ||
1207 | def SetBottomLeft(*args, **kwargs): | |
1208 | """SetBottomLeft(self, Point p)""" | |
1209 | return _core_.Rect_SetBottomLeft(*args, **kwargs) | |
1210 | ||
e811c8ce | 1211 | def GetLeft(*args, **kwargs): |
a95a7133 | 1212 | """GetLeft(self) -> int""" |
54f9ee45 | 1213 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1214 | |
1215 | def GetTop(*args, **kwargs): | |
a95a7133 | 1216 | """GetTop(self) -> int""" |
54f9ee45 | 1217 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1218 | |
1219 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1220 | """GetBottom(self) -> int""" |
54f9ee45 | 1221 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1222 | |
1223 | def GetRight(*args, **kwargs): | |
a95a7133 | 1224 | """GetRight(self) -> int""" |
54f9ee45 | 1225 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1226 | |
1227 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1228 | """SetLeft(self, int left)""" |
54f9ee45 | 1229 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1230 | |
1231 | def SetRight(*args, **kwargs): | |
a95a7133 | 1232 | """SetRight(self, int right)""" |
54f9ee45 | 1233 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1234 | |
1235 | def SetTop(*args, **kwargs): | |
a95a7133 | 1236 | """SetTop(self, int top)""" |
54f9ee45 | 1237 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1238 | |
1239 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1240 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1241 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce RD |
1242 | |
1243 | position = property(GetPosition, SetPosition) | |
1244 | size = property(GetSize, SetSize) | |
1245 | left = property(GetLeft, SetLeft) | |
1246 | right = property(GetRight, SetRight) | |
1247 | top = property(GetTop, SetTop) | |
1248 | bottom = property(GetBottom, SetBottom) | |
1249 | ||
1250 | def Inflate(*args, **kwargs): | |
0df68c9f | 1251 | """ |
a95a7133 | 1252 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1253 | |
8e738329 RD |
1254 | Increases the size of the rectangle. |
1255 | ||
1256 | The left border is moved farther left and the right border is moved | |
1257 | farther right by ``dx``. The upper border is moved farther up and the | |
1258 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1259 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1260 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1261 | opposite happens: the rectangle size decreases in the respective | |
1262 | direction. | |
1263 | ||
1264 | The change is made to the rectangle inplace, if instead you need a | |
1265 | copy that is inflated, preserving the original then make the copy | |
1266 | first:: | |
1267 | ||
1268 | copy = wx.Rect(*original) | |
1269 | copy.Inflate(10,15) | |
1270 | ||
1271 | ||
0df68c9f | 1272 | """ |
54f9ee45 | 1273 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1274 | |
1275 | def Deflate(*args, **kwargs): | |
0df68c9f | 1276 | """ |
a95a7133 | 1277 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1278 | |
8e738329 RD |
1279 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1280 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1281 | `Inflate` for a full description. | |
0df68c9f | 1282 | """ |
54f9ee45 | 1283 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1284 | |
1285 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1286 | """ |
a95a7133 | 1287 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1288 | |
41e2b43e RD |
1289 | Moves the rectangle by the specified offset. If dx is positive, the |
1290 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1291 | bottom, otherwise it is moved to the left or top respectively. | |
0df68c9f | 1292 | """ |
54f9ee45 | 1293 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1294 | |
1295 | def Offset(*args, **kwargs): | |
0df68c9f | 1296 | """ |
a95a7133 | 1297 | Offset(self, Point pt) |
e811c8ce | 1298 | |
b1fcee84 | 1299 | Same as `OffsetXY` but uses dx,dy from Point |
0df68c9f | 1300 | """ |
54f9ee45 | 1301 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1302 | |
1303 | def Intersect(*args, **kwargs): | |
0df68c9f | 1304 | """ |
a95a7133 | 1305 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1306 | |
5cbf236d | 1307 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1308 | """ |
54f9ee45 | 1309 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1310 | |
5cbf236d RD |
1311 | def Union(*args, **kwargs): |
1312 | """ | |
1313 | Union(self, Rect rect) -> Rect | |
1314 | ||
1315 | Returns the union of this rectangle and rect. | |
1316 | """ | |
1317 | return _core_.Rect_Union(*args, **kwargs) | |
1318 | ||
e811c8ce | 1319 | def __add__(*args, **kwargs): |
0df68c9f | 1320 | """ |
a95a7133 | 1321 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1322 | |
0df68c9f RD |
1323 | Add the properties of rect to this rectangle and return the result. |
1324 | """ | |
54f9ee45 | 1325 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1326 | |
1327 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1328 | """ |
a95a7133 | 1329 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1330 | |
0df68c9f RD |
1331 | Add the properties of rect to this rectangle, updating this rectangle. |
1332 | """ | |
54f9ee45 | 1333 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1334 | |
1335 | def __eq__(*args, **kwargs): | |
0df68c9f | 1336 | """ |
e9d6f3a4 | 1337 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1338 | |
e9d6f3a4 | 1339 | Test for equality of wx.Rect objects. |
0df68c9f | 1340 | """ |
54f9ee45 | 1341 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1342 | |
1343 | def __ne__(*args, **kwargs): | |
0df68c9f | 1344 | """ |
e9d6f3a4 | 1345 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1346 | |
e9d6f3a4 | 1347 | Test for inequality of wx.Rect objects. |
0df68c9f | 1348 | """ |
54f9ee45 | 1349 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce | 1350 | |
33d6fd3b | 1351 | def ContainsXY(*args, **kwargs): |
0df68c9f | 1352 | """ |
33d6fd3b | 1353 | ContainsXY(self, int x, int y) -> bool |
e811c8ce | 1354 | |
33d6fd3b | 1355 | Return True if the point is inside the rect. |
0df68c9f | 1356 | """ |
33d6fd3b | 1357 | return _core_.Rect_ContainsXY(*args, **kwargs) |
e811c8ce | 1358 | |
33d6fd3b | 1359 | def Contains(*args, **kwargs): |
0df68c9f | 1360 | """ |
33d6fd3b | 1361 | Contains(self, Point pt) -> bool |
e811c8ce | 1362 | |
33d6fd3b | 1363 | Return True if the point is inside the rect. |
0df68c9f | 1364 | """ |
33d6fd3b | 1365 | return _core_.Rect_Contains(*args, **kwargs) |
e811c8ce | 1366 | |
33d6fd3b | 1367 | def ContainsRect(*args, **kwargs): |
fc46b7f3 | 1368 | """ |
33d6fd3b | 1369 | ContainsRect(self, Rect rect) -> bool |
fc46b7f3 RD |
1370 | |
1371 | Returns ``True`` if the given rectangle is completely inside this | |
1372 | rectangle or touches its boundary. | |
1373 | """ | |
33d6fd3b RD |
1374 | return _core_.Rect_ContainsRect(*args, **kwargs) |
1375 | ||
72ef6efb RD |
1376 | #Inside = wx._deprecated(Contains, "Use `Contains` instead.") |
1377 | #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.") | |
1378 | #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.") | |
1379 | Inside = Contains | |
1380 | InsideXY = ContainsXY | |
1381 | InsideRect = ContainsRect | |
fc46b7f3 | 1382 | |
e811c8ce | 1383 | def Intersects(*args, **kwargs): |
0df68c9f | 1384 | """ |
a95a7133 | 1385 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1386 | |
0df68c9f RD |
1387 | Returns True if the rectangles have a non empty intersection. |
1388 | """ | |
54f9ee45 | 1389 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1390 | |
b1fcee84 RD |
1391 | def CenterIn(*args, **kwargs): |
1392 | """ | |
1393 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1394 | ||
1395 | Center this rectangle within the one passed to the method, which is | |
1396 | usually, but not necessarily, the larger one. | |
1397 | """ | |
1398 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1399 | ||
1400 | CentreIn = CenterIn | |
54f9ee45 RD |
1401 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1402 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1403 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1404 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
e811c8ce | 1405 | def Set(*args, **kwargs): |
0df68c9f | 1406 | """ |
a95a7133 | 1407 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1408 | |
0df68c9f RD |
1409 | Set all rectangle properties. |
1410 | """ | |
54f9ee45 | 1411 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1412 | |
1413 | def Get(*args, **kwargs): | |
0df68c9f RD |
1414 | """ |
1415 | Get() -> (x,y,width,height) | |
e811c8ce | 1416 | |
0df68c9f RD |
1417 | Return the rectangle properties as a tuple. |
1418 | """ | |
54f9ee45 | 1419 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1420 | |
41e2b43e | 1421 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1422 | def __str__(self): return str(self.Get()) |
1423 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1424 | def __len__(self): return len(self.Get()) | |
1425 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1426 | def __setitem__(self, index, val): |
1427 | if index == 0: self.x = val | |
1428 | elif index == 1: self.y = val | |
1429 | elif index == 2: self.width = val | |
1430 | elif index == 3: self.height = val | |
1431 | else: raise IndexError | |
e811c8ce | 1432 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1433 | __safe_for_unpickling__ = True |
1434 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 | 1435 | |
33d6fd3b RD |
1436 | Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`") |
1437 | BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`") | |
5acb46e0 | 1438 | BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`") |
33d6fd3b RD |
1439 | Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`") |
1440 | Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`") | |
1441 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
1442 | Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`") | |
1443 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
1444 | Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`") | |
1445 | TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`") | |
5acb46e0 | 1446 | TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`") |
33d6fd3b RD |
1447 | Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`") |
1448 | X = property(GetX,SetX,doc="See `GetX` and `SetX`") | |
1449 | Y = property(GetY,SetY,doc="See `GetY` and `SetY`") | |
1450 | Empty = property(IsEmpty,doc="See `IsEmpty`") | |
2131d850 | 1451 | _core_.Rect_swigregister(Rect) |
d14a1e28 RD |
1452 | |
1453 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1454 | """ |
1455 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1456 | |
0df68c9f RD |
1457 | Create a new Rect object from Points representing two corners. |
1458 | """ | |
54f9ee45 | 1459 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1460 | return val |
1461 | ||
1462 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1463 | """ |
1464 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1465 | |
0df68c9f RD |
1466 | Create a new Rect from a position and size. |
1467 | """ | |
54f9ee45 | 1468 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1469 | return val |
1470 | ||
d3b6e4ff RD |
1471 | def RectS(*args, **kwargs): |
1472 | """ | |
1473 | RectS(Size size) -> Rect | |
1474 | ||
1475 | Create a new Rect from a size only. | |
1476 | """ | |
1477 | val = _core_.new_RectS(*args, **kwargs) | |
d3b6e4ff RD |
1478 | return val |
1479 | ||
d14a1e28 | 1480 | |
e811c8ce | 1481 | def IntersectRect(*args, **kwargs): |
0085ce49 | 1482 | """ |
0df68c9f | 1483 | IntersectRect(Rect r1, Rect r2) -> Rect |
e811c8ce | 1484 | |
0df68c9f RD |
1485 | Calculate and return the intersection of r1 and r2. |
1486 | """ | |
0085ce49 | 1487 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1488 | #--------------------------------------------------------------------------- |
1489 | ||
1490 | class Point2D(object): | |
41e2b43e RD |
1491 | """ |
1492 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1493 | with floating point values. | |
1494 | """ | |
0085ce49 RD |
1495 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1496 | __repr__ = _swig_repr | |
1497 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1498 | """ |
a95a7133 | 1499 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1500 | |
0df68c9f RD |
1501 | Create a w.Point2D object. |
1502 | """ | |
0085ce49 | 1503 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
e811c8ce | 1504 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1505 | """ |
1506 | GetFloor() -> (x,y) | |
1507 | ||
1508 | Convert to integer | |
1509 | """ | |
54f9ee45 | 1510 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1511 | |
1512 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1513 | """ |
1514 | GetRounded() -> (x,y) | |
1515 | ||
1516 | Convert to integer | |
1517 | """ | |
54f9ee45 | 1518 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1519 | |
1520 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1521 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1522 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1523 | |
1524 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1525 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1526 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1527 | |
1528 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1529 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1530 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1531 | |
1532 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1533 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1534 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1535 | |
d14a1e28 RD |
1536 | def SetPolarCoordinates(self, angle, length): |
1537 | self.SetVectorLength(length) | |
1538 | self.SetVectorAngle(angle) | |
1539 | def Normalize(self): | |
1540 | self.SetVectorLength(1.0) | |
1541 | ||
e811c8ce | 1542 | def GetDistance(*args, **kwargs): |
a95a7133 | 1543 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1544 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1545 | |
1546 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1547 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1548 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1549 | |
1550 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1551 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1552 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1553 | |
1554 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1555 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1556 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1557 | |
1558 | def __neg__(*args, **kwargs): | |
0df68c9f | 1559 | """ |
a95a7133 | 1560 | __neg__(self) -> Point2D |
e811c8ce | 1561 | |
0df68c9f RD |
1562 | the reflection of this point |
1563 | """ | |
54f9ee45 | 1564 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1565 | |
1566 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1567 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1568 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1569 | |
1570 | def __isub__(*args, **kwargs): | |
a95a7133 | 1571 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1572 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1573 | |
1574 | def __imul__(*args, **kwargs): | |
a95a7133 | 1575 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1576 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1577 | |
1578 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1579 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1580 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1581 | |
1582 | def __eq__(*args, **kwargs): | |
0df68c9f | 1583 | """ |
e9d6f3a4 | 1584 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1585 | |
e9d6f3a4 | 1586 | Test for equality of wx.Point2D objects. |
0df68c9f | 1587 | """ |
54f9ee45 | 1588 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1589 | |
1590 | def __ne__(*args, **kwargs): | |
0df68c9f | 1591 | """ |
e9d6f3a4 | 1592 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1593 | |
e9d6f3a4 | 1594 | Test for inequality of wx.Point2D objects. |
0df68c9f | 1595 | """ |
54f9ee45 | 1596 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1597 | |
54f9ee45 RD |
1598 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1599 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1600 | def Set(*args, **kwargs): |
a95a7133 | 1601 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1602 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1603 | |
1604 | def Get(*args, **kwargs): | |
0df68c9f RD |
1605 | """ |
1606 | Get() -> (x,y) | |
e811c8ce | 1607 | |
0df68c9f RD |
1608 | Return x and y properties as a tuple. |
1609 | """ | |
54f9ee45 | 1610 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1611 | |
41e2b43e | 1612 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1613 | def __str__(self): return str(self.Get()) |
1614 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1615 | def __len__(self): return len(self.Get()) | |
1616 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1617 | def __setitem__(self, index, val): |
e811c8ce RD |
1618 | if index == 0: self.x = val |
1619 | elif index == 1: self.y = val | |
d14a1e28 | 1620 | else: raise IndexError |
e811c8ce | 1621 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1622 | __safe_for_unpickling__ = True |
1623 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 | 1624 | |
33d6fd3b RD |
1625 | Floor = property(GetFloor,doc="See `GetFloor`") |
1626 | Rounded = property(GetRounded,doc="See `GetRounded`") | |
1627 | VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`") | |
1628 | VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`") | |
2131d850 | 1629 | _core_.Point2D_swigregister(Point2D) |
d14a1e28 RD |
1630 | |
1631 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1632 | """ |
1633 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1634 | |
0df68c9f RD |
1635 | Create a w.Point2D object. |
1636 | """ | |
54f9ee45 | 1637 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1638 | return val |
1639 | ||
1640 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1641 | """ |
1642 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1643 | |
0df68c9f RD |
1644 | Create a w.Point2D object. |
1645 | """ | |
54f9ee45 | 1646 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1647 | return val |
1648 | ||
1649 | #--------------------------------------------------------------------------- | |
1650 | ||
54f9ee45 RD |
1651 | FromStart = _core_.FromStart |
1652 | FromCurrent = _core_.FromCurrent | |
1653 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1654 | class InputStream(object): |
093d3ff1 | 1655 | """Proxy of C++ InputStream class""" |
0085ce49 RD |
1656 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1657 | __repr__ = _swig_repr | |
1658 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1659 | """__init__(self, PyObject p) -> InputStream""" |
0085ce49 RD |
1660 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1661 | __swig_destroy__ = _core_.delete_InputStream | |
1662 | __del__ = lambda self : None; | |
e811c8ce | 1663 | def close(*args, **kwargs): |
a95a7133 | 1664 | """close(self)""" |
54f9ee45 | 1665 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1666 | |
1667 | def flush(*args, **kwargs): | |
a95a7133 | 1668 | """flush(self)""" |
54f9ee45 | 1669 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
1670 | |
1671 | def eof(*args, **kwargs): | |
a95a7133 | 1672 | """eof(self) -> bool""" |
54f9ee45 | 1673 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
1674 | |
1675 | def read(*args, **kwargs): | |
a95a7133 | 1676 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 1677 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
1678 | |
1679 | def readline(*args, **kwargs): | |
a95a7133 | 1680 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 1681 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
1682 | |
1683 | def readlines(*args, **kwargs): | |
a95a7133 | 1684 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 1685 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
1686 | |
1687 | def seek(*args, **kwargs): | |
a95a7133 | 1688 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 1689 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
1690 | |
1691 | def tell(*args, **kwargs): | |
a95a7133 | 1692 | """tell(self) -> int""" |
54f9ee45 | 1693 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
1694 | |
1695 | def Peek(*args, **kwargs): | |
a95a7133 | 1696 | """Peek(self) -> char""" |
54f9ee45 | 1697 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
1698 | |
1699 | def GetC(*args, **kwargs): | |
a95a7133 | 1700 | """GetC(self) -> char""" |
54f9ee45 | 1701 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
1702 | |
1703 | def LastRead(*args, **kwargs): | |
a95a7133 | 1704 | """LastRead(self) -> size_t""" |
54f9ee45 | 1705 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
1706 | |
1707 | def CanRead(*args, **kwargs): | |
a95a7133 | 1708 | """CanRead(self) -> bool""" |
54f9ee45 | 1709 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
1710 | |
1711 | def Eof(*args, **kwargs): | |
a95a7133 | 1712 | """Eof(self) -> bool""" |
54f9ee45 | 1713 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
1714 | |
1715 | def Ungetch(*args, **kwargs): | |
a95a7133 | 1716 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 1717 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
1718 | |
1719 | def SeekI(*args, **kwargs): | |
a95a7133 | 1720 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 1721 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
1722 | |
1723 | def TellI(*args, **kwargs): | |
a95a7133 | 1724 | """TellI(self) -> long""" |
54f9ee45 | 1725 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 1726 | |
2131d850 | 1727 | _core_.InputStream_swigregister(InputStream) |
d14a1e28 RD |
1728 | DefaultPosition = cvar.DefaultPosition |
1729 | DefaultSize = cvar.DefaultSize | |
1730 | ||
1731 | class OutputStream(object): | |
093d3ff1 | 1732 | """Proxy of C++ OutputStream class""" |
0085ce49 RD |
1733 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1734 | def __init__(self): raise AttributeError, "No constructor defined" | |
1735 | __repr__ = _swig_repr | |
e811c8ce | 1736 | def write(*args, **kwargs): |
a95a7133 | 1737 | """write(self, PyObject obj)""" |
54f9ee45 | 1738 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 1739 | |
0085ce49 RD |
1740 | def LastWrite(*args, **kwargs): |
1741 | """LastWrite(self) -> size_t""" | |
1742 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d14a1e28 | 1743 | |
2131d850 | 1744 | _core_.OutputStream_swigregister(OutputStream) |
d14a1e28 RD |
1745 | |
1746 | #--------------------------------------------------------------------------- | |
1747 | ||
1748 | class FSFile(Object): | |
093d3ff1 | 1749 | """Proxy of C++ FSFile class""" |
0085ce49 RD |
1750 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1751 | __repr__ = _swig_repr | |
1752 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1753 | """ |
a95a7133 | 1754 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 1755 | DateTime modif) -> FSFile |
0df68c9f | 1756 | """ |
0085ce49 | 1757 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
0085ce49 RD |
1758 | __swig_destroy__ = _core_.delete_FSFile |
1759 | __del__ = lambda self : None; | |
e811c8ce | 1760 | def GetStream(*args, **kwargs): |
a95a7133 | 1761 | """GetStream(self) -> InputStream""" |
54f9ee45 | 1762 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce | 1763 | |
97ab0f6a RD |
1764 | def DetachStream(*args, **kwargs): |
1765 | """DetachStream(self)""" | |
1766 | return _core_.FSFile_DetachStream(*args, **kwargs) | |
1767 | ||
e811c8ce | 1768 | def GetMimeType(*args, **kwargs): |
a95a7133 | 1769 | """GetMimeType(self) -> String""" |
54f9ee45 | 1770 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1771 | |
1772 | def GetLocation(*args, **kwargs): | |
a95a7133 | 1773 | """GetLocation(self) -> String""" |
54f9ee45 | 1774 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
1775 | |
1776 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1777 | """GetAnchor(self) -> String""" |
54f9ee45 | 1778 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1779 | |
1780 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 1781 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 1782 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 1783 | |
97ab0f6a RD |
1784 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
1785 | Location = property(GetLocation,doc="See `GetLocation`") | |
1786 | MimeType = property(GetMimeType,doc="See `GetMimeType`") | |
1787 | ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`") | |
1788 | Stream = property(GetStream,doc="See `GetStream`") | |
2131d850 | 1789 | _core_.FSFile_swigregister(FSFile) |
d14a1e28 RD |
1790 | |
1791 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1792 | """Proxy of C++ CPPFileSystemHandler class""" |
0085ce49 RD |
1793 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1794 | def __init__(self): raise AttributeError, "No constructor defined" | |
1795 | __repr__ = _swig_repr | |
50f151d7 RD |
1796 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
1797 | __del__ = lambda self : None; | |
2131d850 | 1798 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d14a1e28 RD |
1799 | |
1800 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1801 | """Proxy of C++ FileSystemHandler class""" |
0085ce49 RD |
1802 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1803 | __repr__ = _swig_repr | |
1804 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1805 | """__init__(self) -> FileSystemHandler""" |
0085ce49 | 1806 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
d14a1e28 | 1807 | self._setCallbackInfo(self, FileSystemHandler) |
e811c8ce RD |
1808 | |
1809 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 1810 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 1811 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
1812 | |
1813 | def CanOpen(*args, **kwargs): | |
a95a7133 | 1814 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1815 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1816 | |
1817 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1818 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1819 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1820 | |
1821 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1822 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1823 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1824 | |
1825 | def FindNext(*args, **kwargs): | |
a95a7133 | 1826 | """FindNext(self) -> String""" |
54f9ee45 | 1827 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
1828 | |
1829 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 1830 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 1831 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
1832 | |
1833 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 1834 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 1835 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
1836 | |
1837 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1838 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 1839 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1840 | |
1841 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 1842 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 1843 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
1844 | |
1845 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 1846 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 1847 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 1848 | |
97ab0f6a RD |
1849 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
1850 | LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`") | |
1851 | MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`") | |
1852 | Protocol = property(GetProtocol,doc="See `GetProtocol`") | |
1853 | RightLocation = property(GetRightLocation,doc="See `GetRightLocation`") | |
2131d850 | 1854 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d14a1e28 RD |
1855 | |
1856 | class FileSystem(Object): | |
093d3ff1 | 1857 | """Proxy of C++ FileSystem class""" |
0085ce49 RD |
1858 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1859 | __repr__ = _swig_repr | |
1860 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1861 | """__init__(self) -> FileSystem""" |
0085ce49 RD |
1862 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
1863 | __swig_destroy__ = _core_.delete_FileSystem | |
1864 | __del__ = lambda self : None; | |
e811c8ce | 1865 | def ChangePathTo(*args, **kwargs): |
a95a7133 | 1866 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 1867 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
1868 | |
1869 | def GetPath(*args, **kwargs): | |
a95a7133 | 1870 | """GetPath(self) -> String""" |
54f9ee45 | 1871 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
1872 | |
1873 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1874 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 1875 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
1876 | |
1877 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1878 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1879 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
1880 | |
1881 | def FindNext(*args, **kwargs): | |
a95a7133 | 1882 | """FindNext(self) -> String""" |
54f9ee45 | 1883 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
1884 | |
1885 | def AddHandler(*args, **kwargs): | |
66c033b4 | 1886 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 1887 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
1888 | |
1889 | AddHandler = staticmethod(AddHandler) | |
97ab0f6a RD |
1890 | def RemoveHandler(*args, **kwargs): |
1891 | """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
1892 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
1893 | ||
1894 | RemoveHandler = staticmethod(RemoveHandler) | |
e811c8ce | 1895 | def CleanUpHandlers(*args, **kwargs): |
66c033b4 | 1896 | """CleanUpHandlers()""" |
54f9ee45 | 1897 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
1898 | |
1899 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1900 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 1901 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 1902 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
1903 | |
1904 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
1905 | def URLToFileName(*args, **kwargs): |
1906 | """URLToFileName(String url) -> String""" | |
1907 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1908 | ||
1909 | URLToFileName = staticmethod(URLToFileName) | |
97ab0f6a | 1910 | Path = property(GetPath,doc="See `GetPath`") |
2131d850 | 1911 | _core_.FileSystem_swigregister(FileSystem) |
d14a1e28 | 1912 | |
e811c8ce | 1913 | def FileSystem_AddHandler(*args, **kwargs): |
0085ce49 RD |
1914 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
1915 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d14a1e28 | 1916 | |
97ab0f6a RD |
1917 | def FileSystem_RemoveHandler(*args, **kwargs): |
1918 | """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
1919 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
1920 | ||
0085ce49 RD |
1921 | def FileSystem_CleanUpHandlers(*args): |
1922 | """FileSystem_CleanUpHandlers()""" | |
1923 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d14a1e28 | 1924 | |
e811c8ce | 1925 | def FileSystem_FileNameToURL(*args, **kwargs): |
0085ce49 RD |
1926 | """FileSystem_FileNameToURL(String filename) -> String""" |
1927 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d14a1e28 | 1928 | |
e811c8ce | 1929 | def FileSystem_URLToFileName(*args, **kwargs): |
0085ce49 RD |
1930 | """FileSystem_URLToFileName(String url) -> String""" |
1931 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2ef75293 | 1932 | |
d14a1e28 | 1933 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1934 | """Proxy of C++ InternetFSHandler class""" |
0085ce49 RD |
1935 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1936 | __repr__ = _swig_repr | |
1937 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1938 | """__init__(self) -> InternetFSHandler""" |
0085ce49 | 1939 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
e811c8ce | 1940 | def CanOpen(*args, **kwargs): |
a95a7133 | 1941 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1942 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1943 | |
1944 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1945 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1946 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 1947 | |
2131d850 | 1948 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d14a1e28 RD |
1949 | |
1950 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1951 | """Proxy of C++ ZipFSHandler class""" |
0085ce49 RD |
1952 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1953 | __repr__ = _swig_repr | |
1954 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1955 | """__init__(self) -> ZipFSHandler""" |
0085ce49 | 1956 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
e811c8ce | 1957 | def CanOpen(*args, **kwargs): |
a95a7133 | 1958 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1959 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1960 | |
1961 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1962 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1963 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1964 | |
1965 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1966 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1967 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1968 | |
1969 | def FindNext(*args, **kwargs): | |
a95a7133 | 1970 | """FindNext(self) -> String""" |
54f9ee45 | 1971 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1972 | |
2131d850 | 1973 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d14a1e28 RD |
1974 | |
1975 | ||
e811c8ce | 1976 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
0085ce49 RD |
1977 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
1978 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d14a1e28 | 1979 | |
e811c8ce | 1980 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
0085ce49 RD |
1981 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
1982 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d14a1e28 | 1983 | |
e811c8ce | 1984 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
0085ce49 RD |
1985 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
1986 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2ef75293 RD |
1987 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1988 | """ | |
1989 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1990 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1991 | arbitrary data. If a bitmap or image is used then the imgType | |
1992 | parameter should specify what kind of image file it should be | |
1993 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1994 | """ | |
1995 | if isinstance(dataItem, wx.Image): | |
1996 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1997 | elif isinstance(dataItem, wx.Bitmap): | |
1998 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1999 | elif type(dataItem) == str: | |
2000 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2001 | else: | |
2002 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d14a1e28 RD |
2003 | |
2004 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 2005 | """Proxy of C++ MemoryFSHandler class""" |
0085ce49 RD |
2006 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2007 | __repr__ = _swig_repr | |
2008 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2009 | """__init__(self) -> MemoryFSHandler""" |
0085ce49 | 2010 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
e811c8ce | 2011 | def RemoveFile(*args, **kwargs): |
66c033b4 | 2012 | """RemoveFile(String filename)""" |
54f9ee45 | 2013 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
2014 | |
2015 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 2016 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 2017 | def CanOpen(*args, **kwargs): |
a95a7133 | 2018 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2019 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2020 | |
2021 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2022 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2023 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2024 | |
2025 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2026 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2027 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2028 | |
2029 | def FindNext(*args, **kwargs): | |
a95a7133 | 2030 | """FindNext(self) -> String""" |
54f9ee45 | 2031 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2032 | |
2131d850 | 2033 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d14a1e28 | 2034 | |
e811c8ce | 2035 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
0085ce49 RD |
2036 | """MemoryFSHandler_RemoveFile(String filename)""" |
2037 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d14a1e28 | 2038 | |
bcd0d7b6 RD |
2039 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2040 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2041 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
f5263701 RD |
2042 | IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL |
2043 | IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH | |
d14a1e28 RD |
2044 | #--------------------------------------------------------------------------- |
2045 | ||
2046 | class ImageHandler(Object): | |
27fb7603 RD |
2047 | """ |
2048 | This is the base class for implementing image file loading/saving, and | |
2049 | image creation from data. It is used within `wx.Image` and is not | |
2050 | normally seen by the application. | |
2051 | """ | |
0085ce49 RD |
2052 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2053 | def __init__(self): raise AttributeError, "No constructor defined" | |
2054 | __repr__ = _swig_repr | |
e811c8ce | 2055 | def GetName(*args, **kwargs): |
a95a7133 | 2056 | """GetName(self) -> String""" |
54f9ee45 | 2057 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
2058 | |
2059 | def GetExtension(*args, **kwargs): | |
a95a7133 | 2060 | """GetExtension(self) -> String""" |
54f9ee45 | 2061 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
2062 | |
2063 | def GetType(*args, **kwargs): | |
a95a7133 | 2064 | """GetType(self) -> long""" |
54f9ee45 | 2065 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
2066 | |
2067 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 2068 | """GetMimeType(self) -> String""" |
54f9ee45 | 2069 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
2070 | |
2071 | def CanRead(*args, **kwargs): | |
a95a7133 | 2072 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 2073 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce | 2074 | |
b02396e8 RD |
2075 | def CanReadStream(*args, **kwargs): |
2076 | """CanReadStream(self, InputStream stream) -> bool""" | |
2077 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2078 | ||
e811c8ce | 2079 | def SetName(*args, **kwargs): |
a95a7133 | 2080 | """SetName(self, String name)""" |
54f9ee45 | 2081 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
2082 | |
2083 | def SetExtension(*args, **kwargs): | |
a95a7133 | 2084 | """SetExtension(self, String extension)""" |
54f9ee45 | 2085 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
2086 | |
2087 | def SetType(*args, **kwargs): | |
a95a7133 | 2088 | """SetType(self, long type)""" |
54f9ee45 | 2089 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
2090 | |
2091 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2092 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2093 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2094 | |
97ab0f6a RD |
2095 | Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`") |
2096 | MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`") | |
2097 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
2098 | Type = property(GetType,SetType,doc="See `GetType` and `SetType`") | |
2131d850 | 2099 | _core_.ImageHandler_swigregister(ImageHandler) |
d14a1e28 | 2100 | |
943e8dfd RD |
2101 | class PyImageHandler(ImageHandler): |
2102 | """ | |
2103 | This is the base class for implementing image file loading/saving, and | |
2104 | image creation from data, all written in Python. To create a custom | |
2105 | image handler derive a new class from wx.PyImageHandler and provide | |
2106 | the following methods:: | |
2107 | ||
2108 | def DoCanRead(self, stream) --> bool | |
2109 | '''Check if this handler can read the image on the stream''' | |
2110 | ||
2111 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2112 | '''Load image data from the stream and load it into image.''' | |
2113 | ||
2114 | def SaveFile(self, image, stream, verbose) --> bool | |
2115 | '''Save the iamge data in image to the stream using | |
2116 | this handler's image file format.''' | |
2117 | ||
2118 | def GetImageCount(self, stream) --> int | |
2119 | '''If this image format can hold more than one image, | |
2120 | how many does the image on the stream have?''' | |
2121 | ||
2122 | To activate your handler create an instance of it and pass it to | |
2123 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2124 | `SetExtension` from your constructor. | |
2125 | ||
2126 | """ | |
0085ce49 RD |
2127 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2128 | __repr__ = _swig_repr | |
2129 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2130 | """ |
2131 | __init__(self) -> PyImageHandler | |
2132 | ||
2133 | This is the base class for implementing image file loading/saving, and | |
2134 | image creation from data, all written in Python. To create a custom | |
2135 | image handler derive a new class from wx.PyImageHandler and provide | |
2136 | the following methods:: | |
2137 | ||
2138 | def DoCanRead(self, stream) --> bool | |
2139 | '''Check if this handler can read the image on the stream''' | |
2140 | ||
2141 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2142 | '''Load image data from the stream and load it into image.''' | |
2143 | ||
2144 | def SaveFile(self, image, stream, verbose) --> bool | |
2145 | '''Save the iamge data in image to the stream using | |
2146 | this handler's image file format.''' | |
2147 | ||
2148 | def GetImageCount(self, stream) --> int | |
2149 | '''If this image format can hold more than one image, | |
2150 | how many does the image on the stream have?''' | |
2151 | ||
2152 | To activate your handler create an instance of it and pass it to | |
2153 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2154 | `SetExtension` from your constructor. | |
2155 | ||
2156 | """ | |
0085ce49 | 2157 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2158 | self._SetSelf(self) |
2159 | ||
2160 | def _SetSelf(*args, **kwargs): | |
2161 | """_SetSelf(self, PyObject self)""" | |
2162 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2163 | ||
2131d850 | 2164 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2165 | |
d14a1e28 | 2166 | class ImageHistogram(object): |
093d3ff1 | 2167 | """Proxy of C++ ImageHistogram class""" |
0085ce49 RD |
2168 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2169 | __repr__ = _swig_repr | |
2170 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2171 | """__init__(self) -> ImageHistogram""" |
0085ce49 | 2172 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
e811c8ce | 2173 | def MakeKey(*args, **kwargs): |
0df68c9f | 2174 | """ |
7a27cf7c | 2175 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2176 | |
0df68c9f RD |
2177 | Get the key in the histogram for the given RGB values |
2178 | """ | |
54f9ee45 | 2179 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce RD |
2180 | |
2181 | MakeKey = staticmethod(MakeKey) | |
2182 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2183 | """ |
2184 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2185 | ||
2186 | Find first colour that is not used in the image and has higher RGB | |
2187 | values than startR, startG, startB. Returns a tuple consisting of a | |
2188 | success flag and rgb values. | |
2189 | """ | |
54f9ee45 | 2190 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2191 | |
f1cbd8fa RD |
2192 | def GetCount(*args, **kwargs): |
2193 | """ | |
2194 | GetCount(self, unsigned long key) -> unsigned long | |
2195 | ||
2196 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2197 | key value from a RGB tripple. | |
2198 | """ | |
2199 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2200 | ||
2201 | def GetCountRGB(*args, **kwargs): | |
2202 | """ | |
7a27cf7c | 2203 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2204 | |
2205 | Returns the pixel count for the given RGB values. | |
2206 | """ | |
2207 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2208 | ||
2209 | def GetCountColour(*args, **kwargs): | |
2210 | """ | |
2211 | GetCountColour(self, Colour colour) -> unsigned long | |
2212 | ||
2213 | Returns the pixel count for the given `wx.Colour` value. | |
2214 | """ | |
2215 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2216 | ||
2131d850 | 2217 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d14a1e28 | 2218 | |
e811c8ce | 2219 | def ImageHistogram_MakeKey(*args, **kwargs): |
0085ce49 | 2220 | """ |
7a27cf7c | 2221 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2222 | |
0df68c9f RD |
2223 | Get the key in the histogram for the given RGB values |
2224 | """ | |
0085ce49 | 2225 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 | 2226 | |
943e8dfd RD |
2227 | class Image_RGBValue(object): |
2228 | """ | |
2229 | An object that contains values for red, green and blue which represent | |
2230 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2231 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2232 | color space. | |
2233 | """ | |
0085ce49 RD |
2234 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2235 | __repr__ = _swig_repr | |
2236 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2237 | """ |
2238 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2239 | ||
2240 | Constructor. | |
2241 | """ | |
0085ce49 | 2242 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2243 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2244 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2245 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2246 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2247 | |
2248 | class Image_HSVValue(object): | |
2249 | """ | |
2250 | An object that contains values for hue, saturation and value which | |
2251 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2252 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2253 | color space. | |
2254 | """ | |
0085ce49 RD |
2255 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2256 | __repr__ = _swig_repr | |
2257 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2258 | """ |
2259 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2260 | ||
2261 | Constructor. | |
2262 | """ | |
0085ce49 | 2263 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2264 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2265 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2266 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2267 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2268 | |
d14a1e28 | 2269 | class Image(Object): |
7a27cf7c RD |
2270 | """ |
2271 | A platform-independent image class. An image can be created from | |
2272 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2273 | variety of formats. Functions are available to set and get image | |
2274 | bits, so it can be used for basic image manipulation. | |
2275 | ||
2276 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2277 | platform-specific `wx.Bitmap` object must be created from it using the | |
2278 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2279 | device context, using `wx.DC.DrawBitmap`. | |
2280 | ||
2281 | One colour value of the image may be used as a mask colour which will | |
2282 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2283 | bitmap object. | |
2284 | ||
2285 | wx.Image supports alpha channel data, that is in addition to a byte | |
2286 | for the red, green and blue colour components for each pixel it also | |
2287 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2288 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2289 | means that the pixel is 100% opaque. | |
2290 | ||
2291 | Unlike RGB data, not all images have an alpha channel and before using | |
2292 | `GetAlpha` you should check if this image contains an alpha channel | |
2293 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2294 | with transparency information will have an alpha channel. | |
2295 | """ | |
0085ce49 RD |
2296 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2297 | __repr__ = _swig_repr | |
2298 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2299 | """ |
2300 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2301 | ||
2302 | Loads an image from a file. | |
2303 | """ | |
0085ce49 RD |
2304 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2305 | __swig_destroy__ = _core_.delete_Image | |
2306 | __del__ = lambda self : None; | |
e811c8ce | 2307 | def Create(*args, **kwargs): |
7a27cf7c RD |
2308 | """ |
2309 | Create(self, int width, int height, bool clear=True) | |
2310 | ||
2311 | Creates a fresh image. If clear is ``True``, the new image will be | |
2312 | initialized to black. Otherwise, the image data will be uninitialized. | |
2313 | """ | |
54f9ee45 | 2314 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2315 | |
2316 | def Destroy(*args, **kwargs): | |
0df68c9f | 2317 | """ |
a95a7133 | 2318 | Destroy(self) |
e811c8ce | 2319 | |
7a27cf7c | 2320 | Destroys the image data. |
0df68c9f | 2321 | """ |
7e08d4ef RD |
2322 | val = _core_.Image_Destroy(*args, **kwargs) |
2323 | args[0].thisown = 0 | |
2324 | return val | |
e811c8ce RD |
2325 | |
2326 | def Scale(*args, **kwargs): | |
7a27cf7c | 2327 | """ |
f5263701 | 2328 | Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image |
7a27cf7c RD |
2329 | |
2330 | Returns a scaled version of the image. This is also useful for scaling | |
2331 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
f5263701 RD |
2332 | `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter |
2333 | specifies what method to use for resampling the image. It can be | |
2334 | either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling | |
2335 | method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses | |
2336 | bicubic and box averaging resampling methods for upsampling and | |
2337 | downsampling respectively. | |
7a27cf7c | 2338 | """ |
54f9ee45 | 2339 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce | 2340 | |
f5263701 RD |
2341 | def ResampleBox(*args, **kwargs): |
2342 | """ResampleBox(self, int width, int height) -> Image""" | |
2343 | return _core_.Image_ResampleBox(*args, **kwargs) | |
2344 | ||
2345 | def ResampleBicubic(*args, **kwargs): | |
2346 | """ResampleBicubic(self, int width, int height) -> Image""" | |
2347 | return _core_.Image_ResampleBicubic(*args, **kwargs) | |
2348 | ||
2349 | def Blur(*args, **kwargs): | |
2350 | """ | |
2351 | Blur(self, int radius) -> Image | |
2352 | ||
2353 | Blurs the image in both horizontal and vertical directions by the | |
2354 | specified pixel ``radius``. This should not be used when using a | |
2355 | single mask colour for transparency. | |
2356 | """ | |
2357 | return _core_.Image_Blur(*args, **kwargs) | |
2358 | ||
2359 | def BlurHorizontal(*args, **kwargs): | |
2360 | """ | |
2361 | BlurHorizontal(self, int radius) -> Image | |
2362 | ||
2363 | Blurs the image in the horizontal direction only. This should not be | |
2364 | used when using a single mask colour for transparency. | |
2365 | ||
2366 | """ | |
2367 | return _core_.Image_BlurHorizontal(*args, **kwargs) | |
2368 | ||
2369 | def BlurVertical(*args, **kwargs): | |
2370 | """ | |
2371 | BlurVertical(self, int radius) -> Image | |
2372 | ||
2373 | Blurs the image in the vertical direction only. This should not be | |
2374 | used when using a single mask colour for transparency. | |
2375 | """ | |
2376 | return _core_.Image_BlurVertical(*args, **kwargs) | |
2377 | ||
e811c8ce | 2378 | def ShrinkBy(*args, **kwargs): |
7a27cf7c RD |
2379 | """ |
2380 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2381 | ||
2382 | Return a version of the image scaled smaller by the given factors. | |
2383 | """ | |
54f9ee45 | 2384 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce RD |
2385 | |
2386 | def Rescale(*args, **kwargs): | |
7a27cf7c | 2387 | """ |
f5263701 | 2388 | Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image |
7a27cf7c RD |
2389 | |
2390 | Changes the size of the image in-place by scaling it: after a call to | |
2391 | this function, the image will have the given width and height. | |
2392 | ||
2393 | Returns the (modified) image itself. | |
2394 | """ | |
54f9ee45 | 2395 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 2396 | |
aff4cc5c | 2397 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2398 | """ |
2399 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2400 | ||
2401 | Changes the size of the image in-place without scaling it, by adding | |
2402 | either a border with the given colour or cropping as necessary. The | |
2403 | image is pasted into a new image with the given size and background | |
2404 | colour at the position pos relative to the upper left of the new | |
2405 | image. If red = green = blue = -1 then use either the current mask | |
2406 | colour if set or find, use, and set a suitable mask colour for any | |
2407 | newly exposed areas. | |
2408 | ||
2409 | Returns the (modified) image itself. | |
2410 | """ | |
aff4cc5c RD |
2411 | return _core_.Image_Resize(*args, **kwargs) |
2412 | ||
e811c8ce | 2413 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2414 | """ |
2415 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2416 | ||
2417 | Sets the pixel at the given coordinate. This routine performs | |
2418 | bounds-checks for the coordinate so it can be considered a safe way to | |
2419 | manipulate the data, but in some cases this might be too slow so that | |
2420 | the data will have to be set directly. In that case you will have to | |
2421 | get access to the image data using the `GetData` method. | |
2422 | """ | |
54f9ee45 | 2423 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 2424 | |
aff4cc5c | 2425 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2426 | """ |
2427 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2428 | ||
2429 | Sets the colour of the pixels within the given rectangle. This routine | |
2430 | performs bounds-checks for the rectangle so it can be considered a | |
2431 | safe way to manipulate the data. | |
2432 | """ | |
aff4cc5c RD |
2433 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2434 | ||
e811c8ce | 2435 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2436 | """ |
2437 | GetRed(self, int x, int y) -> byte | |
2438 | ||
2439 | Returns the red intensity at the given coordinate. | |
2440 | """ | |
54f9ee45 | 2441 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce RD |
2442 | |
2443 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2444 | """ |
2445 | GetGreen(self, int x, int y) -> byte | |
2446 | ||
2447 | Returns the green intensity at the given coordinate. | |
2448 | """ | |
54f9ee45 | 2449 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce RD |
2450 | |
2451 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2452 | """ |
2453 | GetBlue(self, int x, int y) -> byte | |
2454 | ||
2455 | Returns the blue intensity at the given coordinate. | |
2456 | """ | |
54f9ee45 | 2457 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce RD |
2458 | |
2459 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2460 | """ |
2461 | SetAlpha(self, int x, int y, byte alpha) | |
2462 | ||
2463 | Sets the alpha value for the given pixel. This function should only be | |
2464 | called if the image has alpha channel data, use `HasAlpha` to check | |
2465 | for this. | |
2466 | """ | |
54f9ee45 | 2467 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce RD |
2468 | |
2469 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2470 | """ |
2471 | GetAlpha(self, int x, int y) -> byte | |
2472 | ||
2473 | Returns the alpha value for the given pixel. This function may only be | |
2474 | called for the images with alpha channel, use `HasAlpha` to check for | |
2475 | this. | |
2476 | ||
2477 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2478 | corresponds to the fully transparent pixels while the value of 255 to | |
2479 | the fully opaque pixels. | |
2480 | """ | |
54f9ee45 | 2481 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce RD |
2482 | |
2483 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2484 | """ |
2485 | HasAlpha(self) -> bool | |
2486 | ||
2487 | Returns true if this image has alpha channel, false otherwise. | |
2488 | """ | |
54f9ee45 | 2489 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 2490 | |
68350608 RD |
2491 | def InitAlpha(*args, **kwargs): |
2492 | """ | |
2493 | InitAlpha(self) | |
2494 | ||
2495 | Initializes the image alpha channel data. It is an error to call it if | |
2496 | the image already has alpha data. If it doesn't, alpha data will be by | |
2497 | default initialized to all pixels being fully opaque. But if the image | |
2498 | has a a mask colour, all mask pixels will be completely transparent. | |
2499 | """ | |
2500 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2501 | ||
bcd0d7b6 RD |
2502 | def IsTransparent(*args, **kwargs): |
2503 | """ | |
7a27cf7c | 2504 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2505 | |
7a27cf7c RD |
2506 | Returns ``True`` if this pixel is masked or has an alpha value less |
2507 | than the spcified threshold. | |
bcd0d7b6 RD |
2508 | """ |
2509 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2510 | ||
e811c8ce | 2511 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2512 | """ |
2513 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2514 | ||
2515 | Find first colour that is not used in the image and has higher RGB | |
2516 | values than startR, startG, startB. Returns a tuple consisting of a | |
2517 | success flag and rgb values. | |
2518 | """ | |
54f9ee45 | 2519 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2520 | |
4cf4100f RD |
2521 | def ConvertAlphaToMask(*args, **kwargs): |
2522 | """ | |
bcd0d7b6 | 2523 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2524 | |
7a27cf7c RD |
2525 | If the image has alpha channel, this method converts it to mask. All |
2526 | pixels with alpha value less than ``threshold`` are replaced with the | |
2527 | mask colour and the alpha channel is removed. The mask colour is | |
2528 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2529 | |
2530 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2531 | nothing. | |
2532 | """ | |
2533 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2534 | ||
8fb0e70a RD |
2535 | def ConvertColourToAlpha(*args, **kwargs): |
2536 | """ | |
7a27cf7c | 2537 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2538 | |
2539 | This method converts an image where the original alpha information is | |
2540 | only available as a shades of a colour (actually shades of grey) | |
2541 | typically when you draw anti-aliased text into a bitmap. The DC | |
2542 | drawing routines draw grey values on the black background although | |
2543 | they actually mean to draw white with differnt alpha values. This | |
2544 | method reverses it, assuming a black (!) background and white text. | |
2545 | The method will then fill up the whole image with the colour given. | |
2546 | """ | |
2547 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2548 | ||
e811c8ce | 2549 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2550 | """ |
2551 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2552 | ||
2553 | Sets the image's mask so that the pixels that have RGB value of | |
2554 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2555 | by first finding an unused colour in the image, setting this colour as | |
2556 | the mask colour and then using this colour to draw all pixels in the | |
2557 | image who corresponding pixel in mask has given RGB value. | |
2558 | ||
2559 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2560 | image or if there is no unused colour left. Returns ``True`` if the | |
2561 | mask was successfully applied. | |
2562 | ||
2563 | Note that this method involves computing the histogram, which is | |
2564 | computationally intensive operation. | |
2565 | """ | |
54f9ee45 | 2566 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce RD |
2567 | |
2568 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2569 | """ |
2570 | CanRead(String filename) -> bool | |
2571 | ||
2572 | Returns True if the image handlers can read this file. | |
2573 | """ | |
54f9ee45 | 2574 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce RD |
2575 | |
2576 | CanRead = staticmethod(CanRead) | |
2577 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2578 | """ |
2579 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2580 | ||
2581 | If the image file contains more than one image and the image handler | |
2582 | is capable of retrieving these individually, this function will return | |
2583 | the number of available images. | |
2584 | """ | |
54f9ee45 | 2585 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce RD |
2586 | |
2587 | GetImageCount = staticmethod(GetImageCount) | |
2588 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2589 | """ |
2590 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2591 | ||
2592 | Loads an image from a file. If no handler type is provided, the | |
2593 | library will try to autodetect the format. | |
2594 | """ | |
54f9ee45 | 2595 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce RD |
2596 | |
2597 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2598 | """ |
2599 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2600 | ||
2601 | Loads an image from a file, specifying the image type with a MIME type | |
2602 | string. | |
2603 | """ | |
54f9ee45 | 2604 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce RD |
2605 | |
2606 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2607 | """ |
2608 | SaveFile(self, String name, int type) -> bool | |
2609 | ||
2610 | Saves an image in the named file. | |
2611 | """ | |
54f9ee45 | 2612 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce RD |
2613 | |
2614 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2615 | """ |
2616 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2617 | ||
2618 | Saves an image in the named file. | |
2619 | """ | |
54f9ee45 | 2620 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce RD |
2621 | |
2622 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2623 | """ |
2624 | CanReadStream(InputStream stream) -> bool | |
2625 | ||
2626 | Returns True if the image handlers can read an image file from the | |
2627 | data currently on the input stream, or a readable Python file-like | |
2628 | object. | |
2629 | """ | |
54f9ee45 | 2630 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce RD |
2631 | |
2632 | CanReadStream = staticmethod(CanReadStream) | |
2633 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2634 | """ |
2635 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2636 | ||
2637 | Loads an image from an input stream or a readable Python file-like | |
2638 | object. If no handler type is provided, the library will try to | |
2639 | autodetect the format. | |
2640 | """ | |
54f9ee45 | 2641 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce RD |
2642 | |
2643 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2644 | """ |
2645 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2646 | ||
2647 | Loads an image from an input stream or a readable Python file-like | |
2648 | object, using a MIME type string to specify the image file format. | |
2649 | """ | |
54f9ee45 | 2650 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce RD |
2651 | |
2652 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2653 | """ |
2654 | Ok(self) -> bool | |
2655 | ||
2656 | Returns true if image data is present. | |
2657 | """ | |
54f9ee45 | 2658 | return _core_.Image_Ok(*args, **kwargs) |
e811c8ce RD |
2659 | |
2660 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2661 | """ |
2662 | GetWidth(self) -> int | |
2663 | ||
2664 | Gets the width of the image in pixels. | |
2665 | """ | |
54f9ee45 | 2666 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce RD |
2667 | |
2668 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2669 | """ |
2670 | GetHeight(self) -> int | |
2671 | ||
2672 | Gets the height of the image in pixels. | |
2673 | """ | |
54f9ee45 | 2674 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 2675 | |
b2df227b | 2676 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
2677 | """ |
2678 | GetSize(self) -> Size | |
2679 | ||
2680 | Returns the size of the image in pixels. | |
2681 | """ | |
54f9ee45 | 2682 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 2683 | |
e811c8ce | 2684 | def GetSubImage(*args, **kwargs): |
7a27cf7c RD |
2685 | """ |
2686 | GetSubImage(self, Rect rect) -> Image | |
2687 | ||
2688 | Returns a sub image of the current one as long as the rect belongs | |
2689 | entirely to the image. | |
2690 | """ | |
54f9ee45 | 2691 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 2692 | |
aff4cc5c | 2693 | def Size(*args, **kwargs): |
7a27cf7c RD |
2694 | """ |
2695 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2696 | ||
2697 | Returns a resized version of this image without scaling it by adding | |
2698 | either a border with the given colour or cropping as necessary. The | |
2699 | image is pasted into a new image with the given size and background | |
2700 | colour at the position ``pos`` relative to the upper left of the new | |
2701 | image. If red = green = blue = -1 then use either the current mask | |
2702 | colour if set or find, use, and set a suitable mask colour for any | |
2703 | newly exposed areas. | |
2704 | """ | |
aff4cc5c RD |
2705 | return _core_.Image_Size(*args, **kwargs) |
2706 | ||
e811c8ce | 2707 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2708 | """ |
2709 | Copy(self) -> Image | |
2710 | ||
2711 | Returns an identical copy of the image. | |
2712 | """ | |
54f9ee45 | 2713 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce RD |
2714 | |
2715 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2716 | """ |
2717 | Paste(self, Image image, int x, int y) | |
2718 | ||
2719 | Pastes ``image`` into this instance and takes care of the mask colour | |
2720 | and any out of bounds problems. | |
2721 | """ | |
54f9ee45 | 2722 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
2723 | |
2724 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
2725 | """ |
2726 | GetData(self) -> PyObject | |
2727 | ||
2728 | Returns a string containing a copy of the RGB bytes of the image. | |
2729 | """ | |
54f9ee45 | 2730 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
2731 | |
2732 | def SetData(*args, **kwargs): | |
61d07ac7 RD |
2733 | """ |
2734 | SetData(self, buffer data) | |
2735 | ||
2736 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2737 | either a string or a buffer object holding the data and the length of | |
2738 | the data must be width*height*3. | |
2739 | """ | |
54f9ee45 | 2740 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
2741 | |
2742 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2743 | """ |
2744 | GetDataBuffer(self) -> PyObject | |
2745 | ||
2746 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2747 | image data buffer inside the wx.Image. You need to ensure that you do |
2748 | not use this buffer object after the image has been destroyed. | |
61d07ac7 | 2749 | """ |
54f9ee45 | 2750 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2751 | |
2752 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2753 | """ |
2754 | SetDataBuffer(self, buffer data) | |
2755 | ||
2756 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2757 | object. This can save making an extra copy of the data but you must |
2758 | ensure that the buffer object lives longer than the wx.Image does. | |
61d07ac7 | 2759 | """ |
54f9ee45 | 2760 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2761 | |
2762 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2763 | """ |
2764 | GetAlphaData(self) -> PyObject | |
2765 | ||
2766 | Returns a string containing a copy of the alpha bytes of the image. | |
2767 | """ | |
54f9ee45 | 2768 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
2769 | |
2770 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2771 | """ |
2772 | SetAlphaData(self, buffer alpha) | |
2773 | ||
2774 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2775 | a string or a buffer object holding the data and the length of the | |
2776 | data must be width*height. | |
2777 | """ | |
54f9ee45 | 2778 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
2779 | |
2780 | def GetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2781 | """ |
2782 | GetAlphaBuffer(self) -> PyObject | |
2783 | ||
2784 | Returns a writable Python buffer object that is pointing at the Alpha | |
2785 | data buffer inside the wx.Image. You need to ensure that you do not | |
2786 | use this buffer object after the image has been destroyed. | |
2787 | """ | |
54f9ee45 | 2788 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2789 | |
2790 | def SetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2791 | """ |
2792 | SetAlphaBuffer(self, buffer alpha) | |
2793 | ||
2794 | Sets the internal image alpha pointer to point at a Python buffer | |
2795 | object. This can save making an extra copy of the data but you must | |
2796 | ensure that the buffer object lives as long as the wx.Image does. | |
2797 | """ | |
54f9ee45 | 2798 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2799 | |
2800 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2801 | """ |
2802 | SetMaskColour(self, byte r, byte g, byte b) | |
2803 | ||
2804 | Sets the mask colour for this image (and tells the image to use the | |
2805 | mask). | |
2806 | """ | |
54f9ee45 | 2807 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 2808 | |
aff4cc5c RD |
2809 | def GetOrFindMaskColour(*args, **kwargs): |
2810 | """ | |
2811 | GetOrFindMaskColour() -> (r,g,b) | |
2812 | ||
2813 | Get the current mask colour or find a suitable colour. | |
2814 | """ | |
2815 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2816 | ||
e811c8ce | 2817 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2818 | """ |
2819 | GetMaskRed(self) -> byte | |
2820 | ||
2821 | Gets the red component of the mask colour. | |
2822 | """ | |
54f9ee45 | 2823 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce RD |
2824 | |
2825 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2826 | """ |
2827 | GetMaskGreen(self) -> byte | |
2828 | ||
2829 | Gets the green component of the mask colour. | |
2830 | """ | |
54f9ee45 | 2831 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce RD |
2832 | |
2833 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2834 | """ |
2835 | GetMaskBlue(self) -> byte | |
2836 | ||
2837 | Gets the blue component of the mask colour. | |
2838 | """ | |
54f9ee45 | 2839 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce RD |
2840 | |
2841 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2842 | """ |
2843 | SetMask(self, bool mask=True) | |
2844 | ||
2845 | Specifies whether there is a mask or not. The area of the mask is | |
2846 | determined by the current mask colour. | |
2847 | """ | |
54f9ee45 | 2848 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce RD |
2849 | |
2850 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2851 | """ |
2852 | HasMask(self) -> bool | |
2853 | ||
2854 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2855 | """ | |
54f9ee45 | 2856 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
2857 | |
2858 | def Rotate(*args, **kwargs): | |
0df68c9f | 2859 | """ |
a95a7133 | 2860 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 2861 | Point offset_after_rotation=None) -> Image |
7a27cf7c RD |
2862 | |
2863 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2864 | ``True`` to ``interpolating`` results in better image quality, but is | |
2865 | slower. If the image has a mask, then the mask colour is used for the | |
2866 | uncovered pixels in the rotated image background. Otherwise, black | |
2867 | will be used as the fill colour. | |
2868 | ||
2869 | Returns the rotated image, leaving this image intact. | |
0df68c9f | 2870 | """ |
54f9ee45 | 2871 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce RD |
2872 | |
2873 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2874 | """ |
2875 | Rotate90(self, bool clockwise=True) -> Image | |
2876 | ||
2877 | Returns a copy of the image rotated 90 degrees in the direction | |
2878 | indicated by ``clockwise``. | |
2879 | """ | |
54f9ee45 | 2880 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce RD |
2881 | |
2882 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2883 | """ |
2884 | Mirror(self, bool horizontally=True) -> Image | |
2885 | ||
2886 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2887 | indicates the orientation. | |
2888 | """ | |
54f9ee45 | 2889 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
2890 | |
2891 | def Replace(*args, **kwargs): | |
0df68c9f | 2892 | """ |
7a27cf7c RD |
2893 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2894 | ||
2895 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2896 | ``(r2,g2,b2)``. | |
0df68c9f | 2897 | """ |
54f9ee45 | 2898 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce | 2899 | |
32fe5131 RD |
2900 | def ConvertToGreyscale(*args, **kwargs): |
2901 | """ | |
2902 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2903 | ||
2904 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2905 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2906 | defaults to ITU-T BT.601 | |
2907 | """ | |
2908 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2909 | ||
e811c8ce | 2910 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2911 | """ |
2912 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2913 | ||
2914 | Returns monochromatic version of the image. The returned image has | |
2915 | white colour where the original has ``(r,g,b)`` colour and black | |
2916 | colour everywhere else. | |
2917 | """ | |
54f9ee45 | 2918 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce RD |
2919 | |
2920 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2921 | """ |
2922 | SetOption(self, String name, String value) | |
2923 | ||
2924 | Sets an image handler defined option. For example, when saving as a | |
2925 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2926 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2927 | """ | |
54f9ee45 | 2928 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce RD |
2929 | |
2930 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2931 | """ |
2932 | SetOptionInt(self, String name, int value) | |
2933 | ||
2934 | Sets an image option as an integer. | |
2935 | """ | |
54f9ee45 | 2936 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce RD |
2937 | |
2938 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2939 | """ |
2940 | GetOption(self, String name) -> String | |
2941 | ||
2942 | Gets the value of an image handler option. | |
2943 | """ | |
54f9ee45 | 2944 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce RD |
2945 | |
2946 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2947 | """ |
2948 | GetOptionInt(self, String name) -> int | |
2949 | ||
2950 | Gets the value of an image handler option as an integer. If the given | |
2951 | option is not present, the function returns 0. | |
2952 | """ | |
54f9ee45 | 2953 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce RD |
2954 | |
2955 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2956 | """ |
2957 | HasOption(self, String name) -> bool | |
2958 | ||
2959 | Returns true if the given option is present. | |
2960 | """ | |
54f9ee45 | 2961 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
2962 | |
2963 | def CountColours(*args, **kwargs): | |
a95a7133 | 2964 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 2965 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
2966 | |
2967 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 2968 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 2969 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
2970 | |
2971 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2972 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 2973 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
2974 | |
2975 | AddHandler = staticmethod(AddHandler) | |
2976 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 2977 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 2978 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
2979 | |
2980 | InsertHandler = staticmethod(InsertHandler) | |
2981 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 2982 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 2983 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce RD |
2984 | |
2985 | RemoveHandler = staticmethod(RemoveHandler) | |
0085ce49 RD |
2986 | def GetHandlers(*args, **kwargs): |
2987 | """GetHandlers() -> PyObject""" | |
2988 | return _core_.Image_GetHandlers(*args, **kwargs) | |
2989 | ||
2990 | GetHandlers = staticmethod(GetHandlers) | |
e811c8ce | 2991 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
2992 | """ |
2993 | GetImageExtWildcard() -> String | |
2994 | ||
2995 | Iterates all registered wxImageHandler objects, and returns a string | |
2996 | containing file extension masks suitable for passing to file open/save | |
2997 | dialog boxes. | |
2998 | """ | |
54f9ee45 | 2999 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
3000 | |
3001 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
3002 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 3003 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 3004 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
3005 | |
3006 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 3007 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 3008 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce | 3009 | |
943e8dfd RD |
3010 | def RotateHue(*args, **kwargs): |
3011 | """ | |
3012 | RotateHue(self, double angle) | |
3013 | ||
3014 | Rotates the hue of each pixel of the image. Hue is a double in the | |
3015 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
3016 | """ | |
3017 | return _core_.Image_RotateHue(*args, **kwargs) | |
3018 | ||
3019 | def RGBtoHSV(*args, **kwargs): | |
3020 | """ | |
3021 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3022 | ||
3023 | Converts a color in RGB color space to HSV color space. | |
3024 | """ | |
3025 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3026 | ||
3027 | RGBtoHSV = staticmethod(RGBtoHSV) | |
3028 | def HSVtoRGB(*args, **kwargs): | |
3029 | """ | |
3030 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3031 | ||
3032 | Converts a color in HSV color space to RGB color space. | |
3033 | """ | |
3034 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3035 | ||
3036 | HSVtoRGB = staticmethod(HSVtoRGB) | |
e811c8ce | 3037 | def __nonzero__(self): return self.Ok() |
97ab0f6a RD |
3038 | AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`") |
3039 | AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`") | |
3040 | Data = property(GetData,SetData,doc="See `GetData` and `SetData`") | |
3041 | DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`") | |
3042 | Height = property(GetHeight,doc="See `GetHeight`") | |
3043 | MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`") | |
3044 | MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`") | |
3045 | MaskRed = property(GetMaskRed,doc="See `GetMaskRed`") | |
3046 | Size = property(GetSize,doc="See `GetSize`") | |
3047 | Width = property(GetWidth,doc="See `GetWidth`") | |
2131d850 | 3048 | _core_.Image_swigregister(Image) |
d14a1e28 RD |
3049 | |
3050 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
3051 | """ |
3052 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
3053 | ||
3054 | Loads an image from a file, using a MIME type string (such as | |
3055 | 'image/jpeg') to specify image type. | |
3056 | """ | |
54f9ee45 | 3057 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 RD |
3058 | return val |
3059 | ||
3060 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
3061 | """ |
3062 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
3063 | ||
3064 | Loads an image from an input stream, or any readable Python file-like | |
3065 | object. | |
3066 | """ | |
54f9ee45 | 3067 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 RD |
3068 | return val |
3069 | ||
3070 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
3071 | """ |
3072 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3073 | ||
3074 | Loads an image from an input stream, or any readable Python file-like | |
3075 | object, specifying the image format with a MIME type string. | |
3076 | """ | |
54f9ee45 | 3077 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
3078 | return val |
3079 | ||
66c033b4 | 3080 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
3081 | """ |
3082 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
3083 | ||
3084 | Construct an empty image of a given size, optionally setting all | |
3085 | pixels to black. | |
3086 | """ | |
66c033b4 | 3087 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
3088 | return val |
3089 | ||
3090 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
3091 | """ |
3092 | ImageFromBitmap(Bitmap bitmap) -> Image | |
3093 | ||
3094 | Construct an Image from a `wx.Bitmap`. | |
3095 | """ | |
54f9ee45 | 3096 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
3097 | return val |
3098 | ||
3099 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
3100 | """ |
3101 | ImageFromData(int width, int height, buffer data) -> Image | |
3102 | ||
3103 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3104 | string or a buffer object holding the data and the length of the data | |
3105 | must be width*height*3. | |
3106 | """ | |
54f9ee45 | 3107 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
3108 | return val |
3109 | ||
1823fbb4 | 3110 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
3111 | """ |
3112 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
3113 | ||
3114 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3115 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
3116 | length of the data must be width*height*3 bytes, and the length of the |
3117 | alpha data must be width*height bytes. | |
61d07ac7 | 3118 | """ |
1823fbb4 | 3119 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
1823fbb4 RD |
3120 | return val |
3121 | ||
e811c8ce | 3122 | def Image_CanRead(*args, **kwargs): |
0085ce49 | 3123 | """ |
7a27cf7c RD |
3124 | Image_CanRead(String filename) -> bool |
3125 | ||
3126 | Returns True if the image handlers can read this file. | |
3127 | """ | |
0085ce49 | 3128 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 3129 | |
e811c8ce | 3130 | def Image_GetImageCount(*args, **kwargs): |
0085ce49 | 3131 | """ |
7a27cf7c RD |
3132 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
3133 | ||
3134 | If the image file contains more than one image and the image handler | |
3135 | is capable of retrieving these individually, this function will return | |
3136 | the number of available images. | |
3137 | """ | |
0085ce49 | 3138 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 3139 | |
e811c8ce | 3140 | def Image_CanReadStream(*args, **kwargs): |
0085ce49 | 3141 | """ |
7a27cf7c RD |
3142 | Image_CanReadStream(InputStream stream) -> bool |
3143 | ||
3144 | Returns True if the image handlers can read an image file from the | |
3145 | data currently on the input stream, or a readable Python file-like | |
3146 | object. | |
3147 | """ | |
0085ce49 | 3148 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 3149 | |
e811c8ce | 3150 | def Image_AddHandler(*args, **kwargs): |
0085ce49 RD |
3151 | """Image_AddHandler(ImageHandler handler)""" |
3152 | return _core_.Image_AddHandler(*args, **kwargs) | |
d14a1e28 | 3153 | |
e811c8ce | 3154 | def Image_InsertHandler(*args, **kwargs): |
0085ce49 RD |
3155 | """Image_InsertHandler(ImageHandler handler)""" |
3156 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d14a1e28 | 3157 | |
e811c8ce | 3158 | def Image_RemoveHandler(*args, **kwargs): |
0085ce49 RD |
3159 | """Image_RemoveHandler(String name) -> bool""" |
3160 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d14a1e28 | 3161 | |
0085ce49 RD |
3162 | def Image_GetHandlers(*args): |
3163 | """Image_GetHandlers() -> PyObject""" | |
3164 | return _core_.Image_GetHandlers(*args) | |
3165 | ||
3166 | def Image_GetImageExtWildcard(*args): | |
3167 | """ | |
7a27cf7c RD |
3168 | Image_GetImageExtWildcard() -> String |
3169 | ||
3170 | Iterates all registered wxImageHandler objects, and returns a string | |
3171 | containing file extension masks suitable for passing to file open/save | |
3172 | dialog boxes. | |
3173 | """ | |
0085ce49 | 3174 | return _core_.Image_GetImageExtWildcard(*args) |
d14a1e28 | 3175 | |
943e8dfd | 3176 | def Image_RGBtoHSV(*args, **kwargs): |
0085ce49 | 3177 | """ |
943e8dfd RD |
3178 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3179 | ||
3180 | Converts a color in RGB color space to HSV color space. | |
3181 | """ | |
0085ce49 | 3182 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3183 | |
3184 | def Image_HSVtoRGB(*args, **kwargs): | |
0085ce49 | 3185 | """ |
943e8dfd RD |
3186 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3187 | ||
3188 | Converts a color in HSV color space to RGB color space. | |
3189 | """ | |
0085ce49 | 3190 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3191 | |
fc46b7f3 RD |
3192 | |
3193 | def _ImageFromBuffer(*args, **kwargs): | |
3194 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3195 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3196 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3197 | """ | |
3198 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
eec1c382 RD |
3199 | parameter must be a Python object that implements the buffer interface, |
3200 | such as a string, array, etc. The dataBuffer object is expected to | |
3201 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3202 | object can optionally be supplied for the image's alpha channel data, and | |
3203 | it is expected to be width*height bytes long. | |
fc46b7f3 RD |
3204 | |
3205 | The wx.Image will be created with its data and alpha pointers initialized | |
3206 | to the memory address pointed to by the buffer objects, thus saving the | |
3207 | time needed to copy the image data from the buffer object to the wx.Image. | |
3208 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3209 | risks associated with sharing a C pointer between two objects. | |
3210 | ||
3211 | To help alleviate the risk a reference to the data and alpha buffer | |
3212 | objects are kept with the wx.Image, so that they won't get deleted until | |
3213 | after the wx.Image is deleted. However please be aware that it is not | |
3214 | guaranteed that an object won't move its memory buffer to a new location | |
3215 | when it needs to resize its contents. If that happens then the wx.Image | |
3216 | will end up referring to an invalid memory location and could cause the | |
3217 | application to crash. Therefore care should be taken to not manipulate | |
3218 | the objects used for the data and alpha buffers in a way that would cause | |
3219 | them to change size. | |
3220 | """ | |
fc46b7f3 RD |
3221 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) |
3222 | image._buffer = dataBuffer | |
3223 | image._alpha = alphaBuffer | |
3224 | return image | |
3225 | ||
5e4ca4a8 RD |
3226 | def InitAllImageHandlers(): |
3227 | """ | |
3228 | The former functionality of InitAllImageHanders is now done internal to | |
3229 | the _core_ extension module and so this function has become a simple NOP. | |
3230 | """ | |
3231 | pass | |
d14a1e28 | 3232 | |
54f9ee45 RD |
3233 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3234 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3235 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3236 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3237 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
54f9ee45 RD |
3238 | BMP_24BPP = _core_.BMP_24BPP |
3239 | BMP_8BPP = _core_.BMP_8BPP | |
3240 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3241 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3242 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3243 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3244 | BMP_4BPP = _core_.BMP_4BPP | |
3245 | BMP_1BPP = _core_.BMP_1BPP | |
3246 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
d14a1e28 | 3247 | class BMPHandler(ImageHandler): |
27fb7603 | 3248 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
0085ce49 RD |
3249 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3250 | __repr__ = _swig_repr | |
3251 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3252 | """ |
3253 | __init__(self) -> BMPHandler | |
3254 | ||
3255 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3256 | """ | |
0085ce49 | 3257 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3258 | _core_.BMPHandler_swigregister(BMPHandler) |
d14a1e28 | 3259 | NullImage = cvar.NullImage |
0c243d93 | 3260 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 RD |
3261 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3262 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3263 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3264 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
0c243d93 RD |
3265 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3266 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3267 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3268 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 RD |
3269 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3270 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3271 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3272 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3273 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3274 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3275 | |
3276 | class ICOHandler(BMPHandler): | |
27fb7603 | 3277 | """A `wx.ImageHandler` for \*.ico icon files.""" |
0085ce49 RD |
3278 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3279 | __repr__ = _swig_repr | |
3280 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3281 | """ |
3282 | __init__(self) -> ICOHandler | |
3283 | ||
3284 | A `wx.ImageHandler` for \*.ico icon files. | |
3285 | """ | |
0085ce49 | 3286 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3287 | _core_.ICOHandler_swigregister(ICOHandler) |
d14a1e28 RD |
3288 | |
3289 | class CURHandler(ICOHandler): | |
27fb7603 | 3290 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
0085ce49 RD |
3291 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3292 | __repr__ = _swig_repr | |
3293 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3294 | """ |
3295 | __init__(self) -> CURHandler | |
3296 | ||
3297 | A `wx.ImageHandler` for \*.cur cursor files. | |
3298 | """ | |
0085ce49 | 3299 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3300 | _core_.CURHandler_swigregister(CURHandler) |
d14a1e28 RD |
3301 | |
3302 | class ANIHandler(CURHandler): | |
27fb7603 | 3303 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
0085ce49 RD |
3304 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3305 | __repr__ = _swig_repr | |
3306 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3307 | """ |
3308 | __init__(self) -> ANIHandler | |
3309 | ||
3310 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3311 | """ | |
0085ce49 | 3312 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3313 | _core_.ANIHandler_swigregister(ANIHandler) |
d14a1e28 RD |
3314 | |
3315 | class PNGHandler(ImageHandler): | |
27fb7603 | 3316 | """A `wx.ImageHandler` for PNG image files.""" |
0085ce49 RD |
3317 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3318 | __repr__ = _swig_repr | |
3319 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3320 | """ |
3321 | __init__(self) -> PNGHandler | |
3322 | ||
3323 | A `wx.ImageHandler` for PNG image files. | |
3324 | """ | |
0085ce49 | 3325 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3326 | _core_.PNGHandler_swigregister(PNGHandler) |
d14a1e28 RD |
3327 | |
3328 | class GIFHandler(ImageHandler): | |
27fb7603 | 3329 | """A `wx.ImageHandler` for GIF image files.""" |
0085ce49 RD |
3330 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3331 | __repr__ = _swig_repr | |
3332 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3333 | """ |
3334 | __init__(self) -> GIFHandler | |
3335 | ||
3336 | A `wx.ImageHandler` for GIF image files. | |
3337 | """ | |
0085ce49 | 3338 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3339 | _core_.GIFHandler_swigregister(GIFHandler) |
d14a1e28 RD |
3340 | |
3341 | class PCXHandler(ImageHandler): | |
27fb7603 | 3342 | """A `wx.ImageHandler` for PCX imager files.""" |
0085ce49 RD |
3343 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3344 | __repr__ = _swig_repr | |
3345 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3346 | """ |
3347 | __init__(self) -> PCXHandler | |
3348 | ||
3349 | A `wx.ImageHandler` for PCX imager files. | |
3350 | """ | |
0085ce49 | 3351 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3352 | _core_.PCXHandler_swigregister(PCXHandler) |
d14a1e28 RD |
3353 | |
3354 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3355 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
0085ce49 RD |
3356 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3357 | __repr__ = _swig_repr | |
3358 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3359 | """ |
3360 | __init__(self) -> JPEGHandler | |
3361 | ||
3362 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3363 | """ | |
0085ce49 | 3364 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3365 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d14a1e28 RD |
3366 | |
3367 | class PNMHandler(ImageHandler): | |
27fb7603 | 3368 | """A `wx.ImageHandler` for PNM image files.""" |
0085ce49 RD |
3369 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3370 | __repr__ = _swig_repr | |
3371 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3372 | """ |
3373 | __init__(self) -> PNMHandler | |
3374 | ||
3375 | A `wx.ImageHandler` for PNM image files. | |
3376 | """ | |
0085ce49 | 3377 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3378 | _core_.PNMHandler_swigregister(PNMHandler) |
d14a1e28 RD |
3379 | |
3380 | class XPMHandler(ImageHandler): | |
27fb7603 | 3381 | """A `wx.ImageHandler` for XPM image.""" |
0085ce49 RD |
3382 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3383 | __repr__ = _swig_repr | |
3384 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3385 | """ |
3386 | __init__(self) -> XPMHandler | |
3387 | ||
3388 | A `wx.ImageHandler` for XPM image. | |
3389 | """ | |
0085ce49 | 3390 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3391 | _core_.XPMHandler_swigregister(XPMHandler) |
d14a1e28 RD |
3392 | |
3393 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3394 | """A `wx.ImageHandler` for TIFF image files.""" |
0085ce49 RD |
3395 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3396 | __repr__ = _swig_repr | |
3397 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3398 | """ |
3399 | __init__(self) -> TIFFHandler | |
3400 | ||
3401 | A `wx.ImageHandler` for TIFF image files. | |
3402 | """ | |
0085ce49 | 3403 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3404 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d14a1e28 | 3405 | |
c0de73ae RD |
3406 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3407 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3408 | class Quantize(object): | |
3409 | """Performs quantization, or colour reduction, on a wxImage.""" | |
0085ce49 RD |
3410 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3411 | def __init__(self): raise AttributeError, "No constructor defined" | |
3412 | __repr__ = _swig_repr | |
c0de73ae RD |
3413 | def Quantize(*args, **kwargs): |
3414 | """ | |
3415 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3416 | ||
3417 | Reduce the colours in the source image and put the result into the | |
3418 | destination image, setting the palette in the destination if | |
3419 | needed. Both images may be the same, to overwrite the source image. | |
3420 | """ | |
3421 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3422 | ||
3423 | Quantize = staticmethod(Quantize) | |
2131d850 | 3424 | _core_.Quantize_swigregister(Quantize) |
c0de73ae RD |
3425 | |
3426 | def Quantize_Quantize(*args, **kwargs): | |
0085ce49 | 3427 | """ |
c0de73ae RD |
3428 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
3429 | ||
3430 | Reduce the colours in the source image and put the result into the | |
3431 | destination image, setting the palette in the destination if | |
3432 | needed. Both images may be the same, to overwrite the source image. | |
3433 | """ | |
0085ce49 | 3434 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3435 | |
d14a1e28 RD |
3436 | #--------------------------------------------------------------------------- |
3437 | ||
3438 | class EvtHandler(Object): | |
093d3ff1 | 3439 | """Proxy of C++ EvtHandler class""" |
0085ce49 RD |
3440 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3441 | __repr__ = _swig_repr | |
3442 | def __init__(self, *args, **kwargs): | |
a95a7133 | 3443 | """__init__(self) -> EvtHandler""" |
0085ce49 | 3444 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
d49bdf34 RD |
3445 | self._setOORInfo(self) |
3446 | ||
e811c8ce | 3447 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3448 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3449 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3450 | |
3451 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3452 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3453 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3454 | |
3455 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3456 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3457 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3458 | |
3459 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3460 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3461 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3462 | |
3463 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3464 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3465 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3466 | |
3467 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3468 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3469 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3470 | |
3471 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3472 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3473 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3474 | |
3475 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3476 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3477 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3478 | |
3479 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3480 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3481 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3482 | |
3483 | def Connect(*args, **kwargs): | |
a95a7133 | 3484 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3485 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3486 | |
3487 | def Disconnect(*args, **kwargs): | |
2131d850 | 3488 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3489 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3490 | |
3491 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3492 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef RD |
3493 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3494 | args[0].thisown = 0 | |
3495 | return val | |
e811c8ce | 3496 | |
d14a1e28 RD |
3497 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3498 | """ | |
3499 | Bind an event to an event handler. | |
3500 | ||
db3e571a RD |
3501 | :param event: One of the EVT_* objects that specifies the |
3502 | type of event to bind, | |
d14a1e28 | 3503 | |
db3e571a RD |
3504 | :param handler: A callable object to be invoked when the |
3505 | event is delivered to self. Pass None to | |
3506 | disconnect an event handler. | |
d14a1e28 | 3507 | |
db3e571a RD |
3508 | :param source: Sometimes the event originates from a |
3509 | different window than self, but you still | |
3510 | want to catch it in self. (For example, a | |
3511 | button event delivered to a frame.) By | |
3512 | passing the source of the event, the event | |
3513 | handling system is able to differentiate | |
3514 | between the same event type from different | |
3515 | controls. | |
d14a1e28 | 3516 | |
db3e571a RD |
3517 | :param id: Used to spcify the event source by ID instead |
3518 | of instance. | |
3519 | ||
3520 | :param id2: Used when it is desirable to bind a handler | |
3521 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d14a1e28 RD |
3522 | """ |
3523 | if source is not None: | |
3524 | id = source.GetId() | |
3525 | event.Bind(self, id, id2, handler) | |
3526 | ||
66c033b4 RD |
3527 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3528 | """ | |
3529 | Disconencts the event handler binding for event from self. | |
3530 | Returns True if successful. | |
3531 | """ | |
3532 | if source is not None: | |
3533 | id = source.GetId() | |
3534 | return event.Unbind(self, id, id2) | |
d14a1e28 | 3535 | |
97ab0f6a RD |
3536 | EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`") |
3537 | NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`") | |
3538 | PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`") | |
2131d850 | 3539 | _core_.EvtHandler_swigregister(EvtHandler) |
d14a1e28 RD |
3540 | |
3541 | #--------------------------------------------------------------------------- | |
3542 | ||
3543 | class PyEventBinder(object): | |
3544 | """ | |
3545 | Instances of this class are used to bind specific events to event | |
3546 | handlers. | |
3547 | """ | |
3548 | def __init__(self, evtType, expectedIDs=0): | |
3549 | if expectedIDs not in [0, 1, 2]: | |
3550 | raise ValueError, "Invalid number of expectedIDs" | |
3551 | self.expectedIDs = expectedIDs | |
3552 | ||
3553 | if type(evtType) == list or type(evtType) == tuple: | |
3554 | self.evtType = evtType | |
3555 | else: | |
3556 | self.evtType = [evtType] | |
3557 | ||
3558 | ||
3559 | def Bind(self, target, id1, id2, function): | |
3560 | """Bind this set of event types to target.""" | |
3561 | for et in self.evtType: | |
3562 | target.Connect(id1, id2, et, function) | |
3563 | ||
66c033b4 RD |
3564 | |
3565 | def Unbind(self, target, id1, id2): | |
3566 | """Remove an event binding.""" | |
3567 | success = 0 | |
3568 | for et in self.evtType: | |
3569 | success += target.Disconnect(id1, id2, et) | |
3570 | return success != 0 | |
3571 | ||
d14a1e28 RD |
3572 | |
3573 | def __call__(self, *args): | |
3574 | """ | |
3575 | For backwards compatibility with the old EVT_* functions. | |
3576 | Should be called with either (window, func), (window, ID, | |
3577 | func) or (window, ID1, ID2, func) parameters depending on the | |
3578 | type of the event. | |
3579 | """ | |
3580 | assert len(args) == 2 + self.expectedIDs | |
3581 | id1 = wx.ID_ANY | |
3582 | id2 = wx.ID_ANY | |
3583 | target = args[0] | |
3584 | if self.expectedIDs == 0: | |
3585 | func = args[1] | |
3586 | elif self.expectedIDs == 1: | |
3587 | id1 = args[1] | |
3588 | func = args[2] | |
3589 | elif self.expectedIDs == 2: | |
3590 | id1 = args[1] | |
3591 | id2 = args[2] | |
3592 | func = args[3] | |
3593 | else: | |
3594 | raise ValueError, "Unexpected number of IDs" | |
3595 | ||
3596 | self.Bind(target, id1, id2, func) | |
3597 | ||
3598 | ||
3599 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3600 | def EVT_COMMAND(win, id, cmd, func): | |
3601 | win.Connect(id, -1, cmd, func) | |
3602 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3603 | win.Connect(id1, id2, cmd, func) | |
3604 | ||
3605 | ||
3606 | #--------------------------------------------------------------------------- | |
3607 | ||
3608 | #--------------------------------------------------------------------------- | |
3609 | ||
54f9ee45 RD |
3610 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3611 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3612 | |
0085ce49 | 3613 | def NewEventType(*args): |
2131d850 | 3614 | """NewEventType() -> EventType""" |
0085ce49 | 3615 | return _core_.NewEventType(*args) |
54f9ee45 RD |
3616 | wxEVT_NULL = _core_.wxEVT_NULL |
3617 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3618 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3619 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3620 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3621 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3622 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3623 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3624 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3625 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3626 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3627 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3628 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3629 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3630 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3631 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3632 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3633 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3634 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3635 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3636 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3637 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3638 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3639 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3640 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3641 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3642 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3643 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3644 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3645 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3646 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3647 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3648 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3649 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3650 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3651 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3652 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3653 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3654 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3655 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3656 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3657 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3658 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3659 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3660 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3661 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3662 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3663 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3664 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3665 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3666 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3667 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3668 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3669 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3670 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3671 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3672 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3673 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3674 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3675 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3676 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3677 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3678 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3679 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
54f9ee45 RD |
3680 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3681 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3682 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3683 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3684 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3685 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3686 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3687 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3688 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3689 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3690 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3691 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3692 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3693 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
54f9ee45 RD |
3694 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
3695 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3696 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3697 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3698 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3699 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3700 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
34e0a3bb | 3701 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST |
54f9ee45 RD |
3702 | wxEVT_PAINT = _core_.wxEVT_PAINT |
3703 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3704 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3705 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3706 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3707 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3708 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3709 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3710 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3711 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3712 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3713 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3714 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3715 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3716 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3717 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3718 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3719 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3720 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3721 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3722 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3723 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3724 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
2131d850 RD |
3725 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
3726 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
3727 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
54f9ee45 RD |
3728 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3729 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3730 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3731 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3732 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3733 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3734 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
3735 | # |
3736 | # Create some event binders | |
3737 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3738 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3739 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3740 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3741 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3742 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3743 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3744 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3745 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3746 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3747 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3748 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3749 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 3750 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d14a1e28 RD |
3751 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
3752 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3753 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3754 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3755 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3756 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3757 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3758 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3759 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3760 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 3761 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
3762 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3763 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3764 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3765 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3766 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3767 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3768 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3769 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3770 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3771 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3772 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3773 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3774 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3775 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3776 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3777 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
34e0a3bb | 3778 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) |
d14a1e28 RD |
3779 | |
3780 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3781 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3782 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3783 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3784 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3785 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3786 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3787 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3788 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3789 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3790 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3791 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3792 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3793 | ||
3794 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3795 | wxEVT_LEFT_UP, | |
3796 | wxEVT_MIDDLE_DOWN, | |
3797 | wxEVT_MIDDLE_UP, | |
3798 | wxEVT_RIGHT_DOWN, | |
3799 | wxEVT_RIGHT_UP, | |
3800 | wxEVT_MOTION, | |
3801 | wxEVT_LEFT_DCLICK, | |
3802 | wxEVT_MIDDLE_DCLICK, | |
3803 | wxEVT_RIGHT_DCLICK, | |
3804 | wxEVT_ENTER_WINDOW, | |
3805 | wxEVT_LEAVE_WINDOW, | |
3806 | wxEVT_MOUSEWHEEL | |
3807 | ]) | |
3808 | ||
3809 | ||
3810 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 3811 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d14a1e28 RD |
3812 | wxEVT_SCROLLWIN_BOTTOM, |
3813 | wxEVT_SCROLLWIN_LINEUP, | |
3814 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 3815 | wxEVT_SCROLLWIN_PAGEUP, |
d14a1e28 RD |
3816 | wxEVT_SCROLLWIN_PAGEDOWN, |
3817 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3818 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3819 | ]) | |
3820 | ||
3821 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3822 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3823 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3824 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3825 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3826 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3827 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3828 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3829 | ||
27fb7603 | 3830 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
3831 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3832 | wxEVT_SCROLL_BOTTOM, | |
3833 | wxEVT_SCROLL_LINEUP, | |
3834 | wxEVT_SCROLL_LINEDOWN, | |
3835 | wxEVT_SCROLL_PAGEUP, | |
3836 | wxEVT_SCROLL_PAGEDOWN, | |
3837 | wxEVT_SCROLL_THUMBTRACK, | |
3838 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3839 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3840 | ]) |
3841 | ||
3842 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3843 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3844 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3845 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3846 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3847 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3848 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3849 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3850 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3851 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 3852 | |
27fb7603 | 3853 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
3854 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3855 | wxEVT_SCROLL_BOTTOM, | |
3856 | wxEVT_SCROLL_LINEUP, | |
3857 | wxEVT_SCROLL_LINEDOWN, | |
3858 | wxEVT_SCROLL_PAGEUP, | |
3859 | wxEVT_SCROLL_PAGEDOWN, | |
3860 | wxEVT_SCROLL_THUMBTRACK, | |
d14a1e28 | 3861 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 3862 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3863 | ], 1) |
3864 | ||
3865 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3866 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3867 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3868 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3869 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3870 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3871 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3872 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3873 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3874 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d14a1e28 | 3875 | |
d14a1e28 RD |
3876 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
3877 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3878 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3879 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3880 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3881 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3882 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3883 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3884 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3885 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3886 | ||
3887 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3888 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3889 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3890 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3891 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3892 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3893 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3894 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3895 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3896 | ||
3897 | ||
3898 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3899 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3900 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3901 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3902 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3903 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3904 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3905 | ||
3906 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3907 | ||
3908 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3909 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3910 | ||
3911 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3912 | ||
2131d850 RD |
3913 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
3914 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
3915 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d14a1e28 RD |
3916 | |
3917 | ||
3918 | #--------------------------------------------------------------------------- | |
3919 | ||
3920 | class Event(Object): | |
27fb7603 RD |
3921 | """ |
3922 | An event is a structure holding information about an event passed to a | |
3923 | callback or member function. wx.Event is an abstract base class for | |
3924 | other event classes | |
3925 | """ | |
0085ce49 RD |
3926 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3927 | def __init__(self): raise AttributeError, "No constructor defined" | |
3928 | __repr__ = _swig_repr | |
3929 | __swig_destroy__ = _core_.delete_Event | |
3930 | __del__ = lambda self : None; | |
e811c8ce | 3931 | def SetEventType(*args, **kwargs): |
27fb7603 | 3932 | """ |
2131d850 | 3933 | SetEventType(self, EventType typ) |
27fb7603 RD |
3934 | |
3935 | Sets the specific type of the event. | |
3936 | """ | |
54f9ee45 | 3937 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
3938 | |
3939 | def GetEventType(*args, **kwargs): | |
27fb7603 | 3940 | """ |
2131d850 | 3941 | GetEventType(self) -> EventType |
27fb7603 RD |
3942 | |
3943 | Returns the identifier of the given event type, such as | |
3944 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3945 | """ | |
54f9ee45 | 3946 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
3947 | |
3948 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3949 | """ |
3950 | GetEventObject(self) -> Object | |
3951 | ||
3952 | Returns the object (usually a window) associated with the event, if | |
3953 | any. | |
3954 | """ | |
54f9ee45 | 3955 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
3956 | |
3957 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3958 | """ |
3959 | SetEventObject(self, Object obj) | |
3960 | ||
3961 | Sets the originating object, or in other words, obj is normally the | |
3962 | object that is sending the event. | |
3963 | """ | |
54f9ee45 | 3964 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
3965 | |
3966 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 3967 | """GetTimestamp(self) -> long""" |
54f9ee45 | 3968 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
3969 | |
3970 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 3971 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 3972 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
3973 | |
3974 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3975 | """ |
3976 | GetId(self) -> int | |
3977 | ||
3978 | Returns the identifier associated with this event, such as a button | |
3979 | command id. | |
3980 | """ | |
54f9ee45 | 3981 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
3982 | |
3983 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3984 | """ |
3985 | SetId(self, int Id) | |
3986 | ||
3987 | Set's the ID for the event. This is usually the ID of the window that | |
3988 | is sending the event, but it can also be a command id from a menu | |
3989 | item, etc. | |
3990 | """ | |
54f9ee45 | 3991 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
3992 | |
3993 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3994 | """ |
3995 | IsCommandEvent(self) -> bool | |
3996 | ||
3997 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3998 | it returns false. Note: Exists only for optimization purposes. | |
3999 | """ | |
54f9ee45 | 4000 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
4001 | |
4002 | def Skip(*args, **kwargs): | |
51b83b37 RD |
4003 | """ |
4004 | Skip(self, bool skip=True) | |
4005 | ||
4006 | Called by an event handler, it controls whether additional event | |
4007 | handlers bound to this event will be called after the current event | |
4008 | handler returns. Skip(false) (the default setting) will prevent | |
4009 | additional event handlers from being called and control will be | |
4010 | returned to the sender of the event immediately after the current | |
4011 | handler has finished. Skip(True) will cause the event processing | |
4012 | system to continue searching for a handler function for this event. | |
4013 | ||
4014 | """ | |
54f9ee45 | 4015 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
4016 | |
4017 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
4018 | """ |
4019 | GetSkipped(self) -> bool | |
4020 | ||
4021 | Returns true if the event handler should be skipped, false otherwise. | |
4022 | :see: `Skip` | |
4023 | """ | |
54f9ee45 | 4024 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
4025 | |
4026 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
4027 | """ |
4028 | ShouldPropagate(self) -> bool | |
4029 | ||
4030 | Test if this event should be propagated to the parent window or not, | |
4031 | i.e. if the propagation level is currently greater than 0. | |
4032 | """ | |
54f9ee45 | 4033 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
4034 | |
4035 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
4036 | """ |
4037 | StopPropagation(self) -> int | |
4038 | ||
4039 | Stop the event from propagating to its parent window. Returns the old | |
4040 | propagation level value which may be later passed to | |
4041 | `ResumePropagation` to allow propagating the event again. | |
4042 | """ | |
54f9ee45 | 4043 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
4044 | |
4045 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
4046 | """ |
4047 | ResumePropagation(self, int propagationLevel) | |
4048 | ||
4049 | Resume the event propagation by restoring the propagation level. (For | |
4050 | example, you can use the value returned by an earlier call to | |
4051 | `StopPropagation`.) | |
4052 | ||
4053 | """ | |
54f9ee45 | 4054 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
4055 | |
4056 | def Clone(*args, **kwargs): | |
a95a7133 | 4057 | """Clone(self) -> Event""" |
54f9ee45 | 4058 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 4059 | |
97ab0f6a RD |
4060 | EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`") |
4061 | EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`") | |
4062 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
4063 | Skipped = property(GetSkipped,doc="See `GetSkipped`") | |
4064 | Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`") | |
2131d850 | 4065 | _core_.Event_swigregister(Event) |
d14a1e28 RD |
4066 | |
4067 | #--------------------------------------------------------------------------- | |
4068 | ||
4069 | class PropagationDisabler(object): | |
27fb7603 RD |
4070 | """ |
4071 | Helper class to temporarily change an event not to propagate. Simply | |
4072 | create an instance of this class and then whe it is destroyed the | |
4073 | propogation of the event will be restored. | |
4074 | """ | |
0085ce49 RD |
4075 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4076 | __repr__ = _swig_repr | |
4077 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4078 | """ |
4079 | __init__(self, Event event) -> PropagationDisabler | |
4080 | ||
4081 | Helper class to temporarily change an event not to propagate. Simply | |
4082 | create an instance of this class and then whe it is destroyed the | |
4083 | propogation of the event will be restored. | |
4084 | """ | |
0085ce49 RD |
4085 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
4086 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
4087 | __del__ = lambda self : None; | |
2131d850 | 4088 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d14a1e28 RD |
4089 | |
4090 | class PropagateOnce(object): | |
27fb7603 RD |
4091 | """ |
4092 | A helper class that will temporarily lower propagation level of an | |
4093 | event. Simply create an instance of this class and then whe it is | |
4094 | destroyed the propogation of the event will be restored. | |
4095 | """ | |
0085ce49 RD |
4096 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4097 | __repr__ = _swig_repr | |
4098 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4099 | """ |
4100 | __init__(self, Event event) -> PropagateOnce | |
4101 | ||
4102 | A helper class that will temporarily lower propagation level of an | |
4103 | event. Simply create an instance of this class and then whe it is | |
4104 | destroyed the propogation of the event will be restored. | |
4105 | """ | |
0085ce49 RD |
4106 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
4107 | __swig_destroy__ = _core_.delete_PropagateOnce | |
4108 | __del__ = lambda self : None; | |
2131d850 | 4109 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d14a1e28 RD |
4110 | |
4111 | #--------------------------------------------------------------------------- | |
4112 | ||
4113 | class CommandEvent(Event): | |
27fb7603 RD |
4114 | """ |
4115 | This event class contains information about command events, which | |
4116 | originate from a variety of simple controls, as well as menus and | |
4117 | toolbars. | |
4118 | """ | |
0085ce49 RD |
4119 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4120 | __repr__ = _swig_repr | |
4121 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4122 | """ |
2131d850 | 4123 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
4124 | |
4125 | This event class contains information about command events, which | |
4126 | originate from a variety of simple controls, as well as menus and | |
4127 | toolbars. | |
4128 | """ | |
0085ce49 | 4129 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
e811c8ce | 4130 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
4131 | """ |
4132 | GetSelection(self) -> int | |
4133 | ||
4134 | Returns item index for a listbox or choice selection event (not valid | |
4135 | for a deselection). | |
4136 | """ | |
54f9ee45 | 4137 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
4138 | |
4139 | def SetString(*args, **kwargs): | |
a95a7133 | 4140 | """SetString(self, String s)""" |
54f9ee45 | 4141 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
4142 | |
4143 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4144 | """ |
4145 | GetString(self) -> String | |
4146 | ||
4147 | Returns item string for a listbox or choice selection event (not valid | |
4148 | for a deselection). | |
4149 | """ | |
54f9ee45 | 4150 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
4151 | |
4152 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4153 | """ |
4154 | IsChecked(self) -> bool | |
4155 | ||
4156 | This method can be used with checkbox and menu events: for the | |
4157 | checkboxes, the method returns true for a selection event and false | |
4158 | for a deselection one. For the menu events, this method indicates if | |
4159 | the menu item just has become checked or unchecked (and thus only | |
4160 | makes sense for checkable menu items). | |
4161 | """ | |
54f9ee45 | 4162 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 4163 | |
242b7b46 | 4164 | Checked = IsChecked |
e811c8ce | 4165 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
4166 | """ |
4167 | IsSelection(self) -> bool | |
4168 | ||
4169 | For a listbox or similar event, returns true if it is a selection, | |
4170 | false if it is a deselection. | |
4171 | """ | |
54f9ee45 | 4172 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
4173 | |
4174 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 4175 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 4176 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
4177 | |
4178 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4179 | """ |
4180 | GetExtraLong(self) -> long | |
4181 | ||
5ba5649b RD |
4182 | Returns extra information dependant on the event objects type. If the |
4183 | event comes from a listbox selection, it is a boolean determining | |
4184 | whether the event was a selection (true) or a deselection (false). A | |
4185 | listbox deselection only occurs for multiple-selection boxes, and in | |
4186 | this case the index and string values are indeterminate and the | |
4187 | listbox must be examined by the application. | |
27fb7603 | 4188 | """ |
54f9ee45 | 4189 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
4190 | |
4191 | def SetInt(*args, **kwargs): | |
a95a7133 | 4192 | """SetInt(self, int i)""" |
54f9ee45 | 4193 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
4194 | |
4195 | def GetInt(*args, **kwargs): | |
27fb7603 | 4196 | """ |
01f6b6d3 | 4197 | GetInt(self) -> int |
27fb7603 | 4198 | |
5ba5649b RD |
4199 | Returns the integer identifier corresponding to a listbox, choice or |
4200 | radiobox selection (only if the event was a selection, not a | |
4201 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4202 | """ |
54f9ee45 | 4203 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce | 4204 | |
0085ce49 RD |
4205 | def GetClientData(*args, **kwargs): |
4206 | """ | |
4207 | GetClientData(self) -> PyObject | |
4208 | ||
4209 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4210 | """ | |
4211 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4212 | ||
4213 | def SetClientData(*args, **kwargs): | |
4214 | """ | |
4215 | SetClientData(self, PyObject clientData) | |
4216 | ||
4217 | Associate the given client data with the item at position n. | |
4218 | """ | |
4219 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4220 | ||
4221 | GetClientObject = GetClientData | |
4222 | SetClientObject = SetClientData | |
4223 | ||
e811c8ce | 4224 | def Clone(*args, **kwargs): |
a95a7133 | 4225 | """Clone(self) -> Event""" |
54f9ee45 | 4226 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4227 | |
2bf58437 RD |
4228 | ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`") |
4229 | ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`") | |
4230 | ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`") | |
4231 | Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`") | |
4232 | Selection = property(GetSelection,doc="See `GetSelection`") | |
4233 | String = property(GetString,SetString,doc="See `GetString` and `SetString`") | |
2131d850 | 4234 | _core_.CommandEvent_swigregister(CommandEvent) |
d14a1e28 RD |
4235 | |
4236 | #--------------------------------------------------------------------------- | |
4237 | ||
4238 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4239 | """ |
4240 | An instance of this class (or one of its derived classes) is sent from | |
4241 | a control when the control's state is being changed and the control | |
4242 | allows that change to be prevented from happening. The event handler | |
4243 | can call `Veto` or `Allow` to tell the control what to do. | |
4244 | """ | |
0085ce49 RD |
4245 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4246 | __repr__ = _swig_repr | |
4247 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4248 | """ |
2131d850 | 4249 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4250 | |
4251 | An instance of this class (or one of its derived classes) is sent from | |
4252 | a control when the control's state is being changed and the control | |
4253 | allows that change to be prevented from happening. The event handler | |
4254 | can call `Veto` or `Allow` to tell the control what to do. | |
4255 | """ | |
0085ce49 | 4256 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
e811c8ce | 4257 | def Veto(*args, **kwargs): |
27fb7603 RD |
4258 | """ |
4259 | Veto(self) | |
4260 | ||
4261 | Prevents the change announced by this event from happening. | |
4262 | ||
4263 | It is in general a good idea to notify the user about the reasons for | |
4264 | vetoing the change because otherwise the applications behaviour (which | |
4265 | just refuses to do what the user wants) might be quite surprising. | |
4266 | """ | |
54f9ee45 | 4267 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4268 | |
4269 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4270 | """ |
4271 | Allow(self) | |
4272 | ||
4273 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4274 | processed. For most events it is not necessary to call this method as | |
4275 | the events are allowed anyhow but some are forbidden by default (this | |
4276 | will be mentioned in the corresponding event description). | |
4277 | """ | |
54f9ee45 | 4278 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4279 | |
4280 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4281 | """ |
4282 | IsAllowed(self) -> bool | |
4283 | ||
4284 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4285 | false otherwise (if it was). | |
4286 | """ | |
54f9ee45 | 4287 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4288 | |
2131d850 | 4289 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d14a1e28 RD |
4290 | |
4291 | #--------------------------------------------------------------------------- | |
4292 | ||
4293 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4294 | """ |
4295 | A scroll event holds information about events sent from stand-alone | |
4296 | scrollbars and sliders. Note that scrolled windows do not send | |
4297 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4298 | instead. | |
4299 | """ | |
0085ce49 RD |
4300 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4301 | __repr__ = _swig_repr | |
4302 | def __init__(self, *args, **kwargs): | |
0df68c9f | 4303 | """ |
2131d850 | 4304 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4305 | int orient=0) -> ScrollEvent |
4306 | """ | |
0085ce49 | 4307 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
e811c8ce | 4308 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4309 | """ |
4310 | GetOrientation(self) -> int | |
4311 | ||
4312 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4313 | the scrollbar. | |
4314 | """ | |
54f9ee45 | 4315 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4316 | |
4317 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4318 | """ |
4319 | GetPosition(self) -> int | |
4320 | ||
4321 | Returns the position of the scrollbar. | |
4322 | """ | |
54f9ee45 | 4323 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4324 | |
4325 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4326 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4327 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4328 | |
4329 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4330 | """SetPosition(self, int pos)""" |
54f9ee45 | 4331 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4332 | |
33d6fd3b RD |
4333 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4334 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4335 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d14a1e28 RD |
4336 | |
4337 | #--------------------------------------------------------------------------- | |
4338 | ||
4339 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4340 | """ |
4341 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4342 | scrolling windows. | |
4343 | """ | |
0085ce49 RD |
4344 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4345 | __repr__ = _swig_repr | |
4346 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4347 | """ |
2131d850 | 4348 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4349 | |
4350 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4351 | scrolling windows. | |
4352 | """ | |
0085ce49 | 4353 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
e811c8ce | 4354 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4355 | """ |
4356 | GetOrientation(self) -> int | |
4357 | ||
4358 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4359 | the scrollbar. | |
4360 | """ | |
54f9ee45 | 4361 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4362 | |
4363 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4364 | """ |
4365 | GetPosition(self) -> int | |
4366 | ||
4367 | Returns the position of the scrollbar for the thumb track and release | |
4368 | events. Note that this field can't be used for the other events, you | |
4369 | need to query the window itself for the current position in that case. | |
4370 | """ | |
54f9ee45 | 4371 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4372 | |
4373 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4374 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4375 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4376 | |
4377 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4378 | """SetPosition(self, int pos)""" |
54f9ee45 | 4379 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4380 | |
33d6fd3b RD |
4381 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4382 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4383 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d14a1e28 RD |
4384 | |
4385 | #--------------------------------------------------------------------------- | |
4386 | ||
54f9ee45 RD |
4387 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4388 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4389 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4390 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4391 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4392 | class MouseEvent(Event): |
27fb7603 RD |
4393 | """ |
4394 | This event class contains information about the events generated by | |
4395 | the mouse: they include mouse buttons press and release events and | |
4396 | mouse move events. | |
4397 | ||
4398 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4399 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4400 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4401 | a middle button so a portable application should avoid relying on the | |
4402 | events from it. | |
4403 | ||
4404 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4405 | the former returns true when the event corresponds to the left mouse | |
4406 | button click while the latter returns true if the left mouse button is | |
4407 | currently being pressed. For example, when the user is dragging the | |
4408 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4409 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4410 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4411 | underlying GUI behaviour is (which is platform-dependent). The same | |
4412 | applies, of course, to other mouse buttons as well. | |
4413 | """ | |
0085ce49 RD |
4414 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4415 | __repr__ = _swig_repr | |
4416 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4417 | """ |
2131d850 | 4418 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4419 | |
4420 | Constructs a wx.MouseEvent. Valid event types are: | |
4421 | ||
4422 | * wxEVT_ENTER_WINDOW | |
4423 | * wxEVT_LEAVE_WINDOW | |
4424 | * wxEVT_LEFT_DOWN | |
4425 | * wxEVT_LEFT_UP | |
4426 | * wxEVT_LEFT_DCLICK | |
4427 | * wxEVT_MIDDLE_DOWN | |
4428 | * wxEVT_MIDDLE_UP | |
4429 | * wxEVT_MIDDLE_DCLICK | |
4430 | * wxEVT_RIGHT_DOWN | |
4431 | * wxEVT_RIGHT_UP | |
4432 | * wxEVT_RIGHT_DCLICK | |
4433 | * wxEVT_MOTION | |
4434 | * wxEVT_MOUSEWHEEL | |
4435 | """ | |
0085ce49 | 4436 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
e811c8ce | 4437 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4438 | """ |
4439 | IsButton(self) -> bool | |
4440 | ||
4441 | Returns true if the event was a mouse button event (not necessarily a | |
4442 | button down event - that may be tested using `ButtonDown`). | |
4443 | """ | |
54f9ee45 | 4444 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4445 | |
4446 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4447 | """ |
4448 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4449 | ||
5ba5649b RD |
4450 | If the argument is omitted, this returns true if the event was any |
4451 | mouse button down event. Otherwise the argument specifies which | |
4452 | button-down event shold be checked for (see `Button` for the possible | |
4453 | values). | |
27fb7603 | 4454 | """ |
54f9ee45 | 4455 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4456 | |
4457 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4458 | """ |
4459 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4460 | ||
4461 | If the argument is omitted, this returns true if the event was any | |
4462 | mouse double click event. Otherwise the argument specifies which | |
4463 | double click event to check for (see `Button` for the possible | |
4464 | values). | |
4465 | """ | |
54f9ee45 | 4466 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4467 | |
4468 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4469 | """ |
4470 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4471 | ||
4472 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4473 | mouse button up event. Otherwise the argument specifies which button |
4474 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4475 | """ |
54f9ee45 | 4476 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4477 | |
4478 | def Button(*args, **kwargs): | |
27fb7603 RD |
4479 | """ |
4480 | Button(self, int button) -> bool | |
4481 | ||
4482 | Returns true if the identified mouse button is changing state. Valid | |
4483 | values of button are: | |
4484 | ||
4485 | ==================== ===================================== | |
4486 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4487 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4488 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4489 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4490 | ==================== ===================================== | |
4491 | ||
4492 | """ | |
54f9ee45 | 4493 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4494 | |
4495 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4496 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4497 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4498 | |
4499 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4500 | """ |
4501 | GetButton(self) -> int | |
4502 | ||
4503 | Returns the mouse button which generated this event or | |
4504 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4505 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4506 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4507 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4508 | right buttons respectively. | |
4509 | """ | |
54f9ee45 | 4510 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4511 | |
4512 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4513 | """ |
4514 | ControlDown(self) -> bool | |
4515 | ||
4516 | Returns true if the control key was down at the time of the event. | |
4517 | """ | |
54f9ee45 | 4518 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4519 | |
4520 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4521 | """ |
4522 | MetaDown(self) -> bool | |
4523 | ||
4524 | Returns true if the Meta key was down at the time of the event. | |
4525 | """ | |
54f9ee45 | 4526 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4527 | |
4528 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4529 | """ |
4530 | AltDown(self) -> bool | |
4531 | ||
4532 | Returns true if the Alt key was down at the time of the event. | |
4533 | """ | |
54f9ee45 | 4534 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4535 | |
4536 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4537 | """ |
4538 | ShiftDown(self) -> bool | |
4539 | ||
4540 | Returns true if the Shift key was down at the time of the event. | |
4541 | """ | |
54f9ee45 | 4542 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4543 | |
412d302d RD |
4544 | def CmdDown(*args, **kwargs): |
4545 | """ | |
4546 | CmdDown(self) -> bool | |
4547 | ||
4548 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4549 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4550 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4551 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4552 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4553 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4554 | and Macs this is the same as `MetaDown`. | |
4555 | """ | |
4556 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4557 | ||
e811c8ce | 4558 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4559 | """ |
4560 | LeftDown(self) -> bool | |
4561 | ||
4562 | Returns true if the left mouse button state changed to down. | |
4563 | """ | |
54f9ee45 | 4564 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4565 | |
4566 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4567 | """ |
4568 | MiddleDown(self) -> bool | |
4569 | ||
4570 | Returns true if the middle mouse button state changed to down. | |
4571 | """ | |
54f9ee45 | 4572 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4573 | |
4574 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4575 | """ |
4576 | RightDown(self) -> bool | |
4577 | ||
4578 | Returns true if the right mouse button state changed to down. | |
4579 | """ | |
54f9ee45 | 4580 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4581 | |
4582 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4583 | """ |
4584 | LeftUp(self) -> bool | |
4585 | ||
4586 | Returns true if the left mouse button state changed to up. | |
4587 | """ | |
54f9ee45 | 4588 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4589 | |
4590 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4591 | """ |
4592 | MiddleUp(self) -> bool | |
4593 | ||
4594 | Returns true if the middle mouse button state changed to up. | |
4595 | """ | |
54f9ee45 | 4596 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4597 | |
4598 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4599 | """ |
4600 | RightUp(self) -> bool | |
4601 | ||
4602 | Returns true if the right mouse button state changed to up. | |
4603 | """ | |
54f9ee45 | 4604 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4605 | |
4606 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4607 | """ |
4608 | LeftDClick(self) -> bool | |
4609 | ||
4610 | Returns true if the event was a left button double click. | |
4611 | """ | |
54f9ee45 | 4612 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4613 | |
4614 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4615 | """ |
4616 | MiddleDClick(self) -> bool | |
4617 | ||
4618 | Returns true if the event was a middle button double click. | |
4619 | """ | |
54f9ee45 | 4620 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4621 | |
4622 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4623 | """ |
4624 | RightDClick(self) -> bool | |
4625 | ||
4626 | Returns true if the event was a right button double click. | |
4627 | """ | |
54f9ee45 | 4628 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4629 | |
4630 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4631 | """ |
4632 | LeftIsDown(self) -> bool | |
4633 | ||
4634 | Returns true if the left mouse button is currently down, independent | |
4635 | of the current event type. | |
4636 | ||
4637 | Please notice that it is not the same as LeftDown which returns true | |
4638 | if the left mouse button was just pressed. Rather, it describes the | |
4639 | state of the mouse button before the event happened. | |
4640 | ||
4641 | This event is usually used in the mouse event handlers which process | |
4642 | "move mouse" messages to determine whether the user is (still) | |
4643 | dragging the mouse. | |
4644 | """ | |
54f9ee45 | 4645 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4646 | |
4647 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4648 | """ |
4649 | MiddleIsDown(self) -> bool | |
4650 | ||
4651 | Returns true if the middle mouse button is currently down, independent | |
4652 | of the current event type. | |
4653 | """ | |
54f9ee45 | 4654 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
4655 | |
4656 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4657 | """ |
4658 | RightIsDown(self) -> bool | |
4659 | ||
4660 | Returns true if the right mouse button is currently down, independent | |
4661 | of the current event type. | |
4662 | """ | |
54f9ee45 | 4663 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
4664 | |
4665 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4666 | """ |
4667 | Dragging(self) -> bool | |
4668 | ||
4669 | Returns true if this was a dragging event (motion while a button is | |
4670 | depressed). | |
4671 | """ | |
54f9ee45 | 4672 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
4673 | |
4674 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4675 | """ |
4676 | Moving(self) -> bool | |
4677 | ||
4678 | Returns true if this was a motion event and no mouse buttons were | |
4679 | pressed. If any mouse button is held pressed, then this method returns | |
4680 | false and Dragging returns true. | |
4681 | """ | |
54f9ee45 | 4682 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
4683 | |
4684 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4685 | """ |
4686 | Entering(self) -> bool | |
4687 | ||
4688 | Returns true if the mouse was entering the window. | |
4689 | """ | |
54f9ee45 | 4690 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
4691 | |
4692 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4693 | """ |
4694 | Leaving(self) -> bool | |
4695 | ||
4696 | Returns true if the mouse was leaving the window. | |
4697 | """ | |
54f9ee45 | 4698 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
4699 | |
4700 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4701 | """ |
a95a7133 | 4702 | GetPosition(self) -> Point |
e811c8ce | 4703 | |
27fb7603 RD |
4704 | Returns the pixel position of the mouse in window coordinates when the |
4705 | event happened. | |
0df68c9f | 4706 | """ |
54f9ee45 | 4707 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4708 | |
4709 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4710 | """ |
4711 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4712 | |
27fb7603 RD |
4713 | Returns the pixel position of the mouse in window coordinates when the |
4714 | event happened. | |
0df68c9f | 4715 | """ |
54f9ee45 | 4716 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4717 | |
4718 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4719 | """ |
4720 | GetLogicalPosition(self, DC dc) -> Point | |
4721 | ||
4722 | Returns the logical mouse position in pixels (i.e. translated | |
4723 | according to the translation set for the DC, which usually indicates | |
4724 | that the window has been scrolled). | |
4725 | """ | |
54f9ee45 | 4726 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
4727 | |
4728 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4729 | """ |
4730 | GetX(self) -> int | |
4731 | ||
4732 | Returns X coordinate of the physical mouse event position. | |
4733 | """ | |
54f9ee45 | 4734 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4735 | |
4736 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4737 | """ |
4738 | GetY(self) -> int | |
4739 | ||
4740 | Returns Y coordinate of the physical mouse event position. | |
4741 | """ | |
54f9ee45 | 4742 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4743 | |
4744 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4745 | """ |
4746 | GetWheelRotation(self) -> int | |
4747 | ||
4748 | Get wheel rotation, positive or negative indicates direction of | |
4749 | rotation. Current devices all send an event when rotation is equal to | |
4750 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4751 | created in the future. Because of this you shouldn't assume that one | |
4752 | event is equal to 1 line or whatever, but you should be able to either | |
4753 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4754 | have been accumulated before scrolling. | |
4755 | """ | |
54f9ee45 | 4756 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
4757 | |
4758 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4759 | """ |
4760 | GetWheelDelta(self) -> int | |
4761 | ||
4762 | Get wheel delta, normally 120. This is the threshold for action to be | |
4763 | taken, and one such action (for example, scrolling one increment) | |
4764 | should occur for each delta. | |
4765 | """ | |
54f9ee45 | 4766 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce RD |
4767 | |
4768 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4769 | """ |
4770 | GetLinesPerAction(self) -> int | |
4771 | ||
4772 | Returns the configured number of lines (or whatever) to be scrolled | |
4773 | per wheel action. Defaults to three. | |
4774 | """ | |
54f9ee45 | 4775 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
4776 | |
4777 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4778 | """ |
4779 | IsPageScroll(self) -> bool | |
4780 | ||
4781 | Returns true if the system has been setup to do page scrolling with | |
4782 | the mouse wheel instead of line scrolling. | |
4783 | """ | |
54f9ee45 RD |
4784 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4785 | ||
4786 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4787 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4788 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4789 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4790 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4791 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4792 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4793 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4794 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4795 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4796 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4797 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
57332a5a RD |
4798 | Button = property(GetButton,doc="See `GetButton`") |
4799 | LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`") | |
4800 | LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`") | |
4801 | Position = property(GetPosition,doc="See `GetPosition`") | |
4802 | WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`") | |
4803 | WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`") | |
4804 | X = property(GetX,doc="See `GetX`") | |
4805 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 4806 | _core_.MouseEvent_swigregister(MouseEvent) |
d14a1e28 RD |
4807 | |
4808 | #--------------------------------------------------------------------------- | |
4809 | ||
4810 | class SetCursorEvent(Event): | |
5ba5649b RD |
4811 | """ |
4812 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4813 | as a result of mouse motion. This event gives the application the | |
4814 | chance to perform specific mouse cursor processing based on the | |
4815 | current position of the mouse within the window. Use the `SetCursor` | |
4816 | method to specify the cursor you want to be displayed. | |
4817 | """ | |
0085ce49 RD |
4818 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4819 | __repr__ = _swig_repr | |
4820 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4821 | """ |
4822 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4823 | ||
4824 | Construct a new `wx.SetCursorEvent`. | |
4825 | """ | |
0085ce49 | 4826 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
e811c8ce | 4827 | def GetX(*args, **kwargs): |
5ba5649b RD |
4828 | """ |
4829 | GetX(self) -> int | |
4830 | ||
4831 | Returns the X coordinate of the mouse in client coordinates. | |
4832 | """ | |
54f9ee45 | 4833 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4834 | |
4835 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4836 | """ |
4837 | GetY(self) -> int | |
4838 | ||
4839 | Returns the Y coordinate of the mouse in client coordinates. | |
4840 | """ | |
54f9ee45 | 4841 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4842 | |
4843 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4844 | """ |
4845 | SetCursor(self, Cursor cursor) | |
4846 | ||
4847 | Sets the cursor associated with this event. | |
4848 | """ | |
54f9ee45 | 4849 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
4850 | |
4851 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4852 | """ |
4853 | GetCursor(self) -> Cursor | |
4854 | ||
4855 | Returns a reference to the cursor specified by this event. | |
4856 | """ | |
54f9ee45 | 4857 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
4858 | |
4859 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4860 | """ |
4861 | HasCursor(self) -> bool | |
4862 | ||
4863 | Returns true if the cursor specified by this event is a valid cursor. | |
4864 | """ | |
54f9ee45 | 4865 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 4866 | |
33d6fd3b RD |
4867 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") |
4868 | X = property(GetX,doc="See `GetX`") | |
4869 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 4870 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d14a1e28 RD |
4871 | |
4872 | #--------------------------------------------------------------------------- | |
4873 | ||
4874 | class KeyEvent(Event): | |
5ba5649b RD |
4875 | """ |
4876 | This event class contains information about keypress and character | |
4877 | events. These events are only sent to the widget that currently has | |
4878 | the keyboard focus. | |
4879 | ||
4880 | Notice that there are three different kinds of keyboard events in | |
4881 | wxWidgets: key down and up events and char events. The difference | |
4882 | between the first two is clear - the first corresponds to a key press | |
4883 | and the second to a key release - otherwise they are identical. Just | |
4884 | note that if the key is maintained in a pressed state you will | |
4885 | typically get a lot of (automatically generated) down events but only | |
4886 | one up so it is wrong to assume that there is one up event | |
4887 | corresponding to each down one. | |
4888 | ||
4889 | Both key events provide untranslated key codes while the char event | |
4890 | carries the translated one. The untranslated code for alphanumeric | |
4891 | keys is always an upper case value. For the other keys it is one of | |
4892 | WXK_XXX values from the keycodes table. The translated key is, in | |
4893 | general, the character the user expects to appear as the result of the | |
4894 | key combination when typing the text into a text entry zone, for | |
4895 | example. | |
4896 | ||
4897 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4898 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4899 | down event key code is equal to ASCII A == 65. But the char event key | |
4900 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4901 | 'A' keys simultaneously , the key code in key down event will still be | |
4902 | just 'A' while the char event key code parameter will now be 'A' as | |
4903 | well. | |
4904 | ||
4905 | Although in this simple case it is clear that the correct key code | |
4906 | could be found in the key down event handler by checking the value | |
4907 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4908 | as for non alphanumeric keys or non-US keyboard layouts the | |
4909 | translation is keyboard-layout dependent and can only be done properly | |
4910 | by the system itself. | |
4911 | ||
4912 | Another kind of translation is done when the control key is pressed: | |
4913 | for example, for CTRL-A key press the key down event still carries the | |
4914 | same key code 'A' as usual but the char event will have key code of 1, | |
4915 | the ASCII value of this key combination. | |
4916 | ||
4917 | You may discover how the other keys on your system behave | |
4918 | interactively by running the KeyEvents sample in the wxPython demo and | |
4919 | pressing some keys while the blue box at the top has the keyboard | |
4920 | focus. | |
4921 | ||
4922 | **Note**: If a key down event is caught and the event handler does not | |
4923 | call event.Skip() then the coresponding char event will not | |
4924 | happen. This is by design and enables the programs that handle both | |
4925 | types of events to be a bit simpler. | |
4926 | ||
4927 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4928 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4929 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4930 | event in wxWidgets (unless it is used as an accelerator). | |
4931 | ||
4932 | **Tip**: be sure to call event.Skip() for events that you don't | |
4933 | process in key event function, otherwise menu shortcuts may cease to | |
4934 | work under Windows. | |
4935 | ||
4936 | """ | |
0085ce49 RD |
4937 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4938 | __repr__ = _swig_repr | |
4939 | def __init__(self, *args, **kwargs): | |
5ba5649b | 4940 | """ |
2131d850 | 4941 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
4942 | |
4943 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4944 | * | |
4945 | """ | |
0085ce49 | 4946 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
4947 | def GetModifiers(*args, **kwargs): |
4948 | """ | |
4949 | GetModifiers(self) -> int | |
4950 | ||
4951 | Returns a bitmask of the current modifier settings. Can be used to | |
4952 | check if the key event has exactly the given modifiers without having | |
4953 | to explicitly check that the other modifiers are not down. For | |
4954 | example:: | |
4955 | ||
4956 | if event.GetModifers() == wx.MOD_CONTROL: | |
4957 | DoSomething() | |
4958 | ||
4959 | """ | |
4960 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
4961 | ||
e811c8ce | 4962 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4963 | """ |
4964 | ControlDown(self) -> bool | |
4965 | ||
4966 | Returns ``True`` if the Control key was down at the time of the event. | |
4967 | """ | |
54f9ee45 | 4968 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4969 | |
4970 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4971 | """ |
4972 | MetaDown(self) -> bool | |
4973 | ||
4974 | Returns ``True`` if the Meta key was down at the time of the event. | |
4975 | """ | |
54f9ee45 | 4976 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4977 | |
4978 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4979 | """ |
4980 | AltDown(self) -> bool | |
4981 | ||
4982 | Returns ``True`` if the Alt key was down at the time of the event. | |
4983 | """ | |
54f9ee45 | 4984 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4985 | |
4986 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4987 | """ |
4988 | ShiftDown(self) -> bool | |
4989 | ||
4990 | Returns ``True`` if the Shift key was down at the time of the event. | |
4991 | """ | |
54f9ee45 | 4992 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4993 | |
412d302d RD |
4994 | def CmdDown(*args, **kwargs): |
4995 | """ | |
4996 | CmdDown(self) -> bool | |
4997 | ||
4998 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4999 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 5000 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
5001 | because Cmd key is used for the same thing under Mac as Ctrl |
5002 | elsewhere. The Ctrl still exists, it's just not used for this | |
5003 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
5004 | and Macs this is the same as `MetaDown`. | |
5005 | """ | |
5006 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
5007 | ||
e811c8ce | 5008 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
5009 | """ |
5010 | HasModifiers(self) -> bool | |
5011 | ||
5012 | Returns true if either CTRL or ALT keys was down at the time of the | |
5013 | key event. Note that this function does not take into account neither | |
5014 | SHIFT nor META key states (the reason for ignoring the latter is that | |
5015 | it is common for NUMLOCK key to be configured as META under X but the | |
5016 | key presses even while NUMLOCK is on should be still processed | |
5017 | normally). | |
5018 | """ | |
54f9ee45 | 5019 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
5020 | |
5021 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
5022 | """ |
5023 | GetKeyCode(self) -> int | |
5024 | ||
5025 | Returns the virtual key code. ASCII events return normal ASCII values, | |
5026 | while non-ASCII events return values such as WXK_LEFT for the left | |
5027 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
5028 | codes. | |
5029 | ||
5030 | Note that in Unicode build, the returned value is meaningful only if | |
5031 | the user entered a character that can be represented in current | |
5032 | locale's default charset. You can obtain the corresponding Unicode | |
5033 | character using `GetUnicodeKey`. | |
5034 | """ | |
54f9ee45 | 5035 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 5036 | |
19272049 | 5037 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
5038 | """ |
5039 | GetUnicodeKey(self) -> int | |
5040 | ||
5041 | Returns the Unicode character corresponding to this key event. This | |
5042 | function is only meaningfule in a Unicode build of wxPython. | |
5043 | """ | |
19272049 | 5044 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 5045 | |
19272049 | 5046 | GetUniChar = GetUnicodeKey |
b850e7f3 RD |
5047 | def SetUnicodeKey(*args, **kwargs): |
5048 | """ | |
5049 | SetUnicodeKey(self, int uniChar) | |
5050 | ||
5051 | Set the Unicode value of the key event, but only if this is a Unicode | |
5052 | build of wxPython. | |
5053 | """ | |
5054 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
5055 | ||
e811c8ce | 5056 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
5057 | """ |
5058 | GetRawKeyCode(self) -> unsigned int | |
5059 | ||
5060 | Returns the raw key code for this event. This is a platform-dependent | |
5061 | scan code which should only be used in advanced | |
5062 | applications. Currently the raw key codes are not supported by all | |
5063 | ports. | |
5064 | """ | |
54f9ee45 | 5065 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
5066 | |
5067 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
5068 | """ |
5069 | GetRawKeyFlags(self) -> unsigned int | |
5070 | ||
5071 | Returns the low level key flags for this event. The flags are | |
5072 | platform-dependent and should only be used in advanced applications. | |
5073 | Currently the raw key flags are not supported by all ports. | |
5074 | """ | |
54f9ee45 | 5075 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
5076 | |
5077 | def GetPosition(*args, **kwargs): | |
0df68c9f | 5078 | """ |
a95a7133 | 5079 | GetPosition(self) -> Point |
e811c8ce | 5080 | |
5ba5649b | 5081 | Find the position of the event, if applicable. |
0df68c9f | 5082 | """ |
54f9ee45 | 5083 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5084 | |
5085 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
5086 | """ |
5087 | GetPositionTuple() -> (x,y) | |
e811c8ce | 5088 | |
5ba5649b | 5089 | Find the position of the event, if applicable. |
0df68c9f | 5090 | """ |
54f9ee45 | 5091 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
5092 | |
5093 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5094 | """ |
5095 | GetX(self) -> int | |
5096 | ||
5097 | Returns the X position (in client coordinates) of the event, if | |
5098 | applicable. | |
5099 | """ | |
54f9ee45 | 5100 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5101 | |
5102 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5103 | """ |
5104 | GetY(self) -> int | |
5105 | ||
5106 | Returns the Y position (in client coordinates) of the event, if | |
5107 | applicable. | |
5108 | """ | |
54f9ee45 RD |
5109 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5110 | ||
5111 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5112 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5113 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5114 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5115 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5116 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5117 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5118 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5119 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5120 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
97ab0f6a RD |
5121 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") |
5122 | Modifiers = property(GetModifiers,doc="See `GetModifiers`") | |
5123 | Position = property(GetPosition,doc="See `GetPosition`") | |
5124 | RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`") | |
5125 | RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`") | |
5126 | UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`") | |
5127 | X = property(GetX,doc="See `GetX`") | |
5128 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 5129 | _core_.KeyEvent_swigregister(KeyEvent) |
d14a1e28 RD |
5130 | |
5131 | #--------------------------------------------------------------------------- | |
5132 | ||
5133 | class SizeEvent(Event): | |
5ba5649b RD |
5134 | """ |
5135 | A size event holds information about size change events. The EVT_SIZE | |
5136 | handler function will be called when the window it is bound to has | |
5137 | been resized. | |
5138 | ||
5139 | Note that the size passed is of the whole window: call | |
5140 | `wx.Window.GetClientSize` for the area which may be used by the | |
5141 | application. | |
5142 | ||
5143 | When a window is resized, usually only a small part of the window is | |
5144 | damaged and and that area is all that is in the update region for the | |
5145 | next paint event. However, if your drawing depends on the size of the | |
5146 | window, you may need to clear the DC explicitly and repaint the whole | |
5147 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5148 | invalidate the entire window. | |
5149 | ||
5150 | """ | |
0085ce49 RD |
5151 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5152 | __repr__ = _swig_repr | |
5153 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5154 | """ |
5155 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5156 | ||
5157 | Construct a new ``wx.SizeEvent``. | |
5158 | """ | |
0085ce49 | 5159 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
e811c8ce | 5160 | def GetSize(*args, **kwargs): |
5ba5649b RD |
5161 | """ |
5162 | GetSize(self) -> Size | |
5163 | ||
5164 | Returns the entire size of the window generating the size change | |
5165 | event. | |
5166 | """ | |
54f9ee45 | 5167 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
5168 | |
5169 | def GetRect(*args, **kwargs): | |
a95a7133 | 5170 | """GetRect(self) -> Rect""" |
54f9ee45 | 5171 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5172 | |
5173 | def SetRect(*args, **kwargs): | |
a95a7133 | 5174 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5175 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5176 | |
5177 | def SetSize(*args, **kwargs): | |
a95a7133 | 5178 | """SetSize(self, Size size)""" |
54f9ee45 | 5179 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 5180 | |
54f9ee45 RD |
5181 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5182 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
33d6fd3b RD |
5183 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") |
5184 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
2131d850 | 5185 | _core_.SizeEvent_swigregister(SizeEvent) |
d14a1e28 RD |
5186 | |
5187 | #--------------------------------------------------------------------------- | |
5188 | ||
5189 | class MoveEvent(Event): | |
5ba5649b RD |
5190 | """ |
5191 | This event object is sent for EVT_MOVE event bindings when a window is | |
5192 | moved to a new position. | |
5193 | """ | |
0085ce49 RD |
5194 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5195 | __repr__ = _swig_repr | |
5196 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5197 | """ |
5198 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5199 | ||
5200 | Constructor. | |
5201 | """ | |
0085ce49 | 5202 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
e811c8ce | 5203 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5204 | """ |
5205 | GetPosition(self) -> Point | |
5206 | ||
5207 | Returns the position of the window generating the move change event. | |
5208 | """ | |
54f9ee45 | 5209 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5210 | |
5211 | def GetRect(*args, **kwargs): | |
a95a7133 | 5212 | """GetRect(self) -> Rect""" |
54f9ee45 | 5213 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5214 | |
5215 | def SetRect(*args, **kwargs): | |
a95a7133 | 5216 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5217 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5218 | |
5219 | def SetPosition(*args, **kwargs): | |
a95a7133 | 5220 | """SetPosition(self, Point pos)""" |
54f9ee45 | 5221 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 5222 | |
7557b9b5 RD |
5223 | m_pos = property(GetPosition, SetPosition) |
5224 | m_rect = property(GetRect, SetRect) | |
5225 | ||
57332a5a RD |
5226 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
5227 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
2131d850 | 5228 | _core_.MoveEvent_swigregister(MoveEvent) |
d14a1e28 RD |
5229 | |
5230 | #--------------------------------------------------------------------------- | |
5231 | ||
5232 | class PaintEvent(Event): | |
5ba5649b RD |
5233 | """ |
5234 | A paint event is sent when a window's contents needs to be repainted. | |
5235 | Note that in an EVT_PAINT handler the application must *always* create | |
5236 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5237 | Windows assumes that the window has not been painted yet and will send | |
5238 | the event again, causing endless refreshes. | |
5239 | ||
5240 | You can optimize painting by retrieving the rectangles that have been | |
5241 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5242 | and only repainting these rectangles. The rectangles are in terms of | |
5243 | the client area, and are unscrolled, so you will need to do some | |
5244 | calculations using the current view position to obtain logical, | |
5245 | scrolled units. | |
5246 | ||
5247 | """ | |
0085ce49 RD |
5248 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5249 | __repr__ = _swig_repr | |
5250 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5251 | """__init__(self, int Id=0) -> PaintEvent""" |
0085ce49 | 5252 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5253 | _core_.PaintEvent_swigregister(PaintEvent) |
d14a1e28 RD |
5254 | |
5255 | class NcPaintEvent(Event): | |
093d3ff1 | 5256 | """Proxy of C++ NcPaintEvent class""" |
0085ce49 RD |
5257 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5258 | __repr__ = _swig_repr | |
5259 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5260 | """__init__(self, int winid=0) -> NcPaintEvent""" |
0085ce49 | 5261 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5262 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d14a1e28 RD |
5263 | |
5264 | #--------------------------------------------------------------------------- | |
5265 | ||
5266 | class EraseEvent(Event): | |
5ba5649b RD |
5267 | """ |
5268 | An erase event is sent whenever the background of a window needs to be | |
5269 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5270 | binder. On some platforms, such as GTK+, this event is simulated | |
5271 | (simply generated just before the paint event) and may cause flicker. | |
5272 | ||
5273 | To paint a custom background use the `GetDC` method and use the returned | |
5274 | device context if it is not ``None``, otherwise create a temporary | |
5275 | `wx.ClientDC` and draw on that. | |
5276 | ||
5277 | """ | |
0085ce49 RD |
5278 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5279 | __repr__ = _swig_repr | |
5280 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5281 | """ |
5282 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5283 | ||
5284 | Constructor | |
5285 | """ | |
0085ce49 | 5286 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
e811c8ce | 5287 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5288 | """ |
5289 | GetDC(self) -> DC | |
5290 | ||
5291 | Returns the device context the event handler should draw upon. If | |
5292 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5293 | that instead. | |
5294 | """ | |
54f9ee45 | 5295 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5296 | |
97ab0f6a | 5297 | DC = property(GetDC,doc="See `GetDC`") |
2131d850 | 5298 | _core_.EraseEvent_swigregister(EraseEvent) |
d14a1e28 RD |
5299 | |
5300 | #--------------------------------------------------------------------------- | |
5301 | ||
5302 | class FocusEvent(Event): | |
5ba5649b RD |
5303 | """ |
5304 | A focus event is sent when a window's focus changes. The window losing | |
5305 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5306 | gets an EVT_SET_FOCUS event. | |
5307 | ||
5308 | Notice that the set focus event happens both when the user gives focus | |
5309 | to the window (whether using the mouse or keyboard) and when it is | |
5310 | done from the program itself using `wx.Window.SetFocus`. | |
5311 | ||
5312 | """ | |
0085ce49 RD |
5313 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5314 | __repr__ = _swig_repr | |
5315 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5316 | """ |
2131d850 | 5317 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5318 | |
5319 | Constructor | |
5320 | """ | |
0085ce49 | 5321 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
e811c8ce | 5322 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5323 | """ |
5324 | GetWindow(self) -> Window | |
5325 | ||
5326 | Returns the other window associated with this event, that is the | |
5327 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5328 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5329 | ||
5330 | Warning: the window returned may be None! | |
5331 | """ | |
54f9ee45 | 5332 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5333 | |
5334 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5335 | """SetWindow(self, Window win)""" |
54f9ee45 | 5336 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5337 | |
97ab0f6a | 5338 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") |
2131d850 | 5339 | _core_.FocusEvent_swigregister(FocusEvent) |
d14a1e28 RD |
5340 | |
5341 | #--------------------------------------------------------------------------- | |
5342 | ||
5343 | class ChildFocusEvent(CommandEvent): | |
5ba5649b | 5344 | """ |
33d6fd3b RD |
5345 | A child focus event is sent to a (parent-)window when one of its child |
5346 | windows gains focus, so that the window could restore the focus back | |
5347 | to its corresponding child if it loses it now and regains later. | |
5348 | ||
5349 | Notice that child window is the direct child of the window receiving | |
5350 | the event, and so may not be the actual widget recieving focus if it | |
5351 | is further down the containment heirarchy. Use `wx.Window.FindFocus` | |
5352 | to get the widget that is actually receiving focus. | |
5ba5649b | 5353 | """ |
0085ce49 RD |
5354 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5355 | __repr__ = _swig_repr | |
5356 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5357 | """ |
5358 | __init__(self, Window win=None) -> ChildFocusEvent | |
5359 | ||
5360 | Constructor | |
5361 | """ | |
0085ce49 | 5362 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
e811c8ce | 5363 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5364 | """ |
5365 | GetWindow(self) -> Window | |
5366 | ||
33d6fd3b RD |
5367 | The window, or (grand)parent of the window which has just received the |
5368 | focus. | |
5ba5649b | 5369 | """ |
54f9ee45 | 5370 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5371 | |
2bf58437 | 5372 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 5373 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d14a1e28 RD |
5374 | |
5375 | #--------------------------------------------------------------------------- | |
5376 | ||
5377 | class ActivateEvent(Event): | |
5ba5649b RD |
5378 | """ |
5379 | An activate event is sent when a top-level window or the entire | |
5380 | application is being activated or deactivated. | |
5381 | ||
5382 | A top-level window (a dialog or frame) receives an activate event when | |
5383 | is being activated or deactivated. This is indicated visually by the | |
5384 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5385 | An application is activated or deactivated when one of its frames | |
5386 | becomes activated, or a frame becomes inactivate resulting in all | |
5387 | application frames being inactive. | |
5388 | ||
5389 | Please note that usually you should call event.Skip() in your handlers | |
5390 | for these events so the default handlers will still be called, as not | |
5391 | doing so can result in strange effects. | |
5392 | ||
5393 | """ | |
0085ce49 RD |
5394 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5395 | __repr__ = _swig_repr | |
5396 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5397 | """ |
2131d850 | 5398 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5399 | |
5400 | Constructor | |
5401 | """ | |
0085ce49 | 5402 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
e811c8ce | 5403 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5404 | """ |
5405 | GetActive(self) -> bool | |
5406 | ||
5407 | Returns true if the application or window is being activated, false | |
5408 | otherwise. | |
5409 | """ | |
54f9ee45 | 5410 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5411 | |
2bf58437 | 5412 | Active = property(GetActive,doc="See `GetActive`") |
2131d850 | 5413 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d14a1e28 RD |
5414 | |
5415 | #--------------------------------------------------------------------------- | |
5416 | ||
5417 | class InitDialogEvent(Event): | |
5ba5649b RD |
5418 | """ |
5419 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5420 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5421 | event can transfer data to the window, or anything else that should be | |
5422 | done before the user begins editing the form. The default handler | |
5423 | calls `wx.Window.TransferDataToWindow`. | |
5424 | """ | |
0085ce49 RD |
5425 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5426 | __repr__ = _swig_repr | |
5427 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5428 | """ |
5429 | __init__(self, int Id=0) -> InitDialogEvent | |
5430 | ||
5431 | Constructor | |
5432 | """ | |
0085ce49 | 5433 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5434 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d14a1e28 RD |
5435 | |
5436 | #--------------------------------------------------------------------------- | |
5437 | ||
5438 | class MenuEvent(Event): | |
5ba5649b RD |
5439 | """ |
5440 | This class is used for a variety of menu-related events. Note that | |
5441 | these do not include menu command events, which are handled by sending | |
5442 | `wx.CommandEvent` objects. | |
5443 | ||
5444 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5445 | text in the first field of the status bar. | |
5446 | """ | |
0085ce49 RD |
5447 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5448 | __repr__ = _swig_repr | |
5449 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5450 | """ |
2131d850 | 5451 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5452 | |
5453 | Constructor | |
5454 | """ | |
0085ce49 | 5455 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
e811c8ce | 5456 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5457 | """ |
5458 | GetMenuId(self) -> int | |
5459 | ||
5460 | Returns the menu identifier associated with the event. This method | |
5461 | should be only used with the HIGHLIGHT events. | |
5462 | """ | |
54f9ee45 | 5463 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5464 | |
5465 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5466 | """ |
5467 | IsPopup(self) -> bool | |
5468 | ||
5469 | Returns ``True`` if the menu which is being opened or closed is a | |
5470 | popup menu, ``False`` if it is a normal one. This method should only | |
5471 | be used with the OPEN and CLOSE events. | |
5472 | """ | |
54f9ee45 | 5473 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5474 | |
5475 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5476 | """ |
5477 | GetMenu(self) -> Menu | |
5478 | ||
5479 | Returns the menu which is being opened or closed. This method should | |
5480 | only be used with the OPEN and CLOSE events. | |
5481 | """ | |
54f9ee45 | 5482 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5483 | |
57332a5a RD |
5484 | Menu = property(GetMenu,doc="See `GetMenu`") |
5485 | MenuId = property(GetMenuId,doc="See `GetMenuId`") | |
2131d850 | 5486 | _core_.MenuEvent_swigregister(MenuEvent) |
d14a1e28 RD |
5487 | |
5488 | #--------------------------------------------------------------------------- | |
5489 | ||
5490 | class CloseEvent(Event): | |
5ba5649b RD |
5491 | """ |
5492 | This event class contains information about window and session close | |
5493 | events. | |
5494 | ||
5495 | The handler function for EVT_CLOSE is called when the user has tried | |
5496 | to close a a frame or dialog box using the window manager controls or | |
5497 | the system menu. It can also be invoked by the application itself | |
5498 | programmatically, for example by calling the `wx.Window.Close` | |
5499 | function. | |
5500 | ||
5501 | You should check whether the application is forcing the deletion of | |
5502 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5503 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5504 | it is up to you whether you respond by destroying the window or not. | |
5505 | For example you may wish to display a message dialog prompting to save | |
5506 | files or to cancel the close. | |
5507 | ||
5508 | If you don't destroy the window, you should call `Veto` to let the | |
5509 | calling code know that you did not destroy the window. This allows the | |
5510 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5511 | on whether the close instruction was honored or not. | |
5512 | """ | |
0085ce49 RD |
5513 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5514 | __repr__ = _swig_repr | |
5515 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5516 | """ |
2131d850 | 5517 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5518 | |
5519 | Constructor. | |
5520 | """ | |
0085ce49 | 5521 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
e811c8ce | 5522 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5523 | """ |
5524 | SetLoggingOff(self, bool logOff) | |
5525 | ||
5526 | Sets the 'logging off' flag. | |
5527 | """ | |
54f9ee45 | 5528 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5529 | |
5530 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5531 | """ |
5532 | GetLoggingOff(self) -> bool | |
5533 | ||
6c75a4cf RD |
5534 | Returns ``True`` if the user is logging off or ``False`` if the |
5535 | system is shutting down. This method can only be called for end | |
5536 | session and query end session events, it doesn't make sense for close | |
5537 | window event. | |
5ba5649b | 5538 | """ |
54f9ee45 | 5539 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5540 | |
5541 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5542 | """ |
5543 | Veto(self, bool veto=True) | |
5544 | ||
5545 | Call this from your event handler to veto a system shutdown or to | |
5546 | signal to the calling application that a window close did not happen. | |
5547 | ||
5548 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5549 | """ | |
54f9ee45 | 5550 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5551 | |
5ba5649b RD |
5552 | def GetVeto(*args, **kwargs): |
5553 | """GetVeto(self) -> bool""" | |
5554 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5555 | ||
e811c8ce | 5556 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5557 | """ |
5558 | SetCanVeto(self, bool canVeto) | |
5559 | ||
5560 | Sets the 'can veto' flag. | |
5561 | """ | |
54f9ee45 | 5562 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5563 | |
5564 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5565 | """ |
5566 | CanVeto(self) -> bool | |
e811c8ce | 5567 | |
5ba5649b RD |
5568 | Returns true if you can veto a system shutdown or a window close |
5569 | event. Vetoing a window close event is not possible if the calling | |
5570 | code wishes to force the application to exit, and so this function | |
5571 | must be called to check this. | |
5572 | """ | |
5573 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5574 | |
2bf58437 | 5575 | LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`") |
2131d850 | 5576 | _core_.CloseEvent_swigregister(CloseEvent) |
d14a1e28 RD |
5577 | |
5578 | #--------------------------------------------------------------------------- | |
5579 | ||
5580 | class ShowEvent(Event): | |
5ba5649b | 5581 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
0085ce49 RD |
5582 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5583 | __repr__ = _swig_repr | |
5584 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5585 | """ |
5586 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5587 | ||
5588 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5589 | """ | |
0085ce49 | 5590 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
e811c8ce | 5591 | def SetShow(*args, **kwargs): |
a95a7133 | 5592 | """SetShow(self, bool show)""" |
54f9ee45 | 5593 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5594 | |
5595 | def GetShow(*args, **kwargs): | |
a95a7133 | 5596 | """GetShow(self) -> bool""" |
54f9ee45 | 5597 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5598 | |
33d6fd3b | 5599 | Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`") |
2131d850 | 5600 | _core_.ShowEvent_swigregister(ShowEvent) |
d14a1e28 RD |
5601 | |
5602 | #--------------------------------------------------------------------------- | |
5603 | ||
5604 | class IconizeEvent(Event): | |
5ba5649b RD |
5605 | """ |
5606 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5607 | restored. | |
5608 | """ | |
0085ce49 RD |
5609 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5610 | __repr__ = _swig_repr | |
5611 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5612 | """ |
5613 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5614 | ||
5615 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5616 | restored. | |
5617 | """ | |
0085ce49 | 5618 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
e811c8ce | 5619 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5620 | """ |
5621 | Iconized(self) -> bool | |
5622 | ||
5623 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5624 | been restored. | |
5625 | """ | |
54f9ee45 | 5626 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5627 | |
2131d850 | 5628 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d14a1e28 RD |
5629 | |
5630 | #--------------------------------------------------------------------------- | |
5631 | ||
5632 | class MaximizeEvent(Event): | |
5ba5649b | 5633 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
0085ce49 RD |
5634 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5635 | __repr__ = _swig_repr | |
5636 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5637 | """ |
5638 | __init__(self, int id=0) -> MaximizeEvent | |
5639 | ||
5640 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5641 | """ | |
0085ce49 | 5642 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 5643 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d14a1e28 RD |
5644 | |
5645 | #--------------------------------------------------------------------------- | |
5646 | ||
5647 | class DropFilesEvent(Event): | |
5ba5649b RD |
5648 | """ |
5649 | This class is used for drop files events, that is, when files have | |
5650 | been dropped onto the window. This functionality is only available | |
5651 | under Windows. The window must have previously been enabled for | |
5652 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5653 | ||
5654 | Important note: this is a separate implementation to the more general | |
5655 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5656 | implementation uses the older, Windows message-based approach of | |
5657 | dropping files. | |
5658 | ||
5659 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5660 | events. | |
5661 | ||
5662 | """ | |
0085ce49 RD |
5663 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5664 | def __init__(self): raise AttributeError, "No constructor defined" | |
5665 | __repr__ = _swig_repr | |
e811c8ce | 5666 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5667 | """ |
5668 | GetPosition(self) -> Point | |
5669 | ||
5670 | Returns the position at which the files were dropped. | |
5671 | """ | |
54f9ee45 | 5672 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5673 | |
5674 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5675 | """ |
5676 | GetNumberOfFiles(self) -> int | |
5677 | ||
5678 | Returns the number of files dropped. | |
5679 | """ | |
54f9ee45 | 5680 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
5681 | |
5682 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5683 | """ |
5684 | GetFiles(self) -> PyObject | |
5685 | ||
5686 | Returns a list of the filenames that were dropped. | |
5687 | """ | |
54f9ee45 | 5688 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 5689 | |
2bf58437 RD |
5690 | Files = property(GetFiles,doc="See `GetFiles`") |
5691 | NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`") | |
5692 | Position = property(GetPosition,doc="See `GetPosition`") | |
2131d850 | 5693 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d14a1e28 RD |
5694 | |
5695 | #--------------------------------------------------------------------------- | |
5696 | ||
54f9ee45 RD |
5697 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5698 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 5699 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
5700 | """ |
5701 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5702 | wxWidgets to give an application the chance to update various user | |
5703 | interface elements. | |
5704 | ||
5705 | Without update UI events, an application has to work hard to | |
5706 | check/uncheck, enable/disable, and set the text for elements such as | |
5707 | menu items and toolbar buttons. The code for doing this has to be | |
5708 | mixed up with the code that is invoked when an action is invoked for a | |
5709 | menu item or button. | |
5710 | ||
5711 | With update UI events, you define an event handler to look at the | |
5712 | state of the application and change UI elements accordingly. wxWidgets | |
5713 | will call your handler functions in idle time, so you don't have to | |
5714 | worry where to call this code. In addition to being a clearer and more | |
5715 | declarative method, it also means you don't have to worry whether | |
5716 | you're updating a toolbar or menubar identifier. The same handler can | |
5717 | update a menu item and toolbar button, if the ID values are the same. | |
5718 | ||
5719 | Instead of directly manipulating the menu or button, you call | |
5720 | functions in the event object, such as `Check`. wxWidgets will | |
5721 | determine whether such a call has been made, and which UI element to | |
5722 | update. | |
5723 | ||
5724 | These events will work for popup menus as well as menubars. Just | |
5725 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5726 | any UI events for the window that owns the menu. | |
5727 | ||
5728 | If you find that the overhead of UI update processing is affecting | |
5729 | your application, you can do one or both of the following: | |
5730 | ||
5731 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5732 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5733 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5734 | receive update events. No other windows will receive update | |
5735 | events. | |
5736 | ||
5737 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5738 | value to set the delay between updates. You may need to call | |
5739 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5740 | a dialog is about to be shown, in case the user sees a slight | |
5741 | delay before windows are updated. | |
5742 | ||
5743 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5744 | handler for a window does not affect this because the events are sent | |
5745 | from an internal idle handler. | |
5746 | ||
5747 | wxWidgets tries to optimize update events on some platforms. On | |
5748 | Windows and GTK+, events for menubar items are only sent when the menu | |
5749 | is about to be shown, and not in idle time. | |
5750 | ||
5751 | """ | |
0085ce49 RD |
5752 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5753 | __repr__ = _swig_repr | |
5754 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5755 | """ |
5756 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5757 | ||
5758 | Constructor | |
5759 | """ | |
0085ce49 | 5760 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
e811c8ce | 5761 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5762 | """ |
5763 | GetChecked(self) -> bool | |
5764 | ||
5765 | Returns ``True`` if the UI element should be checked. | |
5766 | """ | |
54f9ee45 | 5767 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
5768 | |
5769 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5770 | """ |
5771 | GetEnabled(self) -> bool | |
5772 | ||
5773 | Returns ``True`` if the UI element should be enabled. | |
5774 | """ | |
54f9ee45 | 5775 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce | 5776 | |
b1fcee84 RD |
5777 | def GetShown(*args, **kwargs): |
5778 | """ | |
5779 | GetShown(self) -> bool | |
5780 | ||
5781 | Returns ``True`` if the UI element should be shown. | |
5782 | """ | |
5783 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
5784 | ||
e811c8ce | 5785 | def GetText(*args, **kwargs): |
5ba5649b RD |
5786 | """ |
5787 | GetText(self) -> String | |
5788 | ||
5789 | Returns the text that should be set for the UI element. | |
5790 | """ | |
54f9ee45 | 5791 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
5792 | |
5793 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5794 | """ |
5795 | GetSetText(self) -> bool | |
5796 | ||
5797 | Returns ``True`` if the application has called `SetText`. For | |
5798 | wxWidgets internal use only. | |
5799 | """ | |
54f9ee45 | 5800 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
5801 | |
5802 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5803 | """ |
5804 | GetSetChecked(self) -> bool | |
5805 | ||
5806 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5807 | internal use only. | |
5808 | """ | |
54f9ee45 | 5809 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
5810 | |
5811 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5812 | """ |
5813 | GetSetEnabled(self) -> bool | |
5814 | ||
5815 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5816 | internal use only. | |
5817 | """ | |
54f9ee45 | 5818 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce | 5819 | |
b1fcee84 RD |
5820 | def GetSetShown(*args, **kwargs): |
5821 | """ | |
5822 | GetSetShown(self) -> bool | |
5823 | ||
5824 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
5825 | internal use only. | |
5826 | """ | |
5827 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
5828 | ||
e811c8ce | 5829 | def Check(*args, **kwargs): |
5ba5649b RD |
5830 | """ |
5831 | Check(self, bool check) | |
5832 | ||
5833 | Check or uncheck the UI element. | |
5834 | """ | |
54f9ee45 | 5835 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
5836 | |
5837 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5838 | """ |
5839 | Enable(self, bool enable) | |
5840 | ||
5841 | Enable or disable the UI element. | |
5842 | """ | |
54f9ee45 | 5843 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce | 5844 | |
b1fcee84 RD |
5845 | def Show(*args, **kwargs): |
5846 | """ | |
5847 | Show(self, bool show) | |
5848 | ||
5849 | Show or hide the UI element. | |
5850 | """ | |
5851 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
5852 | ||
e811c8ce | 5853 | def SetText(*args, **kwargs): |
5ba5649b RD |
5854 | """ |
5855 | SetText(self, String text) | |
5856 | ||
5857 | Sets the text for this UI element. | |
5858 | """ | |
54f9ee45 | 5859 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
5860 | |
5861 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5862 | """ |
5863 | SetUpdateInterval(long updateInterval) | |
5864 | ||
5865 | Sets the interval between updates in milliseconds. Set to -1 to | |
5866 | disable updates, or to 0 to update as frequently as possible. The | |
5867 | default is 0. | |
5868 | ||
5869 | Use this to reduce the overhead of UI update events if your | |
5870 | application has a lot of windows. If you set the value to -1 or | |
5871 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5872 | at appropriate points in your application, such as when a dialog is | |
5873 | about to be shown. | |
5874 | """ | |
54f9ee45 | 5875 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5876 | |
5877 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5878 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5879 | """ |
5880 | GetUpdateInterval() -> long | |
5881 | ||
5882 | Returns the current interval between updates in milliseconds. -1 | |
5883 | disables updates, 0 updates as frequently as possible. | |
5884 | """ | |
54f9ee45 | 5885 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5886 | |
5887 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5888 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5889 | """ |
5890 | CanUpdate(Window win) -> bool | |
5891 | ||
5892 | Returns ``True`` if it is appropriate to update (send UI update events | |
5893 | to) this window. | |
5894 | ||
5895 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5896 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5897 | events were last sent in idle time, and the update interval, to | |
5898 | determine whether events should be sent to this window now. By default | |
5899 | this will always return true because the update mode is initially | |
5900 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5901 | events will be sent as often as possible. You can reduce the frequency | |
5902 | that events are sent by changing the mode and/or setting an update | |
5903 | interval. | |
5904 | ||
5905 | """ | |
54f9ee45 | 5906 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
5907 | |
5908 | CanUpdate = staticmethod(CanUpdate) | |
5909 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5910 | """ |
5911 | ResetUpdateTime() | |
5912 | ||
5913 | Used internally to reset the last-updated time to the current time. It | |
5914 | is assumed that update events are normally sent in idle time, so this | |
5915 | is called at the end of idle processing. | |
5916 | """ | |
54f9ee45 | 5917 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
5918 | |
5919 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5920 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5921 | """ |
5922 | SetMode(int mode) | |
5923 | ||
5924 | Specify how wxWidgets will send update events: to all windows, or only | |
5925 | to those which specify that they will process the events. | |
5926 | ||
5927 | The mode may be one of the following values: | |
5928 | ||
5929 | ============================= ========================================== | |
5930 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5931 | is the default setting. | |
5932 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5933 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5934 | style set. | |
5935 | ============================= ========================================== | |
5936 | ||
5937 | """ | |
54f9ee45 | 5938 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
5939 | |
5940 | SetMode = staticmethod(SetMode) | |
5941 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5942 | """ |
5943 | GetMode() -> int | |
5944 | ||
5945 | Returns a value specifying how wxWidgets will send update events: to | |
5946 | all windows, or only to those which specify that they will process the | |
5947 | events. | |
5948 | """ | |
54f9ee45 | 5949 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
5950 | |
5951 | GetMode = staticmethod(GetMode) | |
dba7934c RD |
5952 | Checked = property(GetChecked,Check,doc="See `GetChecked`") |
5953 | Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`") | |
5954 | Shown = property(GetShown,Show,doc="See `GetShown`") | |
5955 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
2131d850 | 5956 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d14a1e28 | 5957 | |
e811c8ce | 5958 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
0085ce49 | 5959 | """ |
5ba5649b RD |
5960 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
5961 | ||
5962 | Sets the interval between updates in milliseconds. Set to -1 to | |
5963 | disable updates, or to 0 to update as frequently as possible. The | |
5964 | default is 0. | |
5965 | ||
5966 | Use this to reduce the overhead of UI update events if your | |
5967 | application has a lot of windows. If you set the value to -1 or | |
5968 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5969 | at appropriate points in your application, such as when a dialog is | |
5970 | about to be shown. | |
5971 | """ | |
0085ce49 | 5972 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 5973 | |
0085ce49 RD |
5974 | def UpdateUIEvent_GetUpdateInterval(*args): |
5975 | """ | |
5ba5649b RD |
5976 | UpdateUIEvent_GetUpdateInterval() -> long |
5977 | ||
5978 | Returns the current interval between updates in milliseconds. -1 | |
5979 | disables updates, 0 updates as frequently as possible. | |
5980 | """ | |
0085ce49 | 5981 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d14a1e28 | 5982 | |
e811c8ce | 5983 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
0085ce49 | 5984 | """ |
5ba5649b RD |
5985 | UpdateUIEvent_CanUpdate(Window win) -> bool |
5986 | ||
5987 | Returns ``True`` if it is appropriate to update (send UI update events | |
5988 | to) this window. | |
5989 | ||
5990 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5991 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5992 | events were last sent in idle time, and the update interval, to | |
5993 | determine whether events should be sent to this window now. By default | |
5994 | this will always return true because the update mode is initially | |
5995 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5996 | events will be sent as often as possible. You can reduce the frequency | |
5997 | that events are sent by changing the mode and/or setting an update | |
5998 | interval. | |
5999 | ||
6000 | """ | |
0085ce49 | 6001 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 6002 | |
0085ce49 RD |
6003 | def UpdateUIEvent_ResetUpdateTime(*args): |
6004 | """ | |
5ba5649b RD |
6005 | UpdateUIEvent_ResetUpdateTime() |
6006 | ||
6007 | Used internally to reset the last-updated time to the current time. It | |
6008 | is assumed that update events are normally sent in idle time, so this | |
6009 | is called at the end of idle processing. | |
6010 | """ | |
0085ce49 | 6011 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d14a1e28 | 6012 | |
e811c8ce | 6013 | def UpdateUIEvent_SetMode(*args, **kwargs): |
0085ce49 | 6014 | """ |
5ba5649b RD |
6015 | UpdateUIEvent_SetMode(int mode) |
6016 | ||
6017 | Specify how wxWidgets will send update events: to all windows, or only | |
6018 | to those which specify that they will process the events. | |
6019 | ||
6020 | The mode may be one of the following values: | |
6021 | ||
6022 | ============================= ========================================== | |
6023 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6024 | is the default setting. | |
6025 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6026 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6027 | style set. | |
6028 | ============================= ========================================== | |
6029 | ||
6030 | """ | |
0085ce49 | 6031 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6032 | |
0085ce49 RD |
6033 | def UpdateUIEvent_GetMode(*args): |
6034 | """ | |
5ba5649b RD |
6035 | UpdateUIEvent_GetMode() -> int |
6036 | ||
6037 | Returns a value specifying how wxWidgets will send update events: to | |
6038 | all windows, or only to those which specify that they will process the | |
6039 | events. | |
6040 | """ | |
0085ce49 | 6041 | return _core_.UpdateUIEvent_GetMode(*args) |
d14a1e28 RD |
6042 | |
6043 | #--------------------------------------------------------------------------- | |
6044 | ||
6045 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
6046 | """ |
6047 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6048 | when the user changes the colour settings using the control | |
6049 | panel. This is only applicable under Windows. | |
6050 | ||
6051 | The default event handler for this event propagates the event to child | |
6052 | windows, since Windows only sends the events to top-level windows. If | |
6053 | intercepting this event for a top-level window, remember to call | |
6054 | `Skip` so the the base class handler will still be executed, or to | |
6055 | pass the event on to the window's children explicitly. | |
6056 | ||
6057 | """ | |
0085ce49 RD |
6058 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6059 | __repr__ = _swig_repr | |
6060 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6061 | """ |
6062 | __init__(self) -> SysColourChangedEvent | |
6063 | ||
6064 | Constructor | |
6065 | """ | |
0085ce49 | 6066 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 6067 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d14a1e28 RD |
6068 | |
6069 | #--------------------------------------------------------------------------- | |
6070 | ||
6071 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
6072 | """ |
6073 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6074 | a window that loses its mouse capture. This is called even if | |
6075 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6076 | this event allows an application to cater for unexpected capture | |
6077 | releases which might otherwise confuse mouse handling code. | |
6078 | ||
6079 | This event is implemented under Windows only. | |
6080 | """ | |
0085ce49 RD |
6081 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6082 | __repr__ = _swig_repr | |
6083 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6084 | """ |
6085 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6086 | ||
6087 | Constructor | |
6088 | """ | |
0085ce49 | 6089 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
e811c8ce | 6090 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
6091 | """ |
6092 | GetCapturedWindow(self) -> Window | |
6093 | ||
6094 | Returns the window that gained the capture, or ``None`` if it was a | |
6095 | non-wxWidgets window. | |
6096 | """ | |
54f9ee45 | 6097 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 6098 | |
57332a5a | 6099 | CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`") |
2131d850 | 6100 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d14a1e28 RD |
6101 | |
6102 | #--------------------------------------------------------------------------- | |
6103 | ||
34e0a3bb RD |
6104 | class MouseCaptureLostEvent(Event): |
6105 | """ | |
6106 | A mouse capture lost event is sent to a window that obtained mouse | |
6107 | capture, which was subsequently loss due to "external" event, for | |
6108 | example when a dialog box is shown or if another application captures | |
6109 | the mouse. | |
6110 | ||
6111 | If this happens, this event is sent to all windows that are on the | |
6112 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6113 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6114 | if the capture changes because of a call to CaptureMouse or | |
6115 | ReleaseMouse. | |
6116 | ||
6117 | This event is currently emitted under Windows only. | |
6118 | ||
6119 | """ | |
6120 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6121 | __repr__ = _swig_repr | |
6122 | def __init__(self, *args, **kwargs): | |
6123 | """ | |
6124 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
6125 | ||
6126 | A mouse capture lost event is sent to a window that obtained mouse | |
6127 | capture, which was subsequently loss due to "external" event, for | |
6128 | example when a dialog box is shown or if another application captures | |
6129 | the mouse. | |
6130 | ||
6131 | If this happens, this event is sent to all windows that are on the | |
6132 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6133 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6134 | if the capture changes because of a call to CaptureMouse or | |
6135 | ReleaseMouse. | |
6136 | ||
6137 | This event is currently emitted under Windows only. | |
6138 | ||
6139 | """ | |
6140 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
6141 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
6142 | ||
6143 | #--------------------------------------------------------------------------- | |
6144 | ||
d14a1e28 | 6145 | class DisplayChangedEvent(Event): |
5ba5649b RD |
6146 | """ |
6147 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6148 | resolution has changed. | |
6149 | ||
6150 | This event is implemented under Windows only. | |
6151 | """ | |
0085ce49 RD |
6152 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6153 | __repr__ = _swig_repr | |
6154 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6155 | """__init__(self) -> DisplayChangedEvent""" |
0085ce49 | 6156 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 6157 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d14a1e28 RD |
6158 | |
6159 | #--------------------------------------------------------------------------- | |
6160 | ||
6161 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
6162 | """ |
6163 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6164 | changed, thereby giving each window a chance to redo their own to | |
6165 | match. | |
6166 | ||
6167 | This event is implemented under Windows only. | |
6168 | """ | |
0085ce49 RD |
6169 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6170 | __repr__ = _swig_repr | |
6171 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6172 | """ |
6173 | __init__(self, int id=0) -> PaletteChangedEvent | |
6174 | ||
6175 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6176 | changed, thereby giving each window a chance to redo their own to | |
6177 | match. | |
6178 | ||
6179 | This event is implemented under Windows only. | |
6180 | """ | |
0085ce49 | 6181 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
e811c8ce | 6182 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 6183 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 6184 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
6185 | |
6186 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 6187 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 6188 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 6189 | |
33d6fd3b | 6190 | ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`") |
2131d850 | 6191 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d14a1e28 RD |
6192 | |
6193 | #--------------------------------------------------------------------------- | |
6194 | ||
6195 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6196 | """ |
6197 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6198 | focus and should re-do its palette. | |
6199 | ||
6200 | This event is implemented under Windows only. | |
6201 | """ | |
0085ce49 RD |
6202 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6203 | __repr__ = _swig_repr | |
6204 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6205 | """ |
6206 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6207 | ||
6208 | Constructor. | |
6209 | """ | |
0085ce49 | 6210 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
e811c8ce | 6211 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6212 | """ |
6213 | SetPaletteRealized(self, bool realized) | |
6214 | ||
6215 | App should set this if it changes the palette. | |
6216 | """ | |
54f9ee45 | 6217 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
6218 | |
6219 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 6220 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 6221 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 6222 | |
33d6fd3b | 6223 | PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`") |
2131d850 | 6224 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d14a1e28 RD |
6225 | |
6226 | #--------------------------------------------------------------------------- | |
6227 | ||
6228 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6229 | """ |
6230 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6231 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6232 | catch navigation events in applications as there are already | |
6233 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6234 | it useful to send navigation events in certain situations to change | |
6235 | the focus in certain ways, although it's probably easier to just call | |
6236 | `wx.Window.Navigate`. | |
6237 | """ | |
0085ce49 RD |
6238 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6239 | __repr__ = _swig_repr | |
6240 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6241 | """__init__(self) -> NavigationKeyEvent""" |
0085ce49 | 6242 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
e811c8ce | 6243 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6244 | """ |
6245 | GetDirection(self) -> bool | |
6246 | ||
6247 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6248 | """ | |
54f9ee45 | 6249 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
6250 | |
6251 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6252 | """ |
6253 | SetDirection(self, bool forward) | |
6254 | ||
6255 | Specify the direction that the navigation should take. Usually the | |
6256 | difference between using Tab and Shift-Tab. | |
6257 | """ | |
54f9ee45 | 6258 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
6259 | |
6260 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6261 | """ |
6262 | IsWindowChange(self) -> bool | |
6263 | ||
6264 | Returns ``True`` if window change is allowed. | |
6265 | """ | |
54f9ee45 | 6266 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
6267 | |
6268 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6269 | """ |
6270 | SetWindowChange(self, bool ischange) | |
6271 | ||
6272 | Specify if the navigation should be able to change parent windows. | |
6273 | For example, changing notebook pages, etc. This is usually implemented | |
6274 | by using Control-Tab. | |
6275 | """ | |
54f9ee45 | 6276 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 6277 | |
68350608 | 6278 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6279 | """ |
6280 | IsFromTab(self) -> bool | |
6281 | ||
6282 | Returns ``True`` if the navigation event is originated from the Tab | |
6283 | key. | |
6284 | """ | |
68350608 RD |
6285 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6286 | ||
6287 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6288 | """ |
6289 | SetFromTab(self, bool bIs) | |
6290 | ||
6291 | Set to true under MSW if the event was generated using the tab key. | |
6292 | This is required for proper navogation over radio buttons. | |
6293 | """ | |
68350608 RD |
6294 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6295 | ||
908b74cd | 6296 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6297 | """ |
6298 | SetFlags(self, long flags) | |
6299 | ||
6300 | Set the navigation flags to a combination of the following: | |
6301 | ||
6302 | * wx.NavigationKeyEvent.IsBackward | |
6303 | * wx.NavigationKeyEvent.IsForward | |
6304 | * wx.NavigationKeyEvent.WinChange | |
6305 | * wx.NavigationKeyEvent.FromTab | |
6306 | ||
6307 | """ | |
908b74cd RD |
6308 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6309 | ||
e811c8ce | 6310 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6311 | """ |
6312 | GetCurrentFocus(self) -> Window | |
6313 | ||
6314 | Returns the child window which currenty has the focus. May be | |
6315 | ``None``. | |
6316 | """ | |
54f9ee45 | 6317 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6318 | |
6319 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6320 | """ |
6321 | SetCurrentFocus(self, Window win) | |
6322 | ||
6323 | Set the window that has the focus. | |
6324 | """ | |
54f9ee45 | 6325 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6326 | |
b0f7404b | 6327 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6328 | IsForward = _core_.NavigationKeyEvent_IsForward |
6329 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6330 | FromTab = _core_.NavigationKeyEvent_FromTab |
57332a5a RD |
6331 | CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`") |
6332 | Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`") | |
2131d850 | 6333 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d14a1e28 RD |
6334 | |
6335 | #--------------------------------------------------------------------------- | |
6336 | ||
6337 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6338 | """ |
6339 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6340 | underlying GUI object) exists. | |
6341 | """ | |
0085ce49 RD |
6342 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6343 | __repr__ = _swig_repr | |
6344 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6345 | """ |
6346 | __init__(self, Window win=None) -> WindowCreateEvent | |
6347 | ||
6348 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6349 | underlying GUI object) exists. | |
6350 | """ | |
0085ce49 | 6351 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
e811c8ce | 6352 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6353 | """ |
6354 | GetWindow(self) -> Window | |
6355 | ||
6356 | Returns the window that this event refers to. | |
6357 | """ | |
54f9ee45 | 6358 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6359 | |
dba7934c | 6360 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 6361 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d14a1e28 RD |
6362 | |
6363 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6364 | """ |
943e8dfd RD |
6365 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6366 | when the GUI window is destroyed. | |
6367 | ||
6368 | When a class derived from `wx.Window` is destroyed its destructor will | |
6369 | have already run by the time this event is sent. Therefore this event | |
6370 | will not usually be received at all by the window itself. Since it is | |
6371 | received after the destructor has run, an object should not try to | |
6372 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6373 | notification of the destruction of another window. | |
5ba5649b | 6374 | """ |
0085ce49 RD |
6375 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6376 | __repr__ = _swig_repr | |
6377 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6378 | """ |
6379 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6380 | ||
943e8dfd RD |
6381 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6382 | when the GUI window is destroyed. | |
6383 | ||
6384 | When a class derived from `wx.Window` is destroyed its destructor will | |
6385 | have already run by the time this event is sent. Therefore this event | |
6386 | will not usually be received at all by the window itself. Since it is | |
6387 | received after the destructor has run, an object should not try to | |
6388 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6389 | notification of the destruction of another window. | |
5ba5649b | 6390 | """ |
0085ce49 | 6391 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
e811c8ce | 6392 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6393 | """ |
6394 | GetWindow(self) -> Window | |
6395 | ||
6396 | Returns the window that this event refers to. | |
6397 | """ | |
54f9ee45 | 6398 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6399 | |
dba7934c | 6400 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 6401 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d14a1e28 RD |
6402 | |
6403 | #--------------------------------------------------------------------------- | |
6404 | ||
6405 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6406 | """ |
6407 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6408 | give the application a chance to show a context (popup) menu. | |
6409 | """ | |
0085ce49 RD |
6410 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6411 | __repr__ = _swig_repr | |
6412 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6413 | """ |
2131d850 | 6414 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6415 | |
6416 | Constructor. | |
6417 | """ | |
0085ce49 | 6418 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
e811c8ce | 6419 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6420 | """ |
6421 | GetPosition(self) -> Point | |
6422 | ||
6423 | Returns the position (in screen coordinants) at which the menu should | |
6424 | be shown. | |
6425 | """ | |
54f9ee45 | 6426 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6427 | |
6428 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6429 | """ |
6430 | SetPosition(self, Point pos) | |
6431 | ||
6432 | Sets the position at which the menu should be shown. | |
6433 | """ | |
54f9ee45 | 6434 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6435 | |
2bf58437 | 6436 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
2131d850 | 6437 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d14a1e28 RD |
6438 | |
6439 | #--------------------------------------------------------------------------- | |
6440 | ||
54f9ee45 RD |
6441 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6442 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6443 | class IdleEvent(Event): |
5ba5649b RD |
6444 | """ |
6445 | This class is used for EVT_IDLE events, which are generated and sent | |
6446 | when the application *becomes* idle. In other words, the when the | |
6447 | event queue becomes empty then idle events are sent to all windows (by | |
6448 | default) and as long as none of them call `RequestMore` then there are | |
6449 | no more idle events until after the system event queue has some normal | |
6450 | events and then becomes empty again. | |
6451 | ||
6452 | By default, idle events are sent to all windows. If this is causing a | |
6453 | significant overhead in your application, you can call | |
6454 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6455 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6456 | which should receive idle events. Then idle events will only be sent | |
6457 | to those windows and not to any others. | |
6458 | """ | |
0085ce49 RD |
6459 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6460 | __repr__ = _swig_repr | |
6461 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6462 | """ |
6463 | __init__(self) -> IdleEvent | |
6464 | ||
6465 | Constructor | |
6466 | """ | |
0085ce49 | 6467 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
e811c8ce | 6468 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6469 | """ |
6470 | RequestMore(self, bool needMore=True) | |
6471 | ||
6472 | Tells wxWidgets that more processing is required. This function can be | |
6473 | called by an EVT_IDLE handler for a window to indicate that the | |
6474 | application should forward the EVT_IDLE event once more to the | |
6475 | application windows. If no window calls this function during its | |
6476 | EVT_IDLE handler, then the application will remain in a passive event | |
6477 | loop until a new event is posted to the application by the windowing | |
6478 | system. | |
6479 | """ | |
54f9ee45 | 6480 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6481 | |
6482 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6483 | """ |
6484 | MoreRequested(self) -> bool | |
6485 | ||
6486 | Returns ``True`` if the OnIdle function processing this event | |
6487 | requested more processing time. | |
6488 | """ | |
54f9ee45 | 6489 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6490 | |
6491 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6492 | """ |
6493 | SetMode(int mode) | |
6494 | ||
6495 | Static method for specifying how wxWidgets will send idle events: to | |
6496 | all windows, or only to those which specify that they will process the | |
6497 | events. | |
6498 | ||
6499 | The mode can be one of the following values: | |
6500 | ||
6501 | ========================= ======================================== | |
6502 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6503 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6504 | the wx.WS_EX_PROCESS_IDLE extra style | |
6505 | flag set. | |
6506 | ========================= ======================================== | |
6507 | ||
6508 | """ | |
54f9ee45 | 6509 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6510 | |
6511 | SetMode = staticmethod(SetMode) | |
6512 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6513 | """ |
6514 | GetMode() -> int | |
6515 | ||
6516 | Static method returning a value specifying how wxWidgets will send | |
6517 | idle events: to all windows, or only to those which specify that they | |
6518 | will process the events. | |
6519 | """ | |
54f9ee45 | 6520 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6521 | |
6522 | GetMode = staticmethod(GetMode) | |
6523 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6524 | """ |
6525 | CanSend(Window win) -> bool | |
6526 | ||
6527 | Returns ``True`` if it is appropriate to send idle events to this | |
6528 | window. | |
6529 | ||
6530 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6531 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6532 | events should be sent to this window now. By default this will always | |
6533 | return ``True`` because the update mode is initially | |
6534 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6535 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6536 | """ | |
54f9ee45 | 6537 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6538 | |
6539 | CanSend = staticmethod(CanSend) | |
2131d850 | 6540 | _core_.IdleEvent_swigregister(IdleEvent) |
d14a1e28 | 6541 | |
e811c8ce | 6542 | def IdleEvent_SetMode(*args, **kwargs): |
0085ce49 | 6543 | """ |
5ba5649b RD |
6544 | IdleEvent_SetMode(int mode) |
6545 | ||
6546 | Static method for specifying how wxWidgets will send idle events: to | |
6547 | all windows, or only to those which specify that they will process the | |
6548 | events. | |
6549 | ||
6550 | The mode can be one of the following values: | |
6551 | ||
6552 | ========================= ======================================== | |
6553 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6554 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6555 | the wx.WS_EX_PROCESS_IDLE extra style | |
6556 | flag set. | |
6557 | ========================= ======================================== | |
6558 | ||
6559 | """ | |
0085ce49 | 6560 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6561 | |
0085ce49 RD |
6562 | def IdleEvent_GetMode(*args): |
6563 | """ | |
5ba5649b RD |
6564 | IdleEvent_GetMode() -> int |
6565 | ||
6566 | Static method returning a value specifying how wxWidgets will send | |
6567 | idle events: to all windows, or only to those which specify that they | |
6568 | will process the events. | |
6569 | """ | |
0085ce49 | 6570 | return _core_.IdleEvent_GetMode(*args) |
d14a1e28 | 6571 | |
e811c8ce | 6572 | def IdleEvent_CanSend(*args, **kwargs): |
0085ce49 | 6573 | """ |
5ba5649b RD |
6574 | IdleEvent_CanSend(Window win) -> bool |
6575 | ||
6576 | Returns ``True`` if it is appropriate to send idle events to this | |
6577 | window. | |
6578 | ||
6579 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6580 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6581 | events should be sent to this window now. By default this will always | |
6582 | return ``True`` because the update mode is initially | |
6583 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6584 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6585 | """ | |
0085ce49 | 6586 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6587 | |
6588 | #--------------------------------------------------------------------------- | |
6589 | ||
2131d850 RD |
6590 | class ClipboardTextEvent(CommandEvent): |
6591 | """ | |
6592 | A Clipboard Text event is sent when a window intercepts a text | |
6593 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6594 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6595 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6596 | generated automatically for a Rich Edit text control. | |
6597 | """ | |
6598 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6599 | __repr__ = _swig_repr | |
6600 | def __init__(self, *args, **kwargs): | |
6601 | """ | |
6602 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6603 | ||
6604 | A Clipboard Text event is sent when a window intercepts a text | |
6605 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6606 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6607 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6608 | generated automatically for a Rich Edit text control. | |
6609 | """ | |
6610 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6611 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6612 | ||
6613 | #--------------------------------------------------------------------------- | |
6614 | ||
d14a1e28 | 6615 | class PyEvent(Event): |
5ba5649b RD |
6616 | """ |
6617 | wx.PyEvent can be used as a base class for implementing custom event | |
6618 | types in Python. You should derived from this class instead of | |
6619 | `wx.Event` because this class is Python-aware and is able to transport | |
6620 | its Python bits safely through the wxWidgets event system and have | |
6621 | them still be there when the event handler is invoked. | |
6622 | ||
6623 | :see: `wx.PyCommandEvent` | |
6624 | ||
6625 | """ | |
0085ce49 RD |
6626 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6627 | __repr__ = _swig_repr | |
6628 | def __init__(self, *args, **kwargs): | |
2131d850 | 6629 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
0085ce49 | 6630 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6631 | self._SetSelf(self) |
e811c8ce | 6632 | |
0085ce49 RD |
6633 | __swig_destroy__ = _core_.delete_PyEvent |
6634 | __del__ = lambda self : None; | |
5ba5649b RD |
6635 | def _SetSelf(*args, **kwargs): |
6636 | """_SetSelf(self, PyObject self)""" | |
6637 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6638 | |
5ba5649b RD |
6639 | def _GetSelf(*args, **kwargs): |
6640 | """_GetSelf(self) -> PyObject""" | |
6641 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6642 | |
2131d850 | 6643 | _core_.PyEvent_swigregister(PyEvent) |
d14a1e28 RD |
6644 | |
6645 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6646 | """ |
6647 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6648 | event types in Python, where the event shoudl travel up to parent | |
6649 | windows looking for a handler. You should derived from this class | |
6650 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6651 | able to transport its Python bits safely through the wxWidgets event | |
6652 | system and have them still be there when the event handler is invoked. | |
6653 | ||
6654 | :see: `wx.PyEvent` | |
6655 | ||
6656 | """ | |
0085ce49 RD |
6657 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6658 | __repr__ = _swig_repr | |
6659 | def __init__(self, *args, **kwargs): | |
2131d850 | 6660 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
0085ce49 | 6661 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 6662 | self._SetSelf(self) |
e811c8ce | 6663 | |
0085ce49 RD |
6664 | __swig_destroy__ = _core_.delete_PyCommandEvent |
6665 | __del__ = lambda self : None; | |
5ba5649b RD |
6666 | def _SetSelf(*args, **kwargs): |
6667 | """_SetSelf(self, PyObject self)""" | |
6668 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6669 | |
5ba5649b RD |
6670 | def _GetSelf(*args, **kwargs): |
6671 | """_GetSelf(self) -> PyObject""" | |
6672 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6673 | |
2131d850 | 6674 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d14a1e28 | 6675 | |
53aa7709 | 6676 | class DateEvent(CommandEvent): |
5ba5649b RD |
6677 | """ |
6678 | This event class holds information about a date change event and is | |
6679 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6680 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6681 | EVT_DATE_CHANGED. | |
6682 | """ | |
0085ce49 RD |
6683 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6684 | __repr__ = _swig_repr | |
6685 | def __init__(self, *args, **kwargs): | |
2131d850 | 6686 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
0085ce49 | 6687 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 6688 | def GetDate(*args, **kwargs): |
5ba5649b RD |
6689 | """ |
6690 | GetDate(self) -> DateTime | |
6691 | ||
6692 | Returns the date. | |
6693 | """ | |
53aa7709 RD |
6694 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6695 | ||
6696 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6697 | """ |
6698 | SetDate(self, DateTime date) | |
6699 | ||
6700 | Sets the date carried by the event, normally only used by the library | |
6701 | internally. | |
6702 | """ | |
53aa7709 RD |
6703 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6704 | ||
2bf58437 | 6705 | Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`") |
2131d850 | 6706 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 RD |
6707 | |
6708 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6709 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6710 | ||
d14a1e28 RD |
6711 | #--------------------------------------------------------------------------- |
6712 | ||
54f9ee45 RD |
6713 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6714 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6715 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6716 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6717 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6718 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 6719 | class PyApp(EvtHandler): |
66c033b4 RD |
6720 | """ |
6721 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6722 | `wx.App` class (or some other derived class) instead. | |
6723 | """ | |
0085ce49 RD |
6724 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6725 | __repr__ = _swig_repr | |
6726 | def __init__(self, *args, **kwargs): | |
98e665d3 | 6727 | """ |
a95a7133 | 6728 | __init__(self) -> PyApp |
98e665d3 RD |
6729 | |
6730 | Create a new application object, starting the bootstrap process. | |
6731 | """ | |
0085ce49 | 6732 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
70b7a5fe RD |
6733 | self._setCallbackInfo(self, PyApp, False) |
6734 | self._setOORInfo(self, False) | |
e811c8ce | 6735 | |
0085ce49 RD |
6736 | __swig_destroy__ = _core_.delete_PyApp |
6737 | __del__ = lambda self : None; | |
e811c8ce | 6738 | def _setCallbackInfo(*args, **kwargs): |
70b7a5fe | 6739 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
54f9ee45 | 6740 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
6741 | |
6742 | def GetAppName(*args, **kwargs): | |
0df68c9f | 6743 | """ |
a95a7133 | 6744 | GetAppName(self) -> String |
6c3b4aae | 6745 | |
0df68c9f RD |
6746 | Get the application name. |
6747 | """ | |
54f9ee45 | 6748 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
6749 | |
6750 | def SetAppName(*args, **kwargs): | |
0df68c9f | 6751 | """ |
a95a7133 | 6752 | SetAppName(self, String name) |
6c3b4aae | 6753 | |
66c033b4 RD |
6754 | Set the application name. This value may be used automatically by |
6755 | `wx.Config` and such. | |
0df68c9f | 6756 | """ |
54f9ee45 | 6757 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
6758 | |
6759 | def GetClassName(*args, **kwargs): | |
0df68c9f | 6760 | """ |
a95a7133 | 6761 | GetClassName(self) -> String |
e811c8ce | 6762 | |
0df68c9f RD |
6763 | Get the application's class name. |
6764 | """ | |
54f9ee45 | 6765 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
6766 | |
6767 | def SetClassName(*args, **kwargs): | |
0df68c9f | 6768 | """ |
a95a7133 | 6769 | SetClassName(self, String name) |
6c3b4aae | 6770 | |
66c033b4 RD |
6771 | Set the application's class name. This value may be used for |
6772 | X-resources if applicable for the platform | |
0df68c9f | 6773 | """ |
54f9ee45 | 6774 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
6775 | |
6776 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 6777 | """ |
a95a7133 | 6778 | GetVendorName(self) -> String |
6c3b4aae | 6779 | |
0df68c9f RD |
6780 | Get the application's vendor name. |
6781 | """ | |
54f9ee45 | 6782 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
6783 | |
6784 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 6785 | """ |
a95a7133 | 6786 | SetVendorName(self, String name) |
6c3b4aae | 6787 | |
66c033b4 RD |
6788 | Set the application's vendor name. This value may be used |
6789 | automatically by `wx.Config` and such. | |
0df68c9f | 6790 | """ |
54f9ee45 | 6791 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
6792 | |
6793 | def GetTraits(*args, **kwargs): | |
0df68c9f | 6794 | """ |
a95a7133 | 6795 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 6796 | |
66c033b4 RD |
6797 | Return (and create if necessary) the app traits object to which we |
6798 | delegate for everything which either should be configurable by the | |
6799 | user (then he can change the default behaviour simply by overriding | |
6800 | CreateTraits() and returning his own traits object) or which is | |
6801 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6802 | differences behind the common facade. | |
6803 | ||
6804 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 6805 | """ |
54f9ee45 | 6806 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
6807 | |
6808 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 6809 | """ |
a95a7133 | 6810 | ProcessPendingEvents(self) |
6c3b4aae | 6811 | |
66c033b4 RD |
6812 | Process all events in the Pending Events list -- it is necessary to |
6813 | call this function to process posted events. This normally happens | |
6814 | during each event loop iteration. | |
0df68c9f | 6815 | """ |
54f9ee45 | 6816 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
6817 | |
6818 | def Yield(*args, **kwargs): | |
0df68c9f | 6819 | """ |
a95a7133 | 6820 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6821 | |
66c033b4 RD |
6822 | Process all currently pending events right now, instead of waiting |
6823 | until return to the event loop. It is an error to call ``Yield`` | |
6824 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 6825 | |
66c033b4 | 6826 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
6827 | reentrancies (i.e. when called from an event handler it may |
6828 | result in calling the same event handler again), use with | |
6829 | extreme care or, better, don't use at all! | |
0df68c9f | 6830 | |
66c033b4 | 6831 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 6832 | |
0df68c9f | 6833 | """ |
54f9ee45 | 6834 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
6835 | |
6836 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 6837 | """ |
a95a7133 | 6838 | WakeUpIdle(self) |
6c3b4aae | 6839 | |
66c033b4 RD |
6840 | Make sure that idle events are sent again. |
6841 | :see: `wx.WakeUpIdle` | |
0df68c9f | 6842 | """ |
54f9ee45 | 6843 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 6844 | |
1fc3b23a RD |
6845 | def IsMainLoopRunning(*args, **kwargs): |
6846 | """ | |
6847 | IsMainLoopRunning() -> bool | |
6848 | ||
6849 | Returns True if we're running the main loop, i.e. if the events can | |
6850 | currently be dispatched. | |
6851 | """ | |
6852 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
6853 | ||
6854 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 6855 | def MainLoop(*args, **kwargs): |
0df68c9f | 6856 | """ |
a95a7133 | 6857 | MainLoop(self) -> int |
6c3b4aae | 6858 | |
66c033b4 RD |
6859 | Execute the main GUI loop, the function doesn't normally return until |
6860 | all top level windows have been closed and destroyed. | |
0df68c9f | 6861 | """ |
54f9ee45 | 6862 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
6863 | |
6864 | def Exit(*args, **kwargs): | |
0df68c9f | 6865 | """ |
a95a7133 | 6866 | Exit(self) |
6c3b4aae | 6867 | |
0df68c9f | 6868 | Exit the main loop thus terminating the application. |
66c033b4 | 6869 | :see: `wx.Exit` |
0df68c9f | 6870 | """ |
54f9ee45 | 6871 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce | 6872 | |
97ab0f6a RD |
6873 | def GetLayoutDirection(*args, **kwargs): |
6874 | """ | |
994453b8 | 6875 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
6876 | |
6877 | Return the layout direction for the current locale. | |
6878 | """ | |
6879 | return _core_.PyApp_GetLayoutDirection(*args, **kwargs) | |
6880 | ||
e811c8ce | 6881 | def ExitMainLoop(*args, **kwargs): |
0df68c9f | 6882 | """ |
a95a7133 | 6883 | ExitMainLoop(self) |
6c3b4aae | 6884 | |
66c033b4 RD |
6885 | Exit the main GUI loop during the next iteration of the main |
6886 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 6887 | """ |
54f9ee45 | 6888 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
6889 | |
6890 | def Pending(*args, **kwargs): | |
0df68c9f | 6891 | """ |
a95a7133 | 6892 | Pending(self) -> bool |
6c3b4aae | 6893 | |
0df68c9f RD |
6894 | Returns True if there are unprocessed events in the event queue. |
6895 | """ | |
54f9ee45 | 6896 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
6897 | |
6898 | def Dispatch(*args, **kwargs): | |
0df68c9f | 6899 | """ |
a95a7133 | 6900 | Dispatch(self) -> bool |
6c3b4aae | 6901 | |
0df68c9f RD |
6902 | Process the first event in the event queue (blocks until an event |
6903 | appears if there are none currently) | |
6904 | """ | |
54f9ee45 | 6905 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
6906 | |
6907 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 6908 | """ |
a95a7133 | 6909 | ProcessIdle(self) -> bool |
6c3b4aae | 6910 | |
66c033b4 RD |
6911 | Called from the MainLoop when the application becomes idle (there are |
6912 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6913 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 6914 | """ |
54f9ee45 | 6915 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
6916 | |
6917 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 6918 | """ |
a95a7133 | 6919 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 6920 | |
66c033b4 RD |
6921 | Send idle event to window and all subwindows. Returns True if more |
6922 | idle time is requested. | |
0df68c9f | 6923 | """ |
54f9ee45 | 6924 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
6925 | |
6926 | def IsActive(*args, **kwargs): | |
0df68c9f | 6927 | """ |
a95a7133 | 6928 | IsActive(self) -> bool |
6c3b4aae | 6929 | |
0df68c9f RD |
6930 | Return True if our app has focus. |
6931 | """ | |
54f9ee45 | 6932 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
6933 | |
6934 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 6935 | """ |
a95a7133 | 6936 | SetTopWindow(self, Window win) |
6c3b4aae | 6937 | |
66c033b4 | 6938 | Set the *main* top level window |
0df68c9f | 6939 | """ |
54f9ee45 | 6940 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
6941 | |
6942 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 6943 | """ |
a95a7133 | 6944 | GetTopWindow(self) -> Window |
6c3b4aae | 6945 | |
66c033b4 RD |
6946 | Return the *main* top level window (if it hadn't been set previously |
6947 | with SetTopWindow(), will return just some top level window and, if | |
6948 | there not any, will return None) | |
0df68c9f | 6949 | """ |
54f9ee45 | 6950 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
6951 | |
6952 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6953 | """ |
a95a7133 | 6954 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 6955 | |
66c033b4 RD |
6956 | Control the exit behaviour: by default, the program will exit the main |
6957 | loop (and so, usually, terminate) when the last top-level program | |
6958 | window is deleted. Beware that if you disable this behaviour (with | |
6959 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
6960 | explicitly from somewhere. | |
0df68c9f | 6961 | """ |
54f9ee45 | 6962 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6963 | |
6964 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6965 | """ |
a95a7133 | 6966 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 6967 | |
0df68c9f RD |
6968 | Get the current exit behaviour setting. |
6969 | """ | |
54f9ee45 | 6970 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6971 | |
6972 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6973 | """ |
a95a7133 | 6974 | SetUseBestVisual(self, bool flag) |
6c3b4aae | 6975 | |
66c033b4 RD |
6976 | Set whether the app should try to use the best available visual on |
6977 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 6978 | """ |
54f9ee45 | 6979 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6980 | |
6981 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6982 | """ |
a95a7133 | 6983 | GetUseBestVisual(self) -> bool |
6c3b4aae | 6984 | |
0df68c9f RD |
6985 | Get current UseBestVisual setting. |
6986 | """ | |
54f9ee45 | 6987 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6988 | |
6989 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 6990 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 6991 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
6992 | |
6993 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 6994 | """GetPrintMode(self) -> int""" |
54f9ee45 | 6995 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 6996 | |
e811c8ce | 6997 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 6998 | """ |
a95a7133 | 6999 | SetAssertMode(self, int mode) |
6c3b4aae | 7000 | |
41e2b43e | 7001 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 7002 | """ |
54f9ee45 | 7003 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 7004 | |
6c3b4aae | 7005 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 7006 | """ |
a95a7133 | 7007 | GetAssertMode(self) -> int |
6c3b4aae | 7008 | |
0df68c9f RD |
7009 | Get the current OnAssert behaviour setting. |
7010 | """ | |
54f9ee45 | 7011 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 7012 | |
e811c8ce | 7013 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 7014 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 7015 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7016 | |
7017 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7018 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7019 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 7020 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7021 | |
7022 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7023 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7024 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 7025 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7026 | |
7027 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7028 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7029 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 7030 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7031 | |
7032 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7033 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7034 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 7035 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7036 | |
7037 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7038 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 7039 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 7040 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7041 | |
7042 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7043 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7044 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 7045 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7046 | |
7047 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7048 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7049 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 7050 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7051 | |
7052 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7053 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7054 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 7055 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7056 | |
7057 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7058 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7059 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 7060 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7061 | |
7062 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7063 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 7064 | """ |
a95a7133 | 7065 | _BootstrapApp(self) |
6c3b4aae | 7066 | |
0df68c9f RD |
7067 | For internal use only |
7068 | """ | |
54f9ee45 | 7069 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
7070 | |
7071 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 7072 | """ |
66c033b4 | 7073 | GetComCtl32Version() -> int |
6c3b4aae | 7074 | |
66c033b4 RD |
7075 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7076 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7077 | """ |
54f9ee45 | 7078 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
7079 | |
7080 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
33d6fd3b | 7081 | def IsDisplayAvailable(*args, **kwargs): |
fc46b7f3 | 7082 | """ |
33d6fd3b | 7083 | IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7084 | |
7085 | Tests if it is possible to create a GUI in the current environment. | |
7086 | This will mean different things on the different platforms. | |
7087 | ||
7088 | * On X Windows systems this function will return ``False`` if it is | |
7089 | not able to open a connection to the X display, which can happen | |
7090 | if $DISPLAY is not set, or is not set correctly. | |
7091 | ||
7092 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7093 | able to access the window manager, which can happen if logged in | |
7094 | remotely or if running from the normal version of python instead | |
7095 | of the framework version, (i.e., pythonw.) | |
7096 | ||
7097 | * On MS Windows... | |
7098 | ||
7099 | """ | |
33d6fd3b RD |
7100 | return _core_.PyApp_IsDisplayAvailable(*args, **kwargs) |
7101 | ||
7102 | IsDisplayAvailable = staticmethod(IsDisplayAvailable) | |
7103 | AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`") | |
7104 | AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`") | |
7105 | ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`") | |
7106 | ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`") | |
7107 | LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`") | |
7108 | PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`") | |
7109 | TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`") | |
7110 | Traits = property(GetTraits,doc="See `GetTraits`") | |
7111 | UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`") | |
7112 | VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`") | |
7113 | Active = property(IsActive) | |
2131d850 | 7114 | _core_.PyApp_swigregister(PyApp) |
d14a1e28 | 7115 | |
0085ce49 RD |
7116 | def PyApp_IsMainLoopRunning(*args): |
7117 | """ | |
1fc3b23a RD |
7118 | PyApp_IsMainLoopRunning() -> bool |
7119 | ||
7120 | Returns True if we're running the main loop, i.e. if the events can | |
7121 | currently be dispatched. | |
7122 | """ | |
0085ce49 | 7123 | return _core_.PyApp_IsMainLoopRunning(*args) |
1fc3b23a | 7124 | |
0085ce49 RD |
7125 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
7126 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7127 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d14a1e28 | 7128 | |
0085ce49 RD |
7129 | def PyApp_GetMacAboutMenuItemId(*args): |
7130 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7131 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d14a1e28 | 7132 | |
0085ce49 RD |
7133 | def PyApp_GetMacPreferencesMenuItemId(*args): |
7134 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7135 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d14a1e28 | 7136 | |
0085ce49 RD |
7137 | def PyApp_GetMacExitMenuItemId(*args): |
7138 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7139 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d14a1e28 | 7140 | |
0085ce49 RD |
7141 | def PyApp_GetMacHelpMenuTitleName(*args): |
7142 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7143 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d14a1e28 | 7144 | |
e811c8ce | 7145 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
0085ce49 RD |
7146 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
7147 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d14a1e28 | 7148 | |
e811c8ce | 7149 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
0085ce49 RD |
7150 | """PyApp_SetMacAboutMenuItemId(long val)""" |
7151 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d14a1e28 | 7152 | |
e811c8ce | 7153 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
0085ce49 RD |
7154 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
7155 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d14a1e28 | 7156 | |
e811c8ce | 7157 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
0085ce49 RD |
7158 | """PyApp_SetMacExitMenuItemId(long val)""" |
7159 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d14a1e28 | 7160 | |
e811c8ce | 7161 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
0085ce49 RD |
7162 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
7163 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d14a1e28 | 7164 | |
0085ce49 RD |
7165 | def PyApp_GetComCtl32Version(*args): |
7166 | """ | |
0df68c9f | 7167 | PyApp_GetComCtl32Version() -> int |
6c3b4aae | 7168 | |
66c033b4 RD |
7169 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7170 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7171 | """ |
0085ce49 | 7172 | return _core_.PyApp_GetComCtl32Version(*args) |
d14a1e28 | 7173 | |
33d6fd3b | 7174 | def PyApp_IsDisplayAvailable(*args): |
fc46b7f3 | 7175 | """ |
33d6fd3b | 7176 | PyApp_IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7177 | |
7178 | Tests if it is possible to create a GUI in the current environment. | |
7179 | This will mean different things on the different platforms. | |
7180 | ||
7181 | * On X Windows systems this function will return ``False`` if it is | |
7182 | not able to open a connection to the X display, which can happen | |
7183 | if $DISPLAY is not set, or is not set correctly. | |
7184 | ||
7185 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7186 | able to access the window manager, which can happen if logged in | |
7187 | remotely or if running from the normal version of python instead | |
7188 | of the framework version, (i.e., pythonw.) | |
7189 | ||
7190 | * On MS Windows... | |
7191 | ||
7192 | """ | |
33d6fd3b | 7193 | return _core_.PyApp_IsDisplayAvailable(*args) |
fc46b7f3 | 7194 | |
d14a1e28 RD |
7195 | #--------------------------------------------------------------------------- |
7196 | ||
7197 | ||
0085ce49 RD |
7198 | def Exit(*args): |
7199 | """ | |
0df68c9f | 7200 | Exit() |
6c3b4aae | 7201 | |
0df68c9f RD |
7202 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
7203 | """ | |
0085ce49 | 7204 | return _core_.Exit(*args) |
d14a1e28 | 7205 | |
0085ce49 RD |
7206 | def Yield(*args): |
7207 | """ | |
0df68c9f | 7208 | Yield() -> bool |
6c3b4aae | 7209 | |
0df68c9f RD |
7210 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
7211 | """ | |
0085ce49 | 7212 | return _core_.Yield(*args) |
d14a1e28 | 7213 | |
0085ce49 RD |
7214 | def YieldIfNeeded(*args): |
7215 | """ | |
0df68c9f | 7216 | YieldIfNeeded() -> bool |
6c3b4aae | 7217 | |
0df68c9f RD |
7218 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
7219 | """ | |
0085ce49 | 7220 | return _core_.YieldIfNeeded(*args) |
d14a1e28 | 7221 | |
e811c8ce | 7222 | def SafeYield(*args, **kwargs): |
0085ce49 | 7223 | """ |
0df68c9f | 7224 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 7225 | |
66c033b4 RD |
7226 | This function is similar to `wx.Yield`, except that it disables the |
7227 | user input to all program windows before calling `wx.Yield` and | |
7228 | re-enables it again afterwards. If ``win`` is not None, this window | |
7229 | will remain enabled, allowing the implementation of some limited user | |
7230 | interaction. | |
6c3b4aae | 7231 | |
66c033b4 | 7232 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 7233 | """ |
0085ce49 | 7234 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 7235 | |
0085ce49 RD |
7236 | def WakeUpIdle(*args): |
7237 | """ | |
0df68c9f | 7238 | WakeUpIdle() |
6c3b4aae | 7239 | |
66c033b4 RD |
7240 | Cause the message queue to become empty again, so idle events will be |
7241 | sent. | |
0df68c9f | 7242 | """ |
0085ce49 | 7243 | return _core_.WakeUpIdle(*args) |
d14a1e28 | 7244 | |
e811c8ce | 7245 | def PostEvent(*args, **kwargs): |
0085ce49 | 7246 | """ |
0df68c9f | 7247 | PostEvent(EvtHandler dest, Event event) |
6c3b4aae | 7248 | |
66c033b4 RD |
7249 | Send an event to a window or other wx.EvtHandler to be processed |
7250 | later. | |
0df68c9f | 7251 | """ |
0085ce49 | 7252 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 7253 | |
0085ce49 RD |
7254 | def App_CleanUp(*args): |
7255 | """ | |
0df68c9f | 7256 | App_CleanUp() |
6c3b4aae | 7257 | |
41e2b43e | 7258 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 7259 | Python shuts down. |
0df68c9f | 7260 | """ |
0085ce49 | 7261 | return _core_.App_CleanUp(*args) |
d14a1e28 | 7262 | |
0085ce49 RD |
7263 | def GetApp(*args): |
7264 | """ | |
0df68c9f | 7265 | GetApp() -> PyApp |
6c3b4aae | 7266 | |
196addbf | 7267 | Return a reference to the current wx.App object. |
0df68c9f | 7268 | """ |
0085ce49 | 7269 | return _core_.GetApp(*args) |
5cbf236d RD |
7270 | |
7271 | def SetDefaultPyEncoding(*args, **kwargs): | |
0085ce49 | 7272 | """ |
5cbf236d RD |
7273 | SetDefaultPyEncoding(string encoding) |
7274 | ||
7275 | Sets the encoding that wxPython will use when it needs to convert a | |
7276 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
7277 | |
7278 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7279 | but please be aware that the default encoding within the same locale | |
7280 | may be slightly different on different platforms. For example, please | |
7281 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7282 | between the common latin/roman encodings. | |
5cbf236d | 7283 | """ |
0085ce49 | 7284 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7285 | |
0085ce49 RD |
7286 | def GetDefaultPyEncoding(*args): |
7287 | """ | |
5cbf236d RD |
7288 | GetDefaultPyEncoding() -> string |
7289 | ||
7290 | Gets the current encoding that wxPython will use when it needs to | |
7291 | convert a Python string or unicode object to or from a wxString. | |
7292 | """ | |
0085ce49 | 7293 | return _core_.GetDefaultPyEncoding(*args) |
d14a1e28 RD |
7294 | #---------------------------------------------------------------------- |
7295 | ||
7296 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
7297 | """ |
7298 | A class that can be used for redirecting Python's stdout and | |
7299 | stderr streams. It will do nothing until something is wrriten to | |
7300 | the stream at which point it will create a Frame with a text area | |
7301 | and write the text there. | |
7302 | """ | |
d14a1e28 RD |
7303 | def __init__(self, title = "wxPython: stdout/stderr"): |
7304 | self.frame = None | |
7305 | self.title = title | |
412d302d RD |
7306 | self.pos = wx.DefaultPosition |
7307 | self.size = (450, 300) | |
d14a1e28 RD |
7308 | self.parent = None |
7309 | ||
7310 | def SetParent(self, parent): | |
6c3b4aae | 7311 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
7312 | self.parent = parent |
7313 | ||
6c3b4aae RD |
7314 | |
7315 | def CreateOutputWindow(self, st): | |
412d302d RD |
7316 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7317 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 7318 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7319 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 7320 | self.text.AppendText(st) |
6c3b4aae | 7321 | self.frame.Show(True) |
2131d850 | 7322 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
6c3b4aae | 7323 | |
d14a1e28 | 7324 | |
7409c0c6 RD |
7325 | def OnCloseWindow(self, event): |
7326 | if self.frame is not None: | |
7327 | self.frame.Destroy() | |
7328 | self.frame = None | |
7329 | self.text = None | |
7330 | ||
7331 | ||
d14a1e28 | 7332 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
7333 | def write(self, text): |
7334 | """ | |
7335 | Create the output window if needed and write the string to it. | |
7336 | If not called in the context of the gui thread then uses | |
7337 | CallAfter to do the work there. | |
7338 | """ | |
7339 | if self.frame is None: | |
7340 | if not wx.Thread_IsMain(): | |
7341 | wx.CallAfter(self.CreateOutputWindow, text) | |
7342 | else: | |
7343 | self.CreateOutputWindow(text) | |
7344 | else: | |
7345 | if not wx.Thread_IsMain(): | |
7346 | wx.CallAfter(self.text.AppendText, text) | |
7347 | else: | |
7348 | self.text.AppendText(text) | |
7349 | ||
d14a1e28 RD |
7350 | |
7351 | def close(self): | |
6c3b4aae RD |
7352 | if self.frame is not None: |
7353 | wx.CallAfter(self.frame.Close) | |
7354 | ||
d14a1e28 | 7355 | |
19272049 RD |
7356 | def flush(self): |
7357 | pass | |
7358 | ||
7359 | ||
d14a1e28 RD |
7360 | |
7361 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
7362 | |
7363 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
fc46b7f3 | 7364 | |
d14a1e28 | 7365 | class App(wx.PyApp): |
6c3b4aae | 7366 | """ |
66c033b4 RD |
7367 | The ``wx.App`` class represents the application and is used to: |
7368 | ||
7369 | * bootstrap the wxPython system and initialize the underlying | |
7370 | gui toolkit | |
7371 | * set and get application-wide properties | |
7372 | * implement the windowing system main message or event loop, | |
7373 | and to dispatch events to window instances | |
7374 | * etc. | |
7375 | ||
7376 | Every application must have a ``wx.App`` instance, and all | |
7377 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
7378 | ``wx.App`` object has been created in order to ensure that the gui |
7379 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7380 | |
7381 | Normally you would derive from this class and implement an | |
7382 | ``OnInit`` method that creates a frame and then calls | |
7383 | ``self.SetTopWindow(frame)``. | |
7384 | ||
03e37cd5 | 7385 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7386 | directly. |
6c3b4aae | 7387 | """ |
66c033b4 | 7388 | |
d14a1e28 RD |
7389 | outputWindowClass = PyOnDemandOutputWindow |
7390 | ||
03e37cd5 RD |
7391 | def __init__(self, redirect=_defRedirect, filename=None, |
7392 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7393 | """ |
7394 | Construct a ``wx.App`` object. | |
7395 | ||
03e37cd5 RD |
7396 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7397 | redirected? Defaults to True on Windows and Mac, False | |
7398 | otherwise. If `filename` is None then output will be | |
7399 | redirected to a window that pops up as needed. (You can | |
7400 | control what kind of window is created for the output by | |
7401 | resetting the class variable ``outputWindowClass`` to a | |
7402 | class of your choosing.) | |
66c033b4 | 7403 | |
03e37cd5 RD |
7404 | :param filename: The name of a file to redirect output to, if |
7405 | redirect is True. | |
66c033b4 RD |
7406 | |
7407 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7408 | available visual provided by the system (only relevant on |
7409 | systems that have more than one visual.) This parameter | |
7410 | must be used instead of calling `SetUseBestVisual` later | |
7411 | on because it must be set before the underlying GUI | |
7412 | toolkit is initialized. | |
7413 | ||
7414 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7415 | app to terminate upon a Ctrl-C in the console like other | |
7416 | GUI apps will. | |
66c033b4 RD |
7417 | |
7418 | :note: You should override OnInit to do applicaition | |
7419 | initialization to ensure that the system, toolkit and | |
7420 | wxWidgets are fully initialized. | |
7421 | """ | |
fc46b7f3 | 7422 | |
d14a1e28 RD |
7423 | wx.PyApp.__init__(self) |
7424 | ||
fc46b7f3 | 7425 | # make sure we can create a GUI |
33d6fd3b | 7426 | if not self.IsDisplayAvailable(): |
fc46b7f3 RD |
7427 | |
7428 | if wx.Platform == "__WXMAC__": | |
7429 | msg = """This program needs access to the screen. | |
7430 | Please run with 'pythonw', not 'python', and only when you are logged | |
7431 | in on the main display of your Mac.""" | |
7432 | ||
7433 | elif wx.Platform == "__WXGTK__": | |
7434 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
d14a1e28 | 7435 | |
fc46b7f3 RD |
7436 | else: |
7437 | msg = "Unable to create GUI" | |
7438 | # TODO: more description is needed for wxMSW... | |
7439 | ||
7440 | raise SystemExit(msg) | |
7441 | ||
d14a1e28 RD |
7442 | # This has to be done before OnInit |
7443 | self.SetUseBestVisual(useBestVisual) | |
7444 | ||
7445 | # Set the default handler for SIGINT. This fixes a problem | |
7446 | # where if Ctrl-C is pressed in the console that started this | |
7447 | # app then it will not appear to do anything, (not even send | |
7448 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7449 | # setting the default handler then the app will exit, as | |
7450 | # expected (depending on platform.) | |
03e37cd5 RD |
7451 | if clearSigInt: |
7452 | try: | |
7453 | import signal | |
7454 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7455 | except: | |
7456 | pass | |
d14a1e28 RD |
7457 | |
7458 | # Save and redirect the stdio to a window? | |
7459 | self.stdioWin = None | |
7460 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7461 | if redirect: | |
7462 | self.RedirectStdio(filename) | |
7463 | ||
8fb0e70a RD |
7464 | # Use Python's install prefix as the default |
7465 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7466 | ||
d14a1e28 RD |
7467 | # This finishes the initialization of wxWindows and then calls |
7468 | # the OnInit that should be present in the derived class | |
7469 | self._BootstrapApp() | |
7470 | ||
7471 | ||
01f6b6d3 RD |
7472 | def OnPreInit(self): |
7473 | """ | |
7474 | Things that must be done after _BootstrapApp has done its | |
7475 | thing, but would be nice if they were already done by the time | |
7476 | that OnInit is called. | |
7477 | """ | |
7478 | wx.StockGDI._initStockObjects() | |
7479 | ||
7480 | ||
02b455f2 RD |
7481 | def __del__(self, destroy=wx.PyApp.__del__): |
7482 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7483 | destroy(self) | |
d14a1e28 | 7484 | |
70b7a5fe RD |
7485 | def Destroy(self): |
7486 | wx.PyApp.Destroy(self) | |
7487 | self.thisown = 0 | |
d14a1e28 RD |
7488 | |
7489 | def SetTopWindow(self, frame): | |
1e0c8722 | 7490 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7491 | if self.stdioWin: |
7492 | self.stdioWin.SetParent(frame) | |
7493 | wx.PyApp.SetTopWindow(self, frame) | |
7494 | ||
7495 | ||
7496 | def MainLoop(self): | |
1e0c8722 | 7497 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7498 | wx.PyApp.MainLoop(self) |
7499 | self.RestoreStdio() | |
7500 | ||
7501 | ||
7409c0c6 | 7502 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7503 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7504 | if filename: |
7505 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7506 | else: | |
7507 | self.stdioWin = self.outputWindowClass() | |
7508 | _sys.stdout = _sys.stderr = self.stdioWin | |
7509 | ||
7510 | ||
7511 | def RestoreStdio(self): | |
02b455f2 RD |
7512 | try: |
7513 | _sys.stdout, _sys.stderr = self.saveStdio | |
7514 | except: | |
7515 | pass | |
d14a1e28 RD |
7516 | |
7517 | ||
412d302d RD |
7518 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7519 | """ | |
7520 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7521 | the stdio has been redirected. This should be called before |
7522 | any output would cause the output window to be created. | |
412d302d RD |
7523 | """ |
7524 | if self.stdioWin: | |
7525 | if title is not None: | |
7526 | self.stdioWin.title = title | |
7527 | if pos is not None: | |
7528 | self.stdioWin.pos = pos | |
7529 | if size is not None: | |
7530 | self.stdioWin.size = size | |
7531 | ||
7532 | ||
7533 | ||
d14a1e28 | 7534 | |
66c033b4 | 7535 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7536 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7537 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7538 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7539 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7540 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7541 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7542 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7543 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7544 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7545 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7546 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7547 | |
7548 | #---------------------------------------------------------------------------- | |
7549 | ||
7550 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7551 | """ |
7552 | A simple application class. You can just create one of these and | |
7553 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7554 | about OnInit. For example:: |
7555 | ||
7556 | app = wx.PySimpleApp() | |
7557 | frame = wx.Frame(None, title='Hello World') | |
7558 | frame.Show() | |
7559 | app.MainLoop() | |
7560 | ||
7561 | :see: `wx.App` | |
7562 | """ | |
6c3b4aae | 7563 | |
03e37cd5 RD |
7564 | def __init__(self, redirect=False, filename=None, |
7565 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7566 | """ |
7567 | :see: `wx.App.__init__` | |
7568 | """ | |
03e37cd5 | 7569 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7570 | |
d14a1e28 | 7571 | def OnInit(self): |
d14a1e28 RD |
7572 | return True |
7573 | ||
7574 | ||
66c033b4 | 7575 | |
6c3b4aae | 7576 | # Is anybody using this one? |
d14a1e28 RD |
7577 | class PyWidgetTester(wx.App): |
7578 | def __init__(self, size = (250, 100)): | |
7579 | self.size = size | |
7580 | wx.App.__init__(self, 0) | |
7581 | ||
7582 | def OnInit(self): | |
196addbf | 7583 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7584 | self.SetTopWindow(self.frame) |
7585 | return True | |
7586 | ||
66c033b4 RD |
7587 | def SetWidget(self, widgetClass, *args, **kwargs): |
7588 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7589 | self.frame.Show(True) |
7590 | ||
7591 | #---------------------------------------------------------------------------- | |
7592 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7593 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7594 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7595 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7596 | |
7597 | class __wxPyCleanup: | |
7598 | def __init__(self): | |
54f9ee45 | 7599 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7600 | def __del__(self): |
7601 | self.cleanup() | |
7602 | ||
7603 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7604 | ||
7605 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7606 | ## import atexit |
7607 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7608 | |
7609 | ||
7610 | #---------------------------------------------------------------------------- | |
7611 | ||
7612 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7613 | |
7614 | class EventLoop(object): | |
093d3ff1 | 7615 | """Proxy of C++ EventLoop class""" |
0085ce49 RD |
7616 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7617 | __repr__ = _swig_repr | |
7618 | def __init__(self, *args, **kwargs): | |
2ef75293 | 7619 | """__init__(self) -> EventLoop""" |
0085ce49 RD |
7620 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
7621 | __swig_destroy__ = _core_.delete_EventLoop | |
7622 | __del__ = lambda self : None; | |
2ef75293 RD |
7623 | def Run(*args, **kwargs): |
7624 | """Run(self) -> int""" | |
7625 | return _core_.EventLoop_Run(*args, **kwargs) | |
7626 | ||
7627 | def Exit(*args, **kwargs): | |
7628 | """Exit(self, int rc=0)""" | |
7629 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7630 | ||
7631 | def Pending(*args, **kwargs): | |
7632 | """Pending(self) -> bool""" | |
7633 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7634 | ||
7635 | def Dispatch(*args, **kwargs): | |
7636 | """Dispatch(self) -> bool""" | |
7637 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7638 | ||
7639 | def IsRunning(*args, **kwargs): | |
7640 | """IsRunning(self) -> bool""" | |
7641 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7642 | ||
7643 | def GetActive(*args, **kwargs): | |
7644 | """GetActive() -> EventLoop""" | |
7645 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7646 | ||
7647 | GetActive = staticmethod(GetActive) | |
7648 | def SetActive(*args, **kwargs): | |
7649 | """SetActive(EventLoop loop)""" | |
7650 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7651 | ||
7652 | SetActive = staticmethod(SetActive) | |
2131d850 | 7653 | _core_.EventLoop_swigregister(EventLoop) |
2ef75293 | 7654 | |
0085ce49 RD |
7655 | def EventLoop_GetActive(*args): |
7656 | """EventLoop_GetActive() -> EventLoop""" | |
7657 | return _core_.EventLoop_GetActive(*args) | |
2ef75293 RD |
7658 | |
7659 | def EventLoop_SetActive(*args, **kwargs): | |
0085ce49 RD |
7660 | """EventLoop_SetActive(EventLoop loop)""" |
7661 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
2ef75293 | 7662 | |
091f5bed RD |
7663 | class EventLoopActivator(object): |
7664 | """Proxy of C++ EventLoopActivator class""" | |
0085ce49 RD |
7665 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7666 | __repr__ = _swig_repr | |
7667 | def __init__(self, *args, **kwargs): | |
091f5bed | 7668 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
0085ce49 RD |
7669 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
7670 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7671 | __del__ = lambda self : None; | |
2131d850 | 7672 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
091f5bed | 7673 | |
2ef75293 | 7674 | #--------------------------------------------------------------------------- |
d14a1e28 | 7675 | |
eec1c382 RD |
7676 | ACCEL_ALT = _core_.ACCEL_ALT |
7677 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
7678 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
7679 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
7680 | ACCEL_CMD = _core_.ACCEL_CMD | |
1e0c8722 | 7681 | class AcceleratorEntry(object): |
66c033b4 RD |
7682 | """ |
7683 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7684 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7685 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 7686 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
7687 | |
7688 | :see: `wx.AcceleratorTable` | |
7689 | """ | |
0085ce49 RD |
7690 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7691 | __repr__ = _swig_repr | |
7692 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
7693 | """ |
7694 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7695 | ||
7696 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 7697 | """ |
0085ce49 RD |
7698 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
7699 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
7700 | __del__ = lambda self : None; | |
1e0c8722 | 7701 | def Set(*args, **kwargs): |
66c033b4 RD |
7702 | """ |
7703 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 7704 | |
66c033b4 RD |
7705 | (Re)set the attributes of a wx.AcceleratorEntry. |
7706 | :see `__init__` | |
7707 | """ | |
7708 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 | 7709 | |
97ab0f6a RD |
7710 | def Create(*args, **kwargs): |
7711 | """ | |
7712 | Create(String str) -> AcceleratorEntry | |
7713 | ||
7714 | Create accelerator corresponding to the specified string, or None if | |
7715 | it coulnd't be parsed. | |
7716 | """ | |
7717 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
7718 | ||
7719 | Create = staticmethod(Create) | |
1e0c8722 | 7720 | def GetFlags(*args, **kwargs): |
66c033b4 RD |
7721 | """ |
7722 | GetFlags(self) -> int | |
7723 | ||
7724 | Get the AcceleratorEntry's flags. | |
7725 | """ | |
54f9ee45 | 7726 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
7727 | |
7728 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
7729 | """ |
7730 | GetKeyCode(self) -> int | |
7731 | ||
7732 | Get the AcceleratorEntry's keycode. | |
7733 | """ | |
54f9ee45 | 7734 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
7735 | |
7736 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
7737 | """ |
7738 | GetCommand(self) -> int | |
7739 | ||
7740 | Get the AcceleratorEntry's command ID. | |
7741 | """ | |
54f9ee45 | 7742 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 | 7743 | |
97ab0f6a RD |
7744 | def IsOk(*args, **kwargs): |
7745 | """IsOk(self) -> bool""" | |
7746 | return _core_.AcceleratorEntry_IsOk(*args, **kwargs) | |
7747 | ||
7748 | def ToString(*args, **kwargs): | |
7749 | """ | |
7750 | ToString(self) -> String | |
7751 | ||
7752 | Returns a string representation for the this accelerator. The string | |
7753 | is formatted using the <flags>-<keycode> format where <flags> maybe a | |
7754 | hyphen-separed list of "shift|alt|ctrl" | |
7755 | ||
7756 | """ | |
7757 | return _core_.AcceleratorEntry_ToString(*args, **kwargs) | |
7758 | ||
7759 | def FromString(*args, **kwargs): | |
7760 | """ | |
7761 | FromString(self, String str) -> bool | |
7762 | ||
7763 | Returns true if the given string correctly initialized this object. | |
7764 | """ | |
7765 | return _core_.AcceleratorEntry_FromString(*args, **kwargs) | |
7766 | ||
2bf58437 RD |
7767 | Command = property(GetCommand,doc="See `GetCommand`") |
7768 | Flags = property(GetFlags,doc="See `GetFlags`") | |
7769 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
2131d850 | 7770 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
1e0c8722 | 7771 | |
97ab0f6a RD |
7772 | def AcceleratorEntry_Create(*args, **kwargs): |
7773 | """ | |
7774 | AcceleratorEntry_Create(String str) -> AcceleratorEntry | |
7775 | ||
7776 | Create accelerator corresponding to the specified string, or None if | |
7777 | it coulnd't be parsed. | |
7778 | """ | |
7779 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
7780 | ||
1e0c8722 | 7781 | class AcceleratorTable(Object): |
66c033b4 RD |
7782 | """ |
7783 | An accelerator table allows the application to specify a table of | |
7784 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7785 | button commands are supported; on GTK, only menu commands are | |
7786 | supported. | |
66c033b4 | 7787 | """ |
0085ce49 RD |
7788 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7789 | __repr__ = _swig_repr | |
7790 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
7791 | """ |
7792 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 7793 | |
66c033b4 RD |
7794 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7795 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7796 | ||
7797 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 7798 | """ |
0085ce49 RD |
7799 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
7800 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
7801 | __del__ = lambda self : None; | |
1e0c8722 | 7802 | def Ok(*args, **kwargs): |
a95a7133 | 7803 | """Ok(self) -> bool""" |
54f9ee45 | 7804 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
1e0c8722 | 7805 | |
2131d850 | 7806 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
1e0c8722 RD |
7807 | |
7808 | ||
7809 | def GetAccelFromString(*args, **kwargs): | |
0085ce49 RD |
7810 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
7811 | return _core_.GetAccelFromString(*args, **kwargs) | |
1e0c8722 RD |
7812 | #--------------------------------------------------------------------------- |
7813 | ||
74a57fcd RD |
7814 | class VisualAttributes(object): |
7815 | """struct containing all the visual attributes of a control""" | |
0085ce49 RD |
7816 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7817 | __repr__ = _swig_repr | |
7818 | def __init__(self, *args, **kwargs): | |
74a57fcd | 7819 | """ |
a95a7133 | 7820 | __init__(self) -> VisualAttributes |
74a57fcd RD |
7821 | |
7822 | struct containing all the visual attributes of a control | |
7823 | """ | |
0085ce49 RD |
7824 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
7825 | __swig_destroy__ = _core_.delete_VisualAttributes | |
7826 | __del__ = lambda self : None; | |
54f9ee45 RD |
7827 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7828 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7829 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
2131d850 | 7830 | _core_.VisualAttributes_swigregister(VisualAttributes) |
74a57fcd RD |
7831 | NullAcceleratorTable = cvar.NullAcceleratorTable |
7832 | PanelNameStr = cvar.PanelNameStr | |
7833 | ||
54f9ee45 RD |
7834 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7835 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7836 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7837 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7838 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 7839 | class Window(EvtHandler): |
15afbcd0 RD |
7840 | """ |
7841 | wx.Window is the base class for all windows and represents any visible | |
7842 | object on the screen. All controls, top level windows and so on are | |
7843 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7844 | appear on screen themselves. | |
7845 | ||
7846 | """ | |
0085ce49 RD |
7847 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7848 | __repr__ = _swig_repr | |
7849 | def __init__(self, *args, **kwargs): | |
0df68c9f | 7850 | """ |
a95a7133 | 7851 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7852 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
7853 | |
7854 | Construct and show a generic Window. | |
0df68c9f | 7855 | """ |
0085ce49 | 7856 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d14a1e28 | 7857 | self._setOORInfo(self) |
d14a1e28 | 7858 | |
e811c8ce | 7859 | def Create(*args, **kwargs): |
0df68c9f | 7860 | """ |
a95a7133 | 7861 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7862 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
7863 | |
7864 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 7865 | """ |
54f9ee45 | 7866 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 7867 | |
e811c8ce | 7868 | def Close(*args, **kwargs): |
15afbcd0 | 7869 | """ |
a95a7133 | 7870 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
7871 | |
7872 | This function simply generates a EVT_CLOSE event whose handler usually | |
7873 | tries to close the window. It doesn't close the window itself, | |
7874 | however. If force is False (the default) then the window's close | |
7875 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 7876 | """ |
54f9ee45 | 7877 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 7878 | |
e811c8ce | 7879 | def Destroy(*args, **kwargs): |
0df68c9f | 7880 | """ |
a95a7133 | 7881 | Destroy(self) -> bool |
d14a1e28 | 7882 | |
15afbcd0 RD |
7883 | Destroys the window safely. Frames and dialogs are not destroyed |
7884 | immediately when this function is called -- they are added to a list | |
7885 | of windows to be deleted on idle time, when all the window's events | |
7886 | have been processed. This prevents problems with events being sent to | |
7887 | non-existent windows. | |
7888 | ||
7889 | Returns True if the window has either been successfully deleted, or it | |
7890 | has been added to the list of windows pending real deletion. | |
0df68c9f | 7891 | """ |
7e08d4ef RD |
7892 | val = _core_.Window_Destroy(*args, **kwargs) |
7893 | args[0].thisown = 0 | |
7894 | return val | |
d14a1e28 | 7895 | |
e811c8ce | 7896 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 7897 | """ |
a95a7133 | 7898 | DestroyChildren(self) -> bool |
15afbcd0 | 7899 | |
41e2b43e RD |
7900 | Destroys all children of a window. Called automatically by the |
7901 | destructor. | |
15afbcd0 | 7902 | """ |
54f9ee45 | 7903 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 7904 | |
e811c8ce | 7905 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 7906 | """ |
a95a7133 | 7907 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
7908 | |
7909 | Is the window in the process of being deleted? | |
7910 | """ | |
54f9ee45 | 7911 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 7912 | |
e811c8ce | 7913 | def SetLabel(*args, **kwargs): |
15afbcd0 | 7914 | """ |
a95a7133 | 7915 | SetLabel(self, String label) |
15afbcd0 RD |
7916 | |
7917 | Set the text which the window shows in its label if applicable. | |
7918 | """ | |
54f9ee45 | 7919 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 7920 | |
e811c8ce | 7921 | def GetLabel(*args, **kwargs): |
15afbcd0 | 7922 | """ |
a95a7133 | 7923 | GetLabel(self) -> String |
15afbcd0 | 7924 | |
41e2b43e RD |
7925 | Generic way of getting a label from any window, for identification |
7926 | purposes. The interpretation of this function differs from class to | |
7927 | class. For frames and dialogs, the value returned is the title. For | |
7928 | buttons or static text controls, it is the button text. This function | |
7929 | can be useful for meta-programs such as testing tools or special-needs | |
7930 | access programs)which need to identify windows by name. | |
15afbcd0 | 7931 | """ |
54f9ee45 | 7932 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 7933 | |
e811c8ce | 7934 | def SetName(*args, **kwargs): |
15afbcd0 | 7935 | """ |
a95a7133 | 7936 | SetName(self, String name) |
15afbcd0 | 7937 | |
41e2b43e RD |
7938 | Sets the window's name. The window name is used for ressource setting |
7939 | in X, it is not the same as the window title/label | |
15afbcd0 | 7940 | """ |
54f9ee45 | 7941 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 7942 | |
e811c8ce | 7943 | def GetName(*args, **kwargs): |
15afbcd0 | 7944 | """ |
a95a7133 | 7945 | GetName(self) -> String |
15afbcd0 | 7946 | |
41e2b43e RD |
7947 | Returns the windows name. This name is not guaranteed to be unique; |
7948 | it is up to the programmer to supply an appropriate name in the window | |
7949 | constructor or via wx.Window.SetName. | |
15afbcd0 | 7950 | """ |
54f9ee45 | 7951 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 7952 | |
4276dc52 RD |
7953 | def SetWindowVariant(*args, **kwargs): |
7954 | """ | |
a95a7133 | 7955 | SetWindowVariant(self, int variant) |
4276dc52 | 7956 | |
41e2b43e RD |
7957 | Sets the variant of the window/font size to use for this window, if |
7958 | the platform supports variants, for example, wxMac. | |
4276dc52 | 7959 | """ |
54f9ee45 | 7960 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
7961 | |
7962 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 7963 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 7964 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 7965 | |
e811c8ce | 7966 | def SetId(*args, **kwargs): |
15afbcd0 | 7967 | """ |
a95a7133 | 7968 | SetId(self, int winid) |
15afbcd0 RD |
7969 | |
7970 | Sets the identifier of the window. Each window has an integer | |
7971 | identifier. If the application has not provided one, an identifier | |
7972 | will be generated. Normally, the identifier should be provided on | |
7973 | creation and should not be modified subsequently. | |
7974 | """ | |
54f9ee45 | 7975 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 7976 | |
e811c8ce | 7977 | def GetId(*args, **kwargs): |
15afbcd0 | 7978 | """ |
a95a7133 | 7979 | GetId(self) -> int |
15afbcd0 RD |
7980 | |
7981 | Returns the identifier of the window. Each window has an integer | |
7982 | identifier. If the application has not provided one (or the default Id | |
7983 | -1 is used) then an unique identifier with a negative value will be | |
7984 | generated. | |
7985 | """ | |
54f9ee45 | 7986 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 7987 | |
e811c8ce | 7988 | def NewControlId(*args, **kwargs): |
15afbcd0 | 7989 | """ |
66c033b4 | 7990 | NewControlId() -> int |
15afbcd0 RD |
7991 | |
7992 | Generate a control id for the controls which were not given one. | |
7993 | """ | |
54f9ee45 | 7994 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 7995 | |
e811c8ce RD |
7996 | NewControlId = staticmethod(NewControlId) |
7997 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 7998 | """ |
66c033b4 | 7999 | NextControlId(int winid) -> int |
15afbcd0 RD |
8000 | |
8001 | Get the id of the control following the one with the given | |
41e2b43e | 8002 | autogenerated) id |
15afbcd0 | 8003 | """ |
54f9ee45 | 8004 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 8005 | |
e811c8ce RD |
8006 | NextControlId = staticmethod(NextControlId) |
8007 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 8008 | """ |
66c033b4 | 8009 | PrevControlId(int winid) -> int |
15afbcd0 RD |
8010 | |
8011 | Get the id of the control preceding the one with the given | |
41e2b43e | 8012 | autogenerated) id |
15afbcd0 | 8013 | """ |
54f9ee45 | 8014 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 8015 | |
e811c8ce | 8016 | PrevControlId = staticmethod(PrevControlId) |
97ab0f6a RD |
8017 | def GetLayoutDirection(*args, **kwargs): |
8018 | """ | |
994453b8 | 8019 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
8020 | |
8021 | Get the layout direction (LTR or RTL) for this window. Returns | |
8022 | ``wx.Layout_Default`` if layout direction is not supported. | |
8023 | """ | |
8024 | return _core_.Window_GetLayoutDirection(*args, **kwargs) | |
8025 | ||
8026 | def SetLayoutDirection(*args, **kwargs): | |
8027 | """ | |
994453b8 | 8028 | SetLayoutDirection(self, int dir) |
97ab0f6a RD |
8029 | |
8030 | Set the layout direction (LTR or RTL) for this window. | |
8031 | """ | |
8032 | return _core_.Window_SetLayoutDirection(*args, **kwargs) | |
8033 | ||
8034 | def AdjustForLayoutDirection(*args, **kwargs): | |
8035 | """ | |
8036 | AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int | |
8037 | ||
8038 | Mirror coordinates for RTL layout if this window uses it and if the | |
8039 | mirroring is not done automatically like Win32. | |
8040 | """ | |
8041 | return _core_.Window_AdjustForLayoutDirection(*args, **kwargs) | |
8042 | ||
e811c8ce | 8043 | def SetSize(*args, **kwargs): |
15afbcd0 | 8044 | """ |
a95a7133 | 8045 | SetSize(self, Size size) |
15afbcd0 RD |
8046 | |
8047 | Sets the size of the window in pixels. | |
8048 | """ | |
54f9ee45 | 8049 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 8050 | |
e811c8ce | 8051 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 8052 | """ |
a95a7133 | 8053 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8054 | |
8055 | Sets the position and size of the window in pixels. The sizeFlags | |
8056 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
8057 | equal to -1. |
8058 | ||
8059 | ======================== ====================================== | |
8060 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8061 | default should be used. | |
8062 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8063 | -1 values are supplied. | |
8064 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8065 | interpreted as real dimensions, not | |
8066 | default values. | |
8067 | ======================== ====================================== | |
8068 | ||
15afbcd0 | 8069 | """ |
54f9ee45 | 8070 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 8071 | |
e811c8ce | 8072 | def SetRect(*args, **kwargs): |
15afbcd0 | 8073 | """ |
a95a7133 | 8074 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8075 | |
8076 | Sets the position and size of the window in pixels using a wx.Rect. | |
8077 | """ | |
54f9ee45 | 8078 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 8079 | |
e811c8ce | 8080 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 8081 | """ |
a95a7133 | 8082 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
8083 | |
8084 | Sets the size of the window in pixels. | |
8085 | """ | |
54f9ee45 | 8086 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 8087 | |
e811c8ce | 8088 | def Move(*args, **kwargs): |
15afbcd0 | 8089 | """ |
a95a7133 | 8090 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8091 | |
8092 | Moves the window to the given position. | |
8093 | """ | |
54f9ee45 | 8094 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 8095 | |
e811c8ce RD |
8096 | SetPosition = Move |
8097 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 8098 | """ |
a95a7133 | 8099 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8100 | |
8101 | Moves the window to the given position. | |
8102 | """ | |
54f9ee45 | 8103 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 8104 | |
f8167d6e RD |
8105 | def SetBestFittingSize(*args, **kwargs): |
8106 | """ | |
8107 | SetBestFittingSize(self, Size size=DefaultSize) | |
8108 | ||
8109 | A 'Smart' SetSize that will fill in default size components with the | |
8110 | window's *best size* values. Also set's the minsize for use with sizers. | |
8111 | """ | |
8112 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
8113 | ||
e811c8ce | 8114 | def Raise(*args, **kwargs): |
15afbcd0 | 8115 | """ |
a95a7133 | 8116 | Raise(self) |
15afbcd0 | 8117 | |
943e8dfd RD |
8118 | Raises the window to the top of the window hierarchy. In current |
8119 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 8120 | """ |
54f9ee45 | 8121 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
8122 | |
8123 | def Lower(*args, **kwargs): | |
15afbcd0 | 8124 | """ |
a95a7133 | 8125 | Lower(self) |
15afbcd0 | 8126 | |
943e8dfd RD |
8127 | Lowers the window to the bottom of the window hierarchy. In current |
8128 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 8129 | """ |
54f9ee45 | 8130 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
8131 | |
8132 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 8133 | """ |
a95a7133 | 8134 | SetClientSize(self, Size size) |
15afbcd0 RD |
8135 | |
8136 | This sets the size of the window client area in pixels. Using this | |
8137 | function to size a window tends to be more device-independent than | |
8138 | wx.Window.SetSize, since the application need not worry about what | |
8139 | dimensions the border or title bar have when trying to fit the window | |
8140 | around panel items, for example. | |
8141 | """ | |
54f9ee45 | 8142 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
8143 | |
8144 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 8145 | """ |
a95a7133 | 8146 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
8147 | |
8148 | This sets the size of the window client area in pixels. Using this | |
8149 | function to size a window tends to be more device-independent than | |
8150 | wx.Window.SetSize, since the application need not worry about what | |
8151 | dimensions the border or title bar have when trying to fit the window | |
8152 | around panel items, for example. | |
8153 | """ | |
54f9ee45 | 8154 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
8155 | |
8156 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 8157 | """ |
a95a7133 | 8158 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
8159 | |
8160 | This sets the size of the window client area in pixels. Using this | |
8161 | function to size a window tends to be more device-independent than | |
8162 | wx.Window.SetSize, since the application need not worry about what | |
8163 | dimensions the border or title bar have when trying to fit the window | |
8164 | around panel items, for example. | |
8165 | """ | |
54f9ee45 | 8166 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
8167 | |
8168 | def GetPosition(*args, **kwargs): | |
0df68c9f | 8169 | """ |
a95a7133 | 8170 | GetPosition(self) -> Point |
e811c8ce | 8171 | |
75219dcb RD |
8172 | Get the window's position. Notice that the position is in client |
8173 | coordinates for child windows and screen coordinates for the top level | |
8174 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8175 | kinds of windows. | |
0df68c9f | 8176 | """ |
54f9ee45 | 8177 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
8178 | |
8179 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
8180 | """ |
8181 | GetPositionTuple() -> (x,y) | |
e811c8ce | 8182 | |
75219dcb RD |
8183 | Get the window's position. Notice that the position is in client |
8184 | coordinates for child windows and screen coordinates for the top level | |
8185 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8186 | kinds of windows. | |
0df68c9f | 8187 | """ |
54f9ee45 | 8188 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce | 8189 | |
75219dcb RD |
8190 | def GetScreenPosition(*args, **kwargs): |
8191 | """ | |
8192 | GetScreenPosition(self) -> Point | |
8193 | ||
8194 | Get the position of the window in screen coordinantes. | |
8195 | """ | |
8196 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
8197 | ||
8198 | def GetScreenPositionTuple(*args, **kwargs): | |
8199 | """ | |
8200 | GetScreenPositionTuple() -> (x,y) | |
8201 | ||
8202 | Get the position of the window in screen coordinantes. | |
8203 | """ | |
8204 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
8205 | ||
8206 | def GetScreenRect(*args, **kwargs): | |
8207 | """ | |
8208 | GetScreenRect(self) -> Rect | |
8209 | ||
8210 | Returns the size and position of the window in screen coordinantes as | |
8211 | a `wx.Rect` object. | |
8212 | """ | |
8213 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
8214 | ||
e811c8ce | 8215 | def GetSize(*args, **kwargs): |
0df68c9f | 8216 | """ |
a95a7133 | 8217 | GetSize(self) -> Size |
e811c8ce | 8218 | |
0df68c9f RD |
8219 | Get the window size. |
8220 | """ | |
54f9ee45 | 8221 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
8222 | |
8223 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8224 | """ |
8225 | GetSizeTuple() -> (width, height) | |
e811c8ce | 8226 | |
0df68c9f RD |
8227 | Get the window size. |
8228 | """ | |
54f9ee45 | 8229 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
8230 | |
8231 | def GetRect(*args, **kwargs): | |
15afbcd0 | 8232 | """ |
a95a7133 | 8233 | GetRect(self) -> Rect |
15afbcd0 | 8234 | |
75219dcb | 8235 | Returns the size and position of the window as a `wx.Rect` object. |
15afbcd0 | 8236 | """ |
54f9ee45 | 8237 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
8238 | |
8239 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 8240 | """ |
a95a7133 | 8241 | GetClientSize(self) -> Size |
e811c8ce | 8242 | |
15afbcd0 RD |
8243 | This gets the size of the window's 'client area' in pixels. The client |
8244 | area is the area which may be drawn on by the programmer, excluding | |
8245 | title bar, border, scrollbars, etc. | |
0df68c9f | 8246 | """ |
54f9ee45 | 8247 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
8248 | |
8249 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8250 | """ |
8251 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 8252 | |
15afbcd0 RD |
8253 | This gets the size of the window's 'client area' in pixels. The client |
8254 | area is the area which may be drawn on by the programmer, excluding | |
8255 | title bar, border, scrollbars, etc. | |
0df68c9f | 8256 | """ |
54f9ee45 | 8257 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
8258 | |
8259 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 8260 | """ |
a95a7133 | 8261 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
8262 | |
8263 | Get the origin of the client area of the window relative to the | |
8264 | window's top left corner (the client area may be shifted because of | |
8265 | the borders, scrollbars, other decorations...) | |
8266 | """ | |
54f9ee45 | 8267 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
8268 | |
8269 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 8270 | """ |
a95a7133 | 8271 | GetClientRect(self) -> Rect |
15afbcd0 | 8272 | |
61863841 | 8273 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 8274 | """ |
54f9ee45 | 8275 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
8276 | |
8277 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 8278 | """ |
a95a7133 | 8279 | GetBestSize(self) -> Size |
e811c8ce | 8280 | |
248ed943 | 8281 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8282 | window, if applicable. For example, for a static text control, it will |
8283 | be the minimal size such that the control label is not truncated. For | |
8284 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8285 | this function will be the same as the size the window would have had | |
8286 | after calling Fit. | |
0df68c9f | 8287 | """ |
54f9ee45 | 8288 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
8289 | |
8290 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8291 | """ |
8292 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 8293 | |
248ed943 | 8294 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8295 | window, if applicable. For example, for a static text control, it will |
8296 | be the minimal size such that the control label is not truncated. For | |
8297 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8298 | this function will be the same as the size the window would have had | |
8299 | after calling Fit. | |
0df68c9f | 8300 | """ |
54f9ee45 | 8301 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 8302 | |
dfbb5885 RD |
8303 | def InvalidateBestSize(*args, **kwargs): |
8304 | """ | |
8305 | InvalidateBestSize(self) | |
8306 | ||
8307 | Reset the cached best size value so it will be recalculated the next | |
8308 | time it is needed. | |
8309 | """ | |
8310 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8311 | ||
e2813725 RD |
8312 | def CacheBestSize(*args, **kwargs): |
8313 | """ | |
8314 | CacheBestSize(self, Size size) | |
8315 | ||
8316 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8317 | some properties of the window change.) | |
8318 | """ | |
8319 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8320 | ||
dfbb5885 RD |
8321 | def GetBestFittingSize(*args, **kwargs): |
8322 | """ | |
8323 | GetBestFittingSize(self) -> Size | |
8324 | ||
8325 | This function will merge the window's best size into the window's | |
8326 | minimum size, giving priority to the min size components, and returns | |
8327 | the results. | |
8328 | ||
8329 | """ | |
8330 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
8331 | ||
e811c8ce | 8332 | def GetAdjustedBestSize(*args, **kwargs): |
15afbcd0 | 8333 | """ |
a95a7133 | 8334 | GetAdjustedBestSize(self) -> Size |
15afbcd0 RD |
8335 | |
8336 | This method is similar to GetBestSize, except in one | |
8337 | thing. GetBestSize should return the minimum untruncated size of the | |
8338 | window, while this method will return the largest of BestSize and any | |
8339 | user specified minimum size. ie. it is the minimum size the window | |
8340 | should currently be drawn at, not the minimal size it can possibly | |
8341 | tolerate. | |
8342 | """ | |
54f9ee45 | 8343 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
e811c8ce RD |
8344 | |
8345 | def Center(*args, **kwargs): | |
15afbcd0 | 8346 | """ |
a95a7133 | 8347 | Center(self, int direction=BOTH) |
15afbcd0 RD |
8348 | |
8349 | Centers the window. The parameter specifies the direction for | |
8350 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8351 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8352 | on the entire screen and not on its parent window. If it is a | |
8353 | top-level window and has no parent then it will always be centered | |
8354 | relative to the screen. | |
8355 | """ | |
54f9ee45 | 8356 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
8357 | |
8358 | Centre = Center | |
e811c8ce | 8359 | def CenterOnParent(*args, **kwargs): |
15afbcd0 | 8360 | """ |
a95a7133 | 8361 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
8362 | |
8363 | Center with respect to the the parent window | |
8364 | """ | |
54f9ee45 | 8365 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
8366 | |
8367 | CentreOnParent = CenterOnParent | |
8368 | def Fit(*args, **kwargs): | |
15afbcd0 | 8369 | """ |
a95a7133 | 8370 | Fit(self) |
15afbcd0 RD |
8371 | |
8372 | Sizes the window so that it fits around its subwindows. This function | |
8373 | won't do anything if there are no subwindows and will only really work | |
8374 | correctly if sizers are used for the subwindows layout. Also, if the | |
8375 | window has exactly one subwindow it is better (faster and the result | |
8376 | is more precise as Fit adds some margin to account for fuzziness of | |
8377 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8378 | instead of calling Fit. | |
8379 | """ | |
54f9ee45 | 8380 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
8381 | |
8382 | def FitInside(*args, **kwargs): | |
15afbcd0 | 8383 | """ |
a95a7133 | 8384 | FitInside(self) |
15afbcd0 RD |
8385 | |
8386 | Similar to Fit, but sizes the interior (virtual) size of a | |
8387 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8388 | sizing changes that do not trigger a size event, and/or scrolled | |
8389 | windows without an interior sizer. This function similarly won't do | |
8390 | anything if there are no subwindows. | |
8391 | """ | |
54f9ee45 | 8392 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 8393 | |
f16ab95d | 8394 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 8395 | """ |
a95a7133 | 8396 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 8397 | int incH=-1) |
15afbcd0 RD |
8398 | |
8399 | Allows specification of minimum and maximum window sizes, and window | |
8400 | size increments. If a pair of values is not set (or set to -1), the | |
8401 | default values will be used. If this function is called, the user | |
908b74cd RD |
8402 | will not be able to size the window outside the given bounds (if it is |
8403 | a top-level window.) Sizers will also inspect the minimum window size | |
8404 | and will use that value if set when calculating layout. | |
8405 | ||
8406 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 8407 | """ |
f16ab95d | 8408 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 8409 | |
f16ab95d RD |
8410 | def SetSizeHintsSz(*args, **kwargs): |
8411 | """ | |
8412 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8413 | ||
8414 | Allows specification of minimum and maximum window sizes, and window | |
8415 | size increments. If a pair of values is not set (or set to -1), the | |
8416 | default values will be used. If this function is called, the user | |
8417 | will not be able to size the window outside the given bounds (if it is | |
8418 | a top-level window.) Sizers will also inspect the minimum window size | |
8419 | and will use that value if set when calculating layout. | |
8420 | ||
8421 | The resizing increments are only significant under Motif or Xt. | |
8422 | """ | |
8423 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8424 | ||
8425 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 8426 | """ |
908b74cd | 8427 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
8428 | |
8429 | Allows specification of minimum and maximum virtual window sizes. If a | |
8430 | pair of values is not set (or set to -1), the default values will be | |
8431 | used. If this function is called, the user will not be able to size | |
8432 | the virtual area of the window outside the given bounds. | |
8433 | """ | |
f16ab95d RD |
8434 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8435 | ||
8436 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8437 | """ | |
8438 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8439 | ||
8440 | Allows specification of minimum and maximum virtual window sizes. If a | |
8441 | pair of values is not set (or set to -1), the default values will be | |
8442 | used. If this function is called, the user will not be able to size | |
8443 | the virtual area of the window outside the given bounds. | |
8444 | """ | |
8445 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 8446 | |
908b74cd RD |
8447 | def GetMaxSize(*args, **kwargs): |
8448 | """GetMaxSize(self) -> Size""" | |
8449 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8450 | ||
8451 | def GetMinSize(*args, **kwargs): | |
8452 | """GetMinSize(self) -> Size""" | |
8453 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8454 | ||
8455 | def SetMinSize(*args, **kwargs): | |
8456 | """ | |
8457 | SetMinSize(self, Size minSize) | |
8458 | ||
8459 | A more convenient method than `SetSizeHints` for setting just the | |
8460 | min size. | |
8461 | """ | |
8462 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8463 | ||
8464 | def SetMaxSize(*args, **kwargs): | |
8465 | """ | |
8466 | SetMaxSize(self, Size maxSize) | |
8467 | ||
8468 | A more convenient method than `SetSizeHints` for setting just the | |
8469 | max size. | |
8470 | """ | |
8471 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8472 | ||
e811c8ce | 8473 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8474 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8475 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8476 | |
8477 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8478 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8479 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8480 | |
8481 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8482 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8483 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8484 | |
8485 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8486 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8487 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8488 | |
e811c8ce | 8489 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8490 | """ |
a95a7133 | 8491 | SetVirtualSize(self, Size size) |
e811c8ce | 8492 | |
15afbcd0 RD |
8493 | Set the the virtual size of a window in pixels. For most windows this |
8494 | is just the client area of the window, but for some like scrolled | |
8495 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8496 | """ |
54f9ee45 | 8497 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8498 | |
8499 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8500 | """ |
a95a7133 | 8501 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8502 | |
15afbcd0 RD |
8503 | Set the the virtual size of a window in pixels. For most windows this |
8504 | is just the client area of the window, but for some like scrolled | |
8505 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8506 | """ |
54f9ee45 | 8507 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8508 | |
8509 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8510 | """ |
a95a7133 | 8511 | GetVirtualSize(self) -> Size |
e811c8ce | 8512 | |
15afbcd0 RD |
8513 | Get the the virtual size of the window in pixels. For most windows |
8514 | this is just the client area of the window, but for some like scrolled | |
8515 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8516 | """ |
54f9ee45 | 8517 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8518 | |
8519 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8520 | """ |
8521 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8522 | |
15afbcd0 RD |
8523 | Get the the virtual size of the window in pixels. For most windows |
8524 | this is just the client area of the window, but for some like scrolled | |
8525 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8526 | """ |
54f9ee45 | 8527 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce RD |
8528 | |
8529 | def GetBestVirtualSize(*args, **kwargs): | |
15afbcd0 | 8530 | """ |
a95a7133 | 8531 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8532 | |
8533 | Return the largest of ClientSize and BestSize (as determined by a | |
8534 | sizer, interior children, or other means) | |
8535 | """ | |
54f9ee45 | 8536 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8537 | |
8538 | def Show(*args, **kwargs): | |
15afbcd0 | 8539 | """ |
a95a7133 | 8540 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8541 | |
8542 | Shows or hides the window. You may need to call Raise for a top level | |
8543 | window if you want to bring it to top, although this is not needed if | |
8544 | Show is called immediately after the frame creation. Returns True if | |
8545 | the window has been shown or hidden or False if nothing was done | |
8546 | because it already was in the requested state. | |
8547 | """ | |
54f9ee45 | 8548 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8549 | |
8550 | def Hide(*args, **kwargs): | |
15afbcd0 | 8551 | """ |
a95a7133 | 8552 | Hide(self) -> bool |
15afbcd0 RD |
8553 | |
8554 | Equivalent to calling Show(False). | |
8555 | """ | |
54f9ee45 | 8556 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8557 | |
8558 | def Enable(*args, **kwargs): | |
15afbcd0 | 8559 | """ |
a95a7133 | 8560 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8561 | |
8562 | Enable or disable the window for user input. Note that when a parent | |
8563 | window is disabled, all of its children are disabled as well and they | |
8564 | are reenabled again when the parent is. Returns true if the window | |
8565 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8566 | window had already been in the specified state. | |
8567 | """ | |
54f9ee45 | 8568 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8569 | |
8570 | def Disable(*args, **kwargs): | |
15afbcd0 | 8571 | """ |
a95a7133 | 8572 | Disable(self) -> bool |
15afbcd0 RD |
8573 | |
8574 | Disables the window, same as Enable(false). | |
8575 | """ | |
54f9ee45 | 8576 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8577 | |
8578 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8579 | """ |
a95a7133 | 8580 | IsShown(self) -> bool |
15afbcd0 RD |
8581 | |
8582 | Returns true if the window is shown, false if it has been hidden. | |
8583 | """ | |
54f9ee45 | 8584 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8585 | |
8586 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8587 | """ |
a95a7133 | 8588 | IsEnabled(self) -> bool |
15afbcd0 RD |
8589 | |
8590 | Returns true if the window is enabled for input, false otherwise. | |
8591 | """ | |
54f9ee45 | 8592 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce | 8593 | |
33d6fd3b RD |
8594 | def IsShownOnScreen(*args, **kwargs): |
8595 | """ | |
8596 | IsShownOnScreen(self) -> bool | |
8597 | ||
8598 | Returns ``True`` if the window is physically visible on the screen, | |
8599 | i.e. it is shown and all its parents up to the toplevel window are | |
8600 | shown as well. | |
8601 | """ | |
8602 | return _core_.Window_IsShownOnScreen(*args, **kwargs) | |
8603 | ||
e811c8ce | 8604 | def SetWindowStyleFlag(*args, **kwargs): |
15afbcd0 | 8605 | """ |
a95a7133 | 8606 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 8607 | |
41e2b43e RD |
8608 | Sets the style of the window. Please note that some styles cannot be |
8609 | changed after the window creation and that Refresh() might need to be | |
8610 | called after changing the others for the change to take place | |
8611 | immediately. | |
15afbcd0 | 8612 | """ |
54f9ee45 | 8613 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
8614 | |
8615 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8616 | """ |
a95a7133 | 8617 | GetWindowStyleFlag(self) -> long |
e811c8ce | 8618 | |
15afbcd0 RD |
8619 | Gets the window style that was passed to the constructor or Create |
8620 | method. | |
8621 | """ | |
54f9ee45 | 8622 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 8623 | |
15afbcd0 | 8624 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 8625 | def HasFlag(*args, **kwargs): |
15afbcd0 | 8626 | """ |
a95a7133 | 8627 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
8628 | |
8629 | Test if the given style is set for this window. | |
8630 | """ | |
54f9ee45 | 8631 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
8632 | |
8633 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 8634 | """ |
a95a7133 | 8635 | IsRetained(self) -> bool |
15afbcd0 RD |
8636 | |
8637 | Returns true if the window is retained, false otherwise. Retained | |
8638 | windows are only available on X platforms. | |
8639 | """ | |
54f9ee45 | 8640 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce RD |
8641 | |
8642 | def SetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8643 | """ |
a95a7133 | 8644 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
8645 | |
8646 | Sets the extra style bits for the window. Extra styles are the less | |
8647 | often used style bits which can't be set with the constructor or with | |
8648 | SetWindowStyleFlag() | |
8649 | """ | |
54f9ee45 | 8650 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8651 | |
8652 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8653 | """ |
a95a7133 | 8654 | GetExtraStyle(self) -> long |
15afbcd0 RD |
8655 | |
8656 | Returns the extra style bits for the window. | |
8657 | """ | |
54f9ee45 | 8658 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8659 | |
8660 | def MakeModal(*args, **kwargs): | |
15afbcd0 | 8661 | """ |
a95a7133 | 8662 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
8663 | |
8664 | Disables all other windows in the application so that the user can | |
8665 | only interact with this window. Passing False will reverse this | |
8666 | effect. | |
8667 | """ | |
54f9ee45 | 8668 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
8669 | |
8670 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8671 | """ |
a95a7133 | 8672 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
8673 | |
8674 | This function tells a window if it should use the system's "theme" | |
8675 | code to draw the windows' background instead if its own background | |
8676 | drawing code. This will only have an effect on platforms that support | |
8677 | the notion of themes in user defined windows. One such platform is | |
8678 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8679 | user's selected theme. | |
8680 | ||
8681 | Dialogs, notebook pages and the status bar have this flag set to true | |
8682 | by default so that the default look and feel is simulated best. | |
8683 | """ | |
54f9ee45 | 8684 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8685 | |
8686 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8687 | """ |
a95a7133 | 8688 | GetThemeEnabled(self) -> bool |
e811c8ce | 8689 | |
15afbcd0 RD |
8690 | Return the themeEnabled flag. |
8691 | """ | |
54f9ee45 | 8692 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8693 | |
8694 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 8695 | """ |
a95a7133 | 8696 | SetFocus(self) |
15afbcd0 RD |
8697 | |
8698 | Set's the focus to this window, allowing it to receive keyboard input. | |
8699 | """ | |
54f9ee45 | 8700 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
8701 | |
8702 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 8703 | """ |
a95a7133 | 8704 | SetFocusFromKbd(self) |
15afbcd0 RD |
8705 | |
8706 | Set focus to this window as the result of a keyboard action. Normally | |
8707 | only called internally. | |
8708 | """ | |
54f9ee45 | 8709 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
8710 | |
8711 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 8712 | """ |
66c033b4 | 8713 | FindFocus() -> Window |
15afbcd0 RD |
8714 | |
8715 | Returns the window or control that currently has the keyboard focus, | |
8716 | or None. | |
8717 | """ | |
54f9ee45 | 8718 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
8719 | |
8720 | FindFocus = staticmethod(FindFocus) | |
8721 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 8722 | """ |
a95a7133 | 8723 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
8724 | |
8725 | Can this window have focus? | |
8726 | """ | |
54f9ee45 | 8727 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce RD |
8728 | |
8729 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
15afbcd0 | 8730 | """ |
a95a7133 | 8731 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
8732 | |
8733 | Can this window be given focus by keyboard navigation? if not, the | |
8734 | only way to give it focus (provided it accepts it at all) is to click | |
8735 | it. | |
8736 | """ | |
54f9ee45 | 8737 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce | 8738 | |
908b74cd RD |
8739 | def Navigate(*args, **kwargs): |
8740 | """ | |
8741 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8742 | ||
fd2dc343 RD |
8743 | Does keyboard navigation from this window to another, by sending a |
8744 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8745 | """ |
8746 | return _core_.Window_Navigate(*args, **kwargs) | |
8747 | ||
7f98d120 RD |
8748 | def MoveAfterInTabOrder(*args, **kwargs): |
8749 | """ | |
8750 | MoveAfterInTabOrder(self, Window win) | |
8751 | ||
8752 | Moves this window in the tab navigation order after the specified | |
8753 | sibling window. This means that when the user presses the TAB key on | |
8754 | that other window, the focus switches to this window. | |
8755 | ||
8756 | The default tab order is the same as creation order. This function | |
8757 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8758 | windows. | |
8759 | ||
8760 | """ | |
8761 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8762 | ||
8763 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8764 | """ | |
8765 | MoveBeforeInTabOrder(self, Window win) | |
8766 | ||
8767 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8768 | before win instead of putting it right after it. | |
8769 | """ | |
8770 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8771 | ||
e811c8ce | 8772 | def GetChildren(*args, **kwargs): |
15afbcd0 | 8773 | """ |
a95a7133 | 8774 | GetChildren(self) -> PyObject |
15afbcd0 RD |
8775 | |
8776 | Returns a list of the window's children. NOTE: Currently this is a | |
8777 | copy of the child window list maintained by the window, so the return | |
8778 | value of this function is only valid as long as the window's children | |
8779 | do not change. | |
8780 | """ | |
54f9ee45 | 8781 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
8782 | |
8783 | def GetParent(*args, **kwargs): | |
15afbcd0 | 8784 | """ |
a95a7133 | 8785 | GetParent(self) -> Window |
15afbcd0 RD |
8786 | |
8787 | Returns the parent window of this window, or None if there isn't one. | |
8788 | """ | |
54f9ee45 | 8789 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
8790 | |
8791 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 8792 | """ |
a95a7133 | 8793 | GetGrandParent(self) -> Window |
15afbcd0 | 8794 | |
41e2b43e RD |
8795 | Returns the parent of the parent of this window, or None if there |
8796 | isn't one. | |
15afbcd0 | 8797 | """ |
54f9ee45 | 8798 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce RD |
8799 | |
8800 | def IsTopLevel(*args, **kwargs): | |
15afbcd0 | 8801 | """ |
a95a7133 | 8802 | IsTopLevel(self) -> bool |
15afbcd0 RD |
8803 | |
8804 | Returns true if the given window is a top-level one. Currently all | |
8805 | frames and dialogs are always considered to be top-level windows (even | |
8806 | if they have a parent window). | |
8807 | """ | |
54f9ee45 | 8808 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
8809 | |
8810 | def Reparent(*args, **kwargs): | |
15afbcd0 | 8811 | """ |
a95a7133 | 8812 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
8813 | |
8814 | Reparents the window, i.e the window will be removed from its current | |
8815 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8816 | re-inserted into another. Available on Windows and GTK. Returns True | |
8817 | if the parent was changed, False otherwise (error or newParent == | |
8818 | oldParent) | |
8819 | """ | |
54f9ee45 | 8820 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
8821 | |
8822 | def AddChild(*args, **kwargs): | |
15afbcd0 | 8823 | """ |
a95a7133 | 8824 | AddChild(self, Window child) |
15afbcd0 RD |
8825 | |
8826 | Adds a child window. This is called automatically by window creation | |
8827 | functions so should not be required by the application programmer. | |
8828 | """ | |
54f9ee45 | 8829 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
8830 | |
8831 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 8832 | """ |
a95a7133 | 8833 | RemoveChild(self, Window child) |
15afbcd0 RD |
8834 | |
8835 | Removes a child window. This is called automatically by window | |
8836 | deletion functions so should not be required by the application | |
8837 | programmer. | |
8838 | """ | |
54f9ee45 | 8839 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce | 8840 | |
704eda0c RD |
8841 | def SetDoubleBuffered(*args, **kwargs): |
8842 | """ | |
8843 | SetDoubleBuffered(self, bool on) | |
8844 | ||
8845 | Currently wxGTK2 only. | |
8846 | """ | |
8847 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
8848 | ||
e811c8ce | 8849 | def FindWindowById(*args, **kwargs): |
15afbcd0 | 8850 | """ |
a95a7133 | 8851 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
8852 | |
8853 | Find a chld of this window by window ID | |
8854 | """ | |
54f9ee45 | 8855 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
8856 | |
8857 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 8858 | """ |
a95a7133 | 8859 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
8860 | |
8861 | Find a child of this window by name | |
8862 | """ | |
54f9ee45 | 8863 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
8864 | |
8865 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 8866 | """ |
a95a7133 | 8867 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
8868 | |
8869 | Returns the event handler for this window. By default, the window is | |
8870 | its own event handler. | |
8871 | """ | |
54f9ee45 | 8872 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
8873 | |
8874 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 8875 | """ |
a95a7133 | 8876 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8877 | |
8878 | Sets the event handler for this window. An event handler is an object | |
d49bdf34 RD |
8879 | that is capable of processing the events sent to a window. (In other |
8880 | words, is able to dispatch the events to handler function.) By | |
8881 | default, the window is its own event handler, but an application may | |
8882 | wish to substitute another, for example to allow central | |
8883 | implementation of event-handling for a variety of different window | |
8884 | classes. | |
15afbcd0 | 8885 | |
41e2b43e | 8886 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 | 8887 | up a chain of event handlers, where an event not handled by one event |
d49bdf34 | 8888 | handler is handed off to the next one in the chain. |
15afbcd0 | 8889 | """ |
54f9ee45 | 8890 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
8891 | |
8892 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 8893 | """ |
a95a7133 | 8894 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8895 | |
8896 | Pushes this event handler onto the event handler stack for the window. | |
8897 | An event handler is an object that is capable of processing the events | |
d49bdf34 RD |
8898 | sent to a window. (In other words, is able to dispatch the events to |
8899 | handler function.) By default, the window is its own event handler, | |
8900 | but an application may wish to substitute another, for example to | |
8901 | allow central implementation of event-handling for a variety of | |
8902 | different window classes. | |
15afbcd0 RD |
8903 | |
8904 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8905 | event handlers, where an event not handled by one event handler is | |
d49bdf34 RD |
8906 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` |
8907 | to remove the event handler. Ownership of the handler is *not* given | |
8908 | to the window, so you should be sure to pop the handler before the | |
8909 | window is destroyed and either let PopEventHandler destroy it, or call | |
8910 | its Destroy method yourself. | |
15afbcd0 | 8911 | """ |
54f9ee45 | 8912 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
8913 | |
8914 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 8915 | """ |
a95a7133 | 8916 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
8917 | |
8918 | Removes and returns the top-most event handler on the event handler | |
8919 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
d49bdf34 | 8920 | destroyed after it is popped, and ``None`` will be returned instead. |
15afbcd0 | 8921 | """ |
54f9ee45 | 8922 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
8923 | |
8924 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 8925 | """ |
a95a7133 | 8926 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 8927 | |
41e2b43e | 8928 | Find the given handler in the event handler chain and remove (but not |
d49bdf34 | 8929 | delete) it from the event handler chain, returns True if it was found |
41e2b43e RD |
8930 | and False otherwise (this also results in an assert failure so this |
8931 | function should only be called when the handler is supposed to be | |
8932 | there.) | |
15afbcd0 | 8933 | """ |
54f9ee45 | 8934 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
8935 | |
8936 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 8937 | """ |
a95a7133 | 8938 | SetValidator(self, Validator validator) |
15afbcd0 RD |
8939 | |
8940 | Deletes the current validator (if any) and sets the window validator, | |
8941 | having called wx.Validator.Clone to create a new validator of this | |
8942 | type. | |
8943 | """ | |
54f9ee45 | 8944 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
8945 | |
8946 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 8947 | """ |
a95a7133 | 8948 | GetValidator(self) -> Validator |
15afbcd0 RD |
8949 | |
8950 | Returns a pointer to the current validator for the window, or None if | |
8951 | there is none. | |
8952 | """ | |
54f9ee45 | 8953 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 8954 | |
74a57fcd RD |
8955 | def Validate(*args, **kwargs): |
8956 | """ | |
a95a7133 | 8957 | Validate(self) -> bool |
74a57fcd RD |
8958 | |
8959 | Validates the current values of the child controls using their | |
41e2b43e RD |
8960 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8961 | style flag set, the method will also call Validate() of all child | |
8962 | windows. Returns false if any of the validations failed. | |
74a57fcd | 8963 | """ |
54f9ee45 | 8964 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
8965 | |
8966 | def TransferDataToWindow(*args, **kwargs): | |
8967 | """ | |
a95a7133 | 8968 | TransferDataToWindow(self) -> bool |
74a57fcd | 8969 | |
41e2b43e RD |
8970 | Transfers values to child controls from data areas specified by their |
8971 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8972 | style flag set, the method will also call TransferDataToWindow() of | |
8973 | all child windows. | |
74a57fcd | 8974 | """ |
54f9ee45 | 8975 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
8976 | |
8977 | def TransferDataFromWindow(*args, **kwargs): | |
8978 | """ | |
a95a7133 | 8979 | TransferDataFromWindow(self) -> bool |
74a57fcd | 8980 | |
41e2b43e RD |
8981 | Transfers values from child controls to data areas specified by their |
8982 | validators. Returns false if a transfer failed. If the window has | |
8983 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8984 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 8985 | """ |
54f9ee45 | 8986 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
8987 | |
8988 | def InitDialog(*args, **kwargs): | |
8989 | """ | |
a95a7133 | 8990 | InitDialog(self) |
74a57fcd | 8991 | |
41e2b43e RD |
8992 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8993 | to the dialog via validators. | |
74a57fcd | 8994 | """ |
54f9ee45 | 8995 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 8996 | |
e811c8ce | 8997 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 8998 | """ |
a95a7133 | 8999 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
9000 | |
9001 | Sets the accelerator table for this window. | |
9002 | """ | |
54f9ee45 | 9003 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
9004 | |
9005 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 9006 | """ |
a95a7133 | 9007 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
9008 | |
9009 | Gets the accelerator table for this window. | |
9010 | """ | |
54f9ee45 | 9011 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
9012 | |
9013 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 9014 | """ |
a95a7133 | 9015 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
9016 | |
9017 | Registers a system wide hotkey. Every time the user presses the hotkey | |
9018 | registered here, this window will receive a hotkey event. It will | |
9019 | receive the event even if the application is in the background and | |
9020 | does not have the input focus because the user is working with some | |
9021 | other application. To bind an event handler function to this hotkey | |
9022 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
9023 | hotkey was registered successfully. | |
9024 | """ | |
54f9ee45 | 9025 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
9026 | |
9027 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 9028 | """ |
a95a7133 | 9029 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
9030 | |
9031 | Unregisters a system wide hotkey. | |
9032 | """ | |
54f9ee45 | 9033 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
9034 | |
9035 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 9036 | """ |
a95a7133 | 9037 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
9038 | |
9039 | Converts a point or size from dialog units to pixels. Dialog units | |
9040 | are used for maintaining a dialog's proportions even if the font | |
9041 | changes. For the x dimension, the dialog units are multiplied by the | |
9042 | average character width and then divided by 4. For the y dimension, | |
9043 | the dialog units are multiplied by the average character height and | |
9044 | then divided by 8. | |
9045 | """ | |
54f9ee45 | 9046 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
9047 | |
9048 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 9049 | """ |
a95a7133 | 9050 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
9051 | |
9052 | Converts a point or size from dialog units to pixels. Dialog units | |
9053 | are used for maintaining a dialog's proportions even if the font | |
9054 | changes. For the x dimension, the dialog units are multiplied by the | |
9055 | average character width and then divided by 4. For the y dimension, | |
9056 | the dialog units are multiplied by the average character height and | |
9057 | then divided by 8. | |
9058 | """ | |
54f9ee45 | 9059 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
9060 | |
9061 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 9062 | """ |
a95a7133 | 9063 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
9064 | |
9065 | Converts a point or size from dialog units to pixels. Dialog units | |
9066 | are used for maintaining a dialog's proportions even if the font | |
9067 | changes. For the x dimension, the dialog units are multiplied by the | |
9068 | average character width and then divided by 4. For the y dimension, | |
9069 | the dialog units are multiplied by the average character height and | |
9070 | then divided by 8. | |
9071 | """ | |
54f9ee45 | 9072 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
9073 | |
9074 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 9075 | """ |
a95a7133 | 9076 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
9077 | |
9078 | Converts a point or size from dialog units to pixels. Dialog units | |
9079 | are used for maintaining a dialog's proportions even if the font | |
9080 | changes. For the x dimension, the dialog units are multiplied by the | |
9081 | average character width and then divided by 4. For the y dimension, | |
9082 | the dialog units are multiplied by the average character height and | |
9083 | then divided by 8. | |
9084 | """ | |
54f9ee45 | 9085 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
9086 | |
9087 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 9088 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 9089 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
9090 | |
9091 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 9092 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 9093 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
9094 | |
9095 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 9096 | """ |
a95a7133 | 9097 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
9098 | |
9099 | Moves the pointer to the given position on the window. | |
9100 | ||
9101 | NOTE: This function is not supported under Mac because Apple Human | |
9102 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9103 | """ | |
54f9ee45 | 9104 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
9105 | |
9106 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 9107 | """ |
a95a7133 | 9108 | CaptureMouse(self) |
15afbcd0 RD |
9109 | |
9110 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9111 | release the capture. | |
9112 | ||
9113 | Note that wxWindows maintains the stack of windows having captured the | |
9114 | mouse and when the mouse is released the capture returns to the window | |
9115 | which had had captured it previously and it is only really released if | |
9116 | there were no previous window. In particular, this means that you must | |
34e0a3bb RD |
9117 | release the mouse as many times as you capture it, unless the window |
9118 | receives the `wx.MouseCaptureLostEvent` event. | |
9119 | ||
9120 | Any application which captures the mouse in the beginning of some | |
9121 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
9122 | operation when it receives the event. The event handler must not | |
9123 | recapture mouse. | |
15afbcd0 | 9124 | """ |
54f9ee45 | 9125 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
9126 | |
9127 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 9128 | """ |
a95a7133 | 9129 | ReleaseMouse(self) |
15afbcd0 RD |
9130 | |
9131 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9132 | """ | |
54f9ee45 | 9133 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
9134 | |
9135 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 9136 | """ |
66c033b4 | 9137 | GetCapture() -> Window |
15afbcd0 RD |
9138 | |
9139 | Returns the window which currently captures the mouse or None | |
9140 | """ | |
54f9ee45 | 9141 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
9142 | |
9143 | GetCapture = staticmethod(GetCapture) | |
9144 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 9145 | """ |
a95a7133 | 9146 | HasCapture(self) -> bool |
15afbcd0 RD |
9147 | |
9148 | Returns true if this window has the current mouse capture. | |
9149 | """ | |
54f9ee45 | 9150 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
9151 | |
9152 | def Refresh(*args, **kwargs): | |
15afbcd0 | 9153 | """ |
a95a7133 | 9154 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
9155 | |
9156 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9157 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9158 | to the window. | |
9159 | """ | |
54f9ee45 | 9160 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
9161 | |
9162 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 9163 | """ |
fef4c27a | 9164 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
9165 | |
9166 | Redraws the contents of the given rectangle: the area inside it will | |
9167 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9168 | """ | |
54f9ee45 | 9169 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
9170 | |
9171 | def Update(*args, **kwargs): | |
15afbcd0 | 9172 | """ |
a95a7133 | 9173 | Update(self) |
15afbcd0 RD |
9174 | |
9175 | Calling this method immediately repaints the invalidated area of the | |
9176 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9177 | this would usually only happen when the flow of control returns to the | |
9178 | event loop.) Notice that this function doesn't refresh the window and | |
9179 | does nothing if the window has been already repainted. Use Refresh | |
9180 | first if you want to immediately redraw the window (or some portion of | |
9181 | it) unconditionally. | |
9182 | """ | |
54f9ee45 | 9183 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
9184 | |
9185 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 9186 | """ |
a95a7133 | 9187 | ClearBackground(self) |
15afbcd0 RD |
9188 | |
9189 | Clears the window by filling it with the current background | |
9190 | colour. Does not cause an erase background event to be generated. | |
9191 | """ | |
54f9ee45 | 9192 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
9193 | |
9194 | def Freeze(*args, **kwargs): | |
15afbcd0 | 9195 | """ |
a95a7133 | 9196 | Freeze(self) |
15afbcd0 | 9197 | |
41e2b43e RD |
9198 | Freezes the window or, in other words, prevents any updates from |
9199 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9200 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9201 | nested, with the actual Thaw being delayed until all the nesting has | |
9202 | been undone. | |
15afbcd0 RD |
9203 | |
9204 | This method is useful for visual appearance optimization (for example, | |
9205 | it is a good idea to use it before inserting large amount of text into | |
9206 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9207 | for all controls so it is mostly just a hint to wxWindows and not a | |
9208 | mandatory directive. | |
9209 | """ | |
54f9ee45 | 9210 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce | 9211 | |
33d6fd3b RD |
9212 | def IsFrozen(*args, **kwargs): |
9213 | """ | |
9214 | IsFrozen(self) -> bool | |
9215 | ||
9216 | Returns ``True`` if the window has been frozen and not thawed yet. | |
9217 | ||
9218 | :see: `Freeze` and `Thaw` | |
9219 | """ | |
9220 | return _core_.Window_IsFrozen(*args, **kwargs) | |
9221 | ||
e811c8ce | 9222 | def Thaw(*args, **kwargs): |
15afbcd0 | 9223 | """ |
a95a7133 | 9224 | Thaw(self) |
15afbcd0 | 9225 | |
4276dc52 | 9226 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
9227 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9228 | times that Freeze was before the window will be updated. | |
15afbcd0 | 9229 | """ |
54f9ee45 | 9230 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
9231 | |
9232 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 9233 | """ |
a95a7133 | 9234 | PrepareDC(self, DC dc) |
15afbcd0 RD |
9235 | |
9236 | Call this function to prepare the device context for drawing a | |
9237 | scrolled image. It sets the device origin according to the current | |
9238 | scroll position. | |
9239 | """ | |
54f9ee45 | 9240 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce RD |
9241 | |
9242 | def GetUpdateRegion(*args, **kwargs): | |
15afbcd0 | 9243 | """ |
a95a7133 | 9244 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
9245 | |
9246 | Returns the region specifying which parts of the window have been | |
9247 | damaged. Should only be called within an EVT_PAINT handler. | |
9248 | """ | |
54f9ee45 | 9249 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
9250 | |
9251 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 9252 | """ |
a95a7133 | 9253 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
9254 | |
9255 | Get the update rectangle region bounding box in client coords. | |
9256 | """ | |
54f9ee45 | 9257 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
9258 | |
9259 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 9260 | """ |
a95a7133 | 9261 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
9262 | |
9263 | Returns true if the given point or rectangle area has been exposed | |
9264 | since the last repaint. Call this in an paint event handler to | |
9265 | optimize redrawing by only redrawing those areas, which have been | |
9266 | exposed. | |
9267 | """ | |
54f9ee45 | 9268 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
9269 | |
9270 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 9271 | """ |
a95a7133 | 9272 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
9273 | |
9274 | Returns true if the given point or rectangle area has been exposed | |
9275 | since the last repaint. Call this in an paint event handler to | |
9276 | optimize redrawing by only redrawing those areas, which have been | |
9277 | exposed. | |
9278 | """ | |
54f9ee45 | 9279 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 9280 | |
4276dc52 | 9281 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 9282 | """ |
a95a7133 | 9283 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
9284 | |
9285 | Returns true if the given point or rectangle area has been exposed | |
9286 | since the last repaint. Call this in an paint event handler to | |
9287 | optimize redrawing by only redrawing those areas, which have been | |
9288 | exposed. | |
9289 | """ | |
54f9ee45 | 9290 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 9291 | |
74a57fcd RD |
9292 | def GetDefaultAttributes(*args, **kwargs): |
9293 | """ | |
a95a7133 | 9294 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 9295 | |
41e2b43e RD |
9296 | Get the default attributes for an instance of this class. This is |
9297 | useful if you want to use the same font or colour in your own control | |
9298 | as in a standard control -- which is a much better idea than hard | |
9299 | coding specific colours or fonts which might look completely out of | |
db3e571a | 9300 | place on the user's system, especially if it uses themes. |
74a57fcd | 9301 | """ |
54f9ee45 | 9302 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9303 | |
9304 | def GetClassDefaultAttributes(*args, **kwargs): | |
9305 | """ | |
66c033b4 | 9306 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 9307 | |
41e2b43e RD |
9308 | Get the default attributes for this class. This is useful if you want |
9309 | to use the same font or colour in your own control as in a standard | |
9310 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9311 | colours or fonts which might look completely out of place on the |
9312 | user's system, especially if it uses themes. | |
74a57fcd RD |
9313 | |
9314 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9315 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9316 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9317 | this. | |
74a57fcd | 9318 | """ |
54f9ee45 | 9319 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9320 | |
9321 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 9322 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9323 | """ |
a95a7133 | 9324 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9325 | |
9326 | Sets the background colour of the window. Returns True if the colour | |
9327 | was changed. The background colour is usually painted by the default | |
9328 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9329 | automatically under GTK. Using `wx.NullColour` will reset the window |
9330 | to the default background colour. | |
15afbcd0 | 9331 | |
db3e571a | 9332 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9333 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
9334 | calling this function. |
9335 | ||
f8167d6e RD |
9336 | Using this function will disable attempts to use themes for this |
9337 | window, if the system supports them. Use with care since usually the | |
9338 | themes represent the appearance chosen by the user to be used for all | |
9339 | applications on the system. | |
15afbcd0 | 9340 | """ |
54f9ee45 | 9341 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 9342 | |
412d302d RD |
9343 | def SetOwnBackgroundColour(*args, **kwargs): |
9344 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9345 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 9346 | |
e811c8ce | 9347 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 9348 | """ |
a95a7133 | 9349 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9350 | |
9351 | Sets the foreground colour of the window. Returns True is the colour | |
9352 | was changed. The interpretation of foreground colour is dependent on | |
9353 | the window class; it may be the text colour or other colour, or it may | |
9354 | not be used at all. | |
9355 | """ | |
54f9ee45 | 9356 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 9357 | |
fa47d7a7 VS |
9358 | def SetOwnForegroundColour(*args, **kwargs): |
9359 | """SetOwnForegroundColour(self, Colour colour)""" | |
9360 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 9361 | |
e811c8ce | 9362 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9363 | """ |
a95a7133 | 9364 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
9365 | |
9366 | Returns the background colour of the window. | |
9367 | """ | |
54f9ee45 | 9368 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
9369 | |
9370 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 9371 | """ |
a95a7133 | 9372 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
9373 | |
9374 | Returns the foreground colour of the window. The interpretation of | |
9375 | foreground colour is dependent on the window class; it may be the text | |
9376 | colour or other colour, or it may not be used at all. | |
9377 | """ | |
54f9ee45 | 9378 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 9379 | |
562ecc31 RD |
9380 | def InheritsBackgroundColour(*args, **kwargs): |
9381 | """InheritsBackgroundColour(self) -> bool""" | |
9382 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9383 | ||
9384 | def UseBgCol(*args, **kwargs): | |
9385 | """UseBgCol(self) -> bool""" | |
9386 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9387 | ||
7bc1e663 RD |
9388 | def SetBackgroundStyle(*args, **kwargs): |
9389 | """ | |
9390 | SetBackgroundStyle(self, int style) -> bool | |
9391 | ||
9392 | Returns the background style of the window. The background style | |
9393 | indicates how the background of the window is drawn. | |
9394 | ||
9395 | ====================== ======================================== | |
9396 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9397 | be determined by the system | |
9398 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9399 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9400 | application. | |
9401 | ====================== ======================================== | |
9402 | ||
9403 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9404 | a custom background, such as a tiled bitmap. Currently the style has | |
9405 | no effect on other platforms. | |
9406 | ||
9407 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9408 | """ | |
9409 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9410 | ||
9411 | def GetBackgroundStyle(*args, **kwargs): | |
9412 | """ | |
9413 | GetBackgroundStyle(self) -> int | |
9414 | ||
9415 | Returns the background style of the window. | |
9416 | ||
9417 | :see: `SetBackgroundStyle` | |
9418 | """ | |
9419 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9420 | ||
51b83b37 RD |
9421 | def HasTransparentBackground(*args, **kwargs): |
9422 | """ | |
9423 | HasTransparentBackground(self) -> bool | |
9424 | ||
9425 | Returns True if this window's background is transparent (as, for | |
9426 | example, for `wx.StaticText`) and should show the parent window's | |
9427 | background. | |
9428 | ||
9429 | This method is mostly used internally by the library itself and you | |
9430 | normally shouldn't have to call it. You may, however, have to override | |
9431 | it in your custom control classes to ensure that background is painted | |
9432 | correctly. | |
9433 | """ | |
9434 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9435 | ||
e811c8ce | 9436 | def SetCursor(*args, **kwargs): |
15afbcd0 | 9437 | """ |
a95a7133 | 9438 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
9439 | |
9440 | Sets the window's cursor. Notice that the window cursor also sets it | |
9441 | for the children of the window implicitly. | |
9442 | ||
9443 | The cursor may be wx.NullCursor in which case the window cursor will | |
9444 | be reset back to default. | |
9445 | """ | |
54f9ee45 | 9446 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
9447 | |
9448 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 9449 | """ |
a95a7133 | 9450 | GetCursor(self) -> Cursor |
15afbcd0 RD |
9451 | |
9452 | Return the cursor associated with this window. | |
9453 | """ | |
54f9ee45 | 9454 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
9455 | |
9456 | def SetFont(*args, **kwargs): | |
15afbcd0 | 9457 | """ |
a95a7133 | 9458 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
9459 | |
9460 | Sets the font for this window. | |
9461 | """ | |
54f9ee45 | 9462 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 9463 | |
fa47d7a7 VS |
9464 | def SetOwnFont(*args, **kwargs): |
9465 | """SetOwnFont(self, Font font)""" | |
9466 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9467 | |
e811c8ce | 9468 | def GetFont(*args, **kwargs): |
15afbcd0 | 9469 | """ |
a95a7133 | 9470 | GetFont(self) -> Font |
15afbcd0 | 9471 | |
4276dc52 | 9472 | Returns the default font used for this window. |
15afbcd0 | 9473 | """ |
54f9ee45 | 9474 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9475 | |
9476 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9477 | """ |
a95a7133 | 9478 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9479 | |
9480 | Sets the caret associated with the window. | |
9481 | """ | |
54f9ee45 | 9482 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9483 | |
9484 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9485 | """ |
a95a7133 | 9486 | GetCaret(self) -> Caret |
15afbcd0 RD |
9487 | |
9488 | Returns the caret associated with the window. | |
9489 | """ | |
54f9ee45 | 9490 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9491 | |
9492 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9493 | """ |
a95a7133 | 9494 | GetCharHeight(self) -> int |
15afbcd0 RD |
9495 | |
9496 | Get the (average) character size for the current font. | |
9497 | """ | |
54f9ee45 | 9498 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9499 | |
9500 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9501 | """ |
a95a7133 | 9502 | GetCharWidth(self) -> int |
15afbcd0 RD |
9503 | |
9504 | Get the (average) character size for the current font. | |
9505 | """ | |
54f9ee45 | 9506 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9507 | |
9508 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9509 | """ |
9510 | GetTextExtent(String string) -> (width, height) | |
9511 | ||
9512 | Get the width and height of the text using the current font. | |
9513 | """ | |
54f9ee45 | 9514 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9515 | |
9516 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9517 | """ |
196addbf | 9518 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9519 | (width, height, descent, externalLeading) |
e811c8ce | 9520 | |
15afbcd0 RD |
9521 | Get the width, height, decent and leading of the text using the |
9522 | current or specified font. | |
0df68c9f | 9523 | """ |
54f9ee45 | 9524 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
9525 | |
9526 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
9527 | """ |
9528 | ClientToScreenXY(int x, int y) -> (x,y) | |
9529 | ||
9530 | Converts to screen coordinates from coordinates relative to this window. | |
9531 | """ | |
54f9ee45 | 9532 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
9533 | |
9534 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
9535 | """ |
9536 | ScreenToClientXY(int x, int y) -> (x,y) | |
9537 | ||
9538 | Converts from screen to client window coordinates. | |
9539 | """ | |
54f9ee45 | 9540 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
9541 | |
9542 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 9543 | """ |
a95a7133 | 9544 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
9545 | |
9546 | Converts to screen coordinates from coordinates relative to this window. | |
9547 | """ | |
54f9ee45 | 9548 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
9549 | |
9550 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 9551 | """ |
a95a7133 | 9552 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
9553 | |
9554 | Converts from screen to client window coordinates. | |
9555 | """ | |
54f9ee45 | 9556 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
9557 | |
9558 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 9559 | """ |
a95a7133 | 9560 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
9561 | |
9562 | Test where the given (in client coords) point lies | |
9563 | """ | |
54f9ee45 | 9564 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
9565 | |
9566 | def HitTest(*args, **kwargs): | |
15afbcd0 | 9567 | """ |
a95a7133 | 9568 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
9569 | |
9570 | Test where the given (in client coords) point lies | |
9571 | """ | |
54f9ee45 | 9572 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 9573 | |
15afbcd0 RD |
9574 | def GetBorder(*args): |
9575 | """ | |
a95a7133 RD |
9576 | GetBorder(self, long flags) -> int |
9577 | GetBorder(self) -> int | |
e811c8ce | 9578 | |
15afbcd0 RD |
9579 | Get border for the flags of this window |
9580 | """ | |
54f9ee45 | 9581 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
9582 | |
9583 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 9584 | """ |
a95a7133 | 9585 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
9586 | |
9587 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9588 | implementation depends on the window; for example a wx.ToolBar will | |
9589 | send an update UI event for each toolbar button, and a wx.Frame will | |
9590 | send an update UI event for each menubar menu item. You can call this | |
9591 | function from your application to ensure that your UI is up-to-date at | |
9592 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9593 | concerned). This may be necessary if you have called | |
5ba5649b | 9594 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
9595 | limit the overhead that wxWindows incurs by sending update UI events |
9596 | in idle time. | |
15afbcd0 | 9597 | """ |
54f9ee45 | 9598 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
9599 | |
9600 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 9601 | """ |
b0503257 | 9602 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 9603 | |
b0503257 RD |
9604 | Pops up the given menu at the specified coordinates, relative to this window, |
9605 | and returns control when the user has dismissed the menu. If a menu item is | |
9606 | selected, the corresponding menu event is generated and will be processed as | |
9607 | usual. If the default position is given then the current position of the | |
9608 | mouse cursor will be used. | |
15afbcd0 | 9609 | """ |
54f9ee45 | 9610 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 9611 | |
15afbcd0 RD |
9612 | def PopupMenu(*args, **kwargs): |
9613 | """ | |
b0503257 | 9614 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 9615 | |
b0503257 RD |
9616 | Pops up the given menu at the specified coordinates, relative to this window, |
9617 | and returns control when the user has dismissed the menu. If a menu item is | |
9618 | selected, the corresponding menu event is generated and will be processed as | |
9619 | usual. If the default position is given then the current position of the | |
9620 | mouse cursor will be used. | |
15afbcd0 | 9621 | """ |
54f9ee45 | 9622 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 | 9623 | |
10044bf1 RD |
9624 | def HasMultiplePages(*args, **kwargs): |
9625 | """HasMultiplePages(self) -> bool""" | |
9626 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
9627 | ||
15afbcd0 RD |
9628 | def GetHandle(*args, **kwargs): |
9629 | """ | |
a95a7133 | 9630 | GetHandle(self) -> long |
15afbcd0 RD |
9631 | |
9632 | Returns the platform-specific handle (as a long integer) of the | |
9633 | physical window. Currently on wxMac it returns the handle of the | |
9634 | toplevel parent of the window. | |
9635 | """ | |
54f9ee45 | 9636 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 9637 | |
7e63a440 RD |
9638 | def AssociateHandle(*args, **kwargs): |
9639 | """ | |
9640 | AssociateHandle(self, long handle) | |
9641 | ||
9642 | Associate the window with a new native handle | |
9643 | """ | |
9644 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9645 | ||
9646 | def DissociateHandle(*args, **kwargs): | |
9647 | """ | |
9648 | DissociateHandle(self) | |
9649 | ||
9650 | Dissociate the current native handle from the window | |
9651 | """ | |
9652 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9653 | ||
15afbcd0 RD |
9654 | def HasScrollbar(*args, **kwargs): |
9655 | """ | |
a95a7133 | 9656 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
9657 | |
9658 | Does the window have the scrollbar for this orientation? | |
9659 | """ | |
54f9ee45 | 9660 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
9661 | |
9662 | def SetScrollbar(*args, **kwargs): | |
9663 | """ | |
41e2b43e | 9664 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
9665 | bool refresh=True) |
9666 | ||
9667 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 9668 | """ |
54f9ee45 | 9669 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
9670 | |
9671 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 9672 | """ |
a95a7133 | 9673 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
9674 | |
9675 | Sets the position of one of the built-in scrollbars. | |
9676 | """ | |
54f9ee45 | 9677 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
9678 | |
9679 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 9680 | """ |
a95a7133 | 9681 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
9682 | |
9683 | Returns the built-in scrollbar position. | |
9684 | """ | |
54f9ee45 | 9685 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
9686 | |
9687 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 9688 | """ |
a95a7133 | 9689 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
9690 | |
9691 | Returns the built-in scrollbar thumb size. | |
9692 | """ | |
54f9ee45 | 9693 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
9694 | |
9695 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 9696 | """ |
a95a7133 | 9697 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
9698 | |
9699 | Returns the built-in scrollbar range. | |
9700 | """ | |
54f9ee45 | 9701 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
9702 | |
9703 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 9704 | """ |
a95a7133 | 9705 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
9706 | |
9707 | Physically scrolls the pixels in the window and move child windows | |
9708 | accordingly. Use this function to optimise your scrolling | |
9709 | implementations, to minimise the area that must be redrawn. Note that | |
9710 | it is rarely required to call this function from a user program. | |
15afbcd0 | 9711 | """ |
54f9ee45 | 9712 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
9713 | |
9714 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 9715 | """ |
a95a7133 | 9716 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
9717 | |
9718 | If the platform and window class supports it, scrolls the window by | |
9719 | the given number of lines down, if lines is positive, or up if lines | |
9720 | is negative. Returns True if the window was scrolled, False if it was | |
9721 | already on top/bottom and nothing was done. | |
9722 | """ | |
54f9ee45 | 9723 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
9724 | |
9725 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 9726 | """ |
a95a7133 | 9727 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 9728 | |
41e2b43e | 9729 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
9730 | the given number of pages down, if pages is positive, or up if pages |
9731 | is negative. Returns True if the window was scrolled, False if it was | |
9732 | already on top/bottom and nothing was done. | |
9733 | """ | |
54f9ee45 | 9734 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
9735 | |
9736 | def LineUp(*args, **kwargs): | |
15afbcd0 | 9737 | """ |
a95a7133 | 9738 | LineUp(self) -> bool |
15afbcd0 RD |
9739 | |
9740 | This is just a wrapper for ScrollLines(-1). | |
9741 | """ | |
54f9ee45 | 9742 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
9743 | |
9744 | def LineDown(*args, **kwargs): | |
15afbcd0 | 9745 | """ |
a95a7133 | 9746 | LineDown(self) -> bool |
15afbcd0 RD |
9747 | |
9748 | This is just a wrapper for ScrollLines(1). | |
9749 | """ | |
54f9ee45 | 9750 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
9751 | |
9752 | def PageUp(*args, **kwargs): | |
15afbcd0 | 9753 | """ |
a95a7133 | 9754 | PageUp(self) -> bool |
15afbcd0 RD |
9755 | |
9756 | This is just a wrapper for ScrollPages(-1). | |
9757 | """ | |
54f9ee45 | 9758 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
9759 | |
9760 | def PageDown(*args, **kwargs): | |
15afbcd0 | 9761 | """ |
a95a7133 | 9762 | PageDown(self) -> bool |
15afbcd0 RD |
9763 | |
9764 | This is just a wrapper for ScrollPages(1). | |
9765 | """ | |
54f9ee45 | 9766 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
9767 | |
9768 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 9769 | """ |
a95a7133 | 9770 | SetHelpText(self, String text) |
15afbcd0 RD |
9771 | |
9772 | Sets the help text to be used as context-sensitive help for this | |
9773 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9774 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9775 | """ |
54f9ee45 | 9776 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
9777 | |
9778 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 9779 | """ |
a95a7133 | 9780 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
9781 | |
9782 | Associate this help text with all windows with the same id as this | |
9783 | one. | |
9784 | """ | |
54f9ee45 | 9785 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce | 9786 | |
b850e7f3 RD |
9787 | def GetHelpTextAtPoint(*args, **kwargs): |
9788 | """ | |
9789 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
9790 | ||
9791 | Get the help string associated with the given position in this window. | |
9792 | ||
9793 | Notice that pt may be invalid if event origin is keyboard or unknown | |
9794 | and this method should return the global window help text then | |
9795 | ||
9796 | """ | |
9797 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
9798 | ||
e811c8ce | 9799 | def GetHelpText(*args, **kwargs): |
15afbcd0 | 9800 | """ |
a95a7133 | 9801 | GetHelpText(self) -> String |
15afbcd0 RD |
9802 | |
9803 | Gets the help text to be used as context-sensitive help for this | |
9804 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9805 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9806 | """ |
54f9ee45 | 9807 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
9808 | |
9809 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 9810 | """ |
a95a7133 | 9811 | SetToolTipString(self, String tip) |
15afbcd0 RD |
9812 | |
9813 | Attach a tooltip to the window. | |
9814 | """ | |
54f9ee45 | 9815 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
9816 | |
9817 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 9818 | """ |
a95a7133 | 9819 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
9820 | |
9821 | Attach a tooltip to the window. | |
9822 | """ | |
54f9ee45 | 9823 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
9824 | |
9825 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 9826 | """ |
a95a7133 | 9827 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
9828 | |
9829 | get the associated tooltip or None if none | |
9830 | """ | |
54f9ee45 | 9831 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
9832 | |
9833 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 9834 | """ |
a95a7133 | 9835 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
9836 | |
9837 | Associates a drop target with this window. If the window already has | |
9838 | a drop target, it is deleted. | |
9839 | """ | |
54f9ee45 | 9840 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
9841 | |
9842 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 9843 | """ |
a95a7133 | 9844 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
9845 | |
9846 | Returns the associated drop target, which may be None. | |
9847 | """ | |
54f9ee45 | 9848 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 9849 | |
5ba5649b RD |
9850 | def DragAcceptFiles(*args, **kwargs): |
9851 | """ | |
9852 | DragAcceptFiles(self, bool accept) | |
9853 | ||
9854 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9855 | Only functional on Windows. | |
9856 | """ | |
9857 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9858 | ||
e811c8ce | 9859 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 9860 | """ |
a95a7133 | 9861 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
9862 | |
9863 | Sets the window to have the given layout constraints. If an existing | |
9864 | layout constraints object is already owned by the window, it will be | |
9865 | deleted. Pass None to disassociate and delete the window's current | |
9866 | constraints. | |
9867 | ||
9868 | You must call SetAutoLayout to tell a window to use the constraints | |
9869 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9870 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9871 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9872 | effect. | |
9873 | """ | |
54f9ee45 | 9874 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
9875 | |
9876 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 9877 | """ |
a95a7133 | 9878 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
9879 | |
9880 | Returns a pointer to the window's layout constraints, or None if there | |
9881 | are none. | |
9882 | """ | |
54f9ee45 | 9883 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
9884 | |
9885 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9886 | """ |
a95a7133 | 9887 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
9888 | |
9889 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
9890 | when the window is resized. lease note that this only happens for the |
9891 | windows usually used to contain children, namely `wx.Panel` and | |
9892 | `wx.TopLevelWindow` (and the classes deriving from them). | |
9893 | ||
9894 | This method is called implicitly by `SetSizer` but if you use | |
9895 | `SetConstraints` you should call it manually or otherwise the window | |
9896 | layout won't be correctly updated when its size changes. | |
15afbcd0 | 9897 | """ |
54f9ee45 | 9898 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9899 | |
9900 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9901 | """ |
a95a7133 | 9902 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
9903 | |
9904 | Returns the current autoLayout setting | |
9905 | """ | |
54f9ee45 | 9906 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9907 | |
9908 | def Layout(*args, **kwargs): | |
15afbcd0 | 9909 | """ |
a95a7133 | 9910 | Layout(self) -> bool |
15afbcd0 RD |
9911 | |
9912 | Invokes the constraint-based layout algorithm or the sizer-based | |
9913 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9914 | this function gets called automatically by the default EVT_SIZE | |
9915 | handler when the window is resized. | |
9916 | """ | |
54f9ee45 | 9917 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
9918 | |
9919 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 9920 | """ |
a95a7133 | 9921 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9922 | |
9923 | Sets the window to have the given layout sizer. The window will then | |
9924 | own the object, and will take care of its deletion. If an existing | |
9925 | layout sizer object is already owned by the window, it will be deleted | |
9926 | if the deleteOld parameter is true. Note that this function will also | |
9927 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 9928 | non-None, and False otherwise. |
15afbcd0 | 9929 | """ |
54f9ee45 | 9930 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
9931 | |
9932 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 9933 | """ |
a95a7133 | 9934 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9935 | |
9936 | The same as SetSizer, except it also sets the size hints for the | |
9937 | window based on the sizer's minimum size. | |
9938 | """ | |
54f9ee45 | 9939 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
9940 | |
9941 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 9942 | """ |
a95a7133 | 9943 | GetSizer(self) -> Sizer |
15afbcd0 RD |
9944 | |
9945 | Return the sizer associated with the window by a previous call to | |
9946 | SetSizer or None if there isn't one. | |
9947 | """ | |
54f9ee45 | 9948 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
9949 | |
9950 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9951 | """ |
a95a7133 | 9952 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
9953 | |
9954 | This normally does not need to be called by application code. It is | |
9955 | called internally when a window is added to a sizer, and is used so | |
9956 | the window can remove itself from the sizer when it is destroyed. | |
9957 | """ | |
54f9ee45 | 9958 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
9959 | |
9960 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9961 | """ |
a95a7133 | 9962 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
9963 | |
9964 | Return the sizer that this window is a member of, if any, otherwise None. | |
9965 | """ | |
54f9ee45 | 9966 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 9967 | |
a95a7133 RD |
9968 | def InheritAttributes(*args, **kwargs): |
9969 | """ | |
9970 | InheritAttributes(self) | |
9971 | ||
41e2b43e RD |
9972 | This function is (or should be, in case of custom controls) called |
9973 | during window creation to intelligently set up the window visual | |
9974 | attributes, that is the font and the foreground and background | |
9975 | colours. | |
9976 | ||
9977 | By 'intelligently' the following is meant: by default, all windows use | |
9978 | their own default attributes. However if some of the parent's | |
9979 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9980 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
9981 | explicitly set for this window itself, then this window takes the same |
9982 | value as used by the parent. In addition, if the window overrides | |
9983 | ShouldInheritColours to return false, the colours will not be changed | |
9984 | no matter what and only the font might. | |
9985 | ||
34621cc5 | 9986 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 9987 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
9988 | attributes are used and in this case, nothing should be inherited as |
9989 | in modern GUIs different controls use different fonts (and colours) | |
9990 | than their siblings so they can't inherit the same value from the | |
9991 | parent. However it was also deemed desirable to allow to simply change | |
9992 | the attributes of all children at once by just changing the font or | |
9993 | colour of their common parent, hence in this case we do inherit the | |
9994 | parents attributes. | |
9995 | ||
a95a7133 | 9996 | """ |
54f9ee45 | 9997 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
9998 | |
9999 | def ShouldInheritColours(*args, **kwargs): | |
10000 | """ | |
10001 | ShouldInheritColours(self) -> bool | |
10002 | ||
10003 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
10004 | changed by InheritAttributes, returning false forbids inheriting them |
10005 | from the parent window. | |
a95a7133 | 10006 | |
41e2b43e RD |
10007 | The base class version returns false, but this method is overridden in |
10008 | wxControl where it returns true. | |
a95a7133 | 10009 | """ |
54f9ee45 | 10010 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 10011 | |
fc46b7f3 RD |
10012 | def CanSetTransparent(*args, **kwargs): |
10013 | """ | |
10014 | CanSetTransparent(self) -> bool | |
10015 | ||
10016 | Returns ``True`` if the platform supports setting the transparency for | |
10017 | this window. Note that this method will err on the side of caution, | |
10018 | so it is possible that this will return ``False`` when it is in fact | |
10019 | possible to set the transparency. | |
10020 | ||
10021 | NOTE: On X-windows systems the X server must have the composite | |
10022 | extension loaded, and there must be a composite manager program (such | |
10023 | as xcompmgr) running. | |
10024 | """ | |
10025 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
10026 | ||
10027 | def SetTransparent(*args, **kwargs): | |
10028 | """ | |
10029 | SetTransparent(self, byte alpha) -> bool | |
10030 | ||
10031 | Attempt to set the transparency of this window to the ``alpha`` value, | |
10032 | returns True on success. The ``alpha`` value is an integer in the | |
10033 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
10034 | opaque. | |
10035 | """ | |
10036 | return _core_.Window_SetTransparent(*args, **kwargs) | |
10037 | ||
e811c8ce | 10038 | def PostCreate(self, pre): |
15afbcd0 RD |
10039 | """ |
10040 | Phase 3 of the 2-phase create <wink!> | |
10041 | Call this method after precreating the window with the 2-phase create method. | |
10042 | """ | |
e811c8ce RD |
10043 | self.this = pre.this |
10044 | self.thisown = pre.thisown | |
10045 | pre.thisown = 0 | |
10046 | if hasattr(self, '_setOORInfo'): | |
10047 | self._setOORInfo(self) | |
10048 | if hasattr(self, '_setCallbackInfo'): | |
10049 | self._setCallbackInfo(self, self.__class__) | |
10050 | ||
7e08d4ef | 10051 | def SendSizeEvent(self): |
453fb36b | 10052 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) |
7e08d4ef | 10053 | |
2bf58437 RD |
10054 | AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") |
10055 | AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`") | |
10056 | AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") | |
10057 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
10058 | BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") | |
10059 | BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`") | |
10060 | BestSize = property(GetBestSize,doc="See `GetBestSize`") | |
10061 | BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`") | |
10062 | Border = property(GetBorder,doc="See `GetBorder`") | |
10063 | Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`") | |
10064 | CharHeight = property(GetCharHeight,doc="See `GetCharHeight`") | |
10065 | CharWidth = property(GetCharWidth,doc="See `GetCharWidth`") | |
10066 | Children = property(GetChildren,doc="See `GetChildren`") | |
10067 | ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`") | |
10068 | ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`") | |
10069 | ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`") | |
10070 | Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`") | |
10071 | ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`") | |
10072 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
10073 | DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`") | |
10074 | DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`") | |
10075 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
10076 | ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`") | |
10077 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
10078 | ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`") | |
2bf58437 RD |
10079 | GrandParent = property(GetGrandParent,doc="See `GetGrandParent`") |
10080 | Handle = property(GetHandle,doc="See `GetHandle`") | |
10081 | HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`") | |
2bf58437 RD |
10082 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") |
10083 | Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`") | |
994453b8 | 10084 | LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`") |
2bf58437 RD |
10085 | MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`") |
10086 | MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`") | |
10087 | MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`") | |
10088 | MinHeight = property(GetMinHeight,doc="See `GetMinHeight`") | |
10089 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
10090 | MinWidth = property(GetMinWidth,doc="See `GetMinWidth`") | |
10091 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
10092 | Parent = property(GetParent,doc="See `GetParent`") | |
10093 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
10094 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
10095 | ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`") | |
10096 | ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`") | |
2bf58437 RD |
10097 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") |
10098 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
2bf58437 RD |
10099 | ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`") |
10100 | ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`") | |
10101 | UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`") | |
10102 | UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`") | |
10103 | Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`") | |
10104 | VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`") | |
10105 | WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`") | |
10106 | WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`") | |
10107 | WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`") | |
97ab0f6a RD |
10108 | Shown = property(IsShown,Show,doc="See `IsShown` and `Show`") |
10109 | Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`") | |
10110 | TopLevel = property(IsTopLevel,doc="See `IsTopLevel`") | |
2131d850 | 10111 | _core_.Window_swigregister(Window) |
e811c8ce RD |
10112 | |
10113 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
10114 | """ |
10115 | PreWindow() -> Window | |
10116 | ||
10117 | Precreate a Window for 2-phase creation. | |
10118 | """ | |
54f9ee45 | 10119 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
10120 | return val |
10121 | ||
0085ce49 RD |
10122 | def Window_NewControlId(*args): |
10123 | """ | |
15afbcd0 RD |
10124 | Window_NewControlId() -> int |
10125 | ||
10126 | Generate a control id for the controls which were not given one. | |
10127 | """ | |
0085ce49 | 10128 | return _core_.Window_NewControlId(*args) |
e811c8ce RD |
10129 | |
10130 | def Window_NextControlId(*args, **kwargs): | |
0085ce49 | 10131 | """ |
15afbcd0 RD |
10132 | Window_NextControlId(int winid) -> int |
10133 | ||
10134 | Get the id of the control following the one with the given | |
41e2b43e | 10135 | autogenerated) id |
15afbcd0 | 10136 | """ |
0085ce49 | 10137 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
10138 | |
10139 | def Window_PrevControlId(*args, **kwargs): | |
0085ce49 | 10140 | """ |
15afbcd0 RD |
10141 | Window_PrevControlId(int winid) -> int |
10142 | ||
10143 | Get the id of the control preceding the one with the given | |
41e2b43e | 10144 | autogenerated) id |
15afbcd0 | 10145 | """ |
0085ce49 | 10146 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce | 10147 | |
0085ce49 RD |
10148 | def Window_FindFocus(*args): |
10149 | """ | |
15afbcd0 RD |
10150 | Window_FindFocus() -> Window |
10151 | ||
10152 | Returns the window or control that currently has the keyboard focus, | |
10153 | or None. | |
10154 | """ | |
0085ce49 | 10155 | return _core_.Window_FindFocus(*args) |
e811c8ce | 10156 | |
0085ce49 RD |
10157 | def Window_GetCapture(*args): |
10158 | """ | |
15afbcd0 RD |
10159 | Window_GetCapture() -> Window |
10160 | ||
10161 | Returns the window which currently captures the mouse or None | |
10162 | """ | |
0085ce49 | 10163 | return _core_.Window_GetCapture(*args) |
e811c8ce | 10164 | |
74a57fcd | 10165 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10166 | """ |
74a57fcd RD |
10167 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10168 | ||
41e2b43e RD |
10169 | Get the default attributes for this class. This is useful if you want |
10170 | to use the same font or colour in your own control as in a standard | |
10171 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
10172 | colours or fonts which might look completely out of place on the |
10173 | user's system, especially if it uses themes. | |
74a57fcd RD |
10174 | |
10175 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 10176 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
10177 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10178 | this. | |
74a57fcd | 10179 | """ |
0085ce49 | 10180 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10181 | |
e811c8ce | 10182 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
10183 | """ |
10184 | Convenience function for converting a Point or (x,y) in | |
10185 | dialog units to pixel units. | |
10186 | """ | |
e811c8ce RD |
10187 | if y is None: |
10188 | return win.ConvertDialogPointToPixels(point_or_x) | |
10189 | else: | |
fd3f2efe | 10190 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
10191 | |
10192 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
10193 | """ |
10194 | Convenience function for converting a Size or (w,h) in | |
10195 | dialog units to pixel units. | |
10196 | """ | |
e811c8ce RD |
10197 | if height is None: |
10198 | return win.ConvertDialogSizeToPixels(size_width) | |
10199 | else: | |
fd3f2efe | 10200 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
10201 | |
10202 | ||
10203 | def FindWindowById(*args, **kwargs): | |
0085ce49 | 10204 | """ |
15afbcd0 RD |
10205 | FindWindowById(long id, Window parent=None) -> Window |
10206 | ||
10207 | Find the first window in the application with the given id. If parent | |
10208 | is None, the search will start from all top-level frames and dialog | |
10209 | boxes; if non-None, the search will be limited to the given window | |
10210 | hierarchy. The search is recursive in both cases. | |
10211 | """ | |
0085ce49 | 10212 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
10213 | |
10214 | def FindWindowByName(*args, **kwargs): | |
0085ce49 | 10215 | """ |
15afbcd0 RD |
10216 | FindWindowByName(String name, Window parent=None) -> Window |
10217 | ||
10218 | Find a window by its name (as given in a window constructor or Create | |
10219 | function call). If parent is None, the search will start from all | |
10220 | top-level frames and dialog boxes; if non-None, the search will be | |
10221 | limited to the given window hierarchy. The search is recursive in both | |
10222 | cases. | |
10223 | ||
10224 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10225 | """ | |
0085ce49 | 10226 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
10227 | |
10228 | def FindWindowByLabel(*args, **kwargs): | |
0085ce49 | 10229 | """ |
15afbcd0 RD |
10230 | FindWindowByLabel(String label, Window parent=None) -> Window |
10231 | ||
10232 | Find a window by its label. Depending on the type of window, the label | |
10233 | may be a window title or panel item label. If parent is None, the | |
10234 | search will start from all top-level frames and dialog boxes; if | |
10235 | non-None, the search will be limited to the given window | |
10236 | hierarchy. The search is recursive in both cases. | |
10237 | """ | |
0085ce49 | 10238 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
10239 | |
10240 | def Window_FromHWND(*args, **kwargs): | |
0085ce49 RD |
10241 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
10242 | return _core_.Window_FromHWND(*args, **kwargs) | |
b6b0383e | 10243 | |
0085ce49 RD |
10244 | def GetTopLevelWindows(*args): |
10245 | """ | |
b6b0383e RD |
10246 | GetTopLevelWindows() -> PyObject |
10247 | ||
10248 | Returns a list of the the application's top-level windows, (frames, | |
10249 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10250 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10251 | are closed or new top-level windows are created. | |
10252 | ||
10253 | """ | |
0085ce49 | 10254 | return _core_.GetTopLevelWindows(*args) |
e811c8ce RD |
10255 | #--------------------------------------------------------------------------- |
10256 | ||
10257 | class Validator(EvtHandler): | |
093d3ff1 | 10258 | """Proxy of C++ Validator class""" |
0085ce49 RD |
10259 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10260 | __repr__ = _swig_repr | |
10261 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10262 | """__init__(self) -> Validator""" |
0085ce49 | 10263 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d14a1e28 | 10264 | self._setOORInfo(self) |
e811c8ce RD |
10265 | |
10266 | def Clone(*args, **kwargs): | |
a95a7133 | 10267 | """Clone(self) -> Validator""" |
54f9ee45 | 10268 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
10269 | |
10270 | def Validate(*args, **kwargs): | |
a95a7133 | 10271 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 10272 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
10273 | |
10274 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 10275 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 10276 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
10277 | |
10278 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 10279 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 10280 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
10281 | |
10282 | def GetWindow(*args, **kwargs): | |
a95a7133 | 10283 | """GetWindow(self) -> Window""" |
54f9ee45 | 10284 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
10285 | |
10286 | def SetWindow(*args, **kwargs): | |
a95a7133 | 10287 | """SetWindow(self, Window window)""" |
54f9ee45 | 10288 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
10289 | |
10290 | def IsSilent(*args, **kwargs): | |
66c033b4 | 10291 | """IsSilent() -> bool""" |
54f9ee45 | 10292 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
10293 | |
10294 | IsSilent = staticmethod(IsSilent) | |
10295 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 10296 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 10297 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10298 | |
10299 | SetBellOnError = staticmethod(SetBellOnError) | |
dba7934c | 10300 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") |
2131d850 | 10301 | _core_.Validator_swigregister(Validator) |
e811c8ce | 10302 | |
0085ce49 RD |
10303 | def Validator_IsSilent(*args): |
10304 | """Validator_IsSilent() -> bool""" | |
10305 | return _core_.Validator_IsSilent(*args) | |
e811c8ce RD |
10306 | |
10307 | def Validator_SetBellOnError(*args, **kwargs): | |
0085ce49 RD |
10308 | """Validator_SetBellOnError(int doIt=True)""" |
10309 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
e811c8ce RD |
10310 | |
10311 | class PyValidator(Validator): | |
093d3ff1 | 10312 | """Proxy of C++ PyValidator class""" |
0085ce49 RD |
10313 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10314 | __repr__ = _swig_repr | |
10315 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10316 | """__init__(self) -> PyValidator""" |
0085ce49 | 10317 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
e811c8ce RD |
10318 | |
10319 | self._setCallbackInfo(self, PyValidator, 1) | |
10320 | self._setOORInfo(self) | |
10321 | ||
10322 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 10323 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" |
54f9ee45 | 10324 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce | 10325 | |
2131d850 | 10326 | _core_.PyValidator_swigregister(PyValidator) |
e811c8ce RD |
10327 | |
10328 | #--------------------------------------------------------------------------- | |
10329 | ||
10330 | class Menu(EvtHandler): | |
093d3ff1 | 10331 | """Proxy of C++ Menu class""" |
0085ce49 RD |
10332 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10333 | __repr__ = _swig_repr | |
10334 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10335 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
0085ce49 | 10336 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
e811c8ce RD |
10337 | self._setOORInfo(self) |
10338 | ||
10339 | def Append(*args, **kwargs): | |
97ab0f6a RD |
10340 | """ |
10341 | Append(self, int id, String text=EmptyString, String help=EmptyString, | |
10342 | int kind=ITEM_NORMAL) -> MenuItem | |
10343 | """ | |
54f9ee45 | 10344 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
10345 | |
10346 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 10347 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 10348 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
10349 | |
10350 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 10351 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10352 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
10353 | |
10354 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 10355 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10356 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
10357 | |
10358 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 10359 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10360 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce | 10361 | |
50efceee RD |
10362 | def AppendSubMenu(*args, **kwargs): |
10363 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
10364 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
10365 | ||
e811c8ce | 10366 | def AppendItem(*args, **kwargs): |
a95a7133 | 10367 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10368 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce | 10369 | |
e811c8ce | 10370 | def InsertItem(*args, **kwargs): |
a95a7133 | 10371 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 10372 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce | 10373 | |
0085ce49 RD |
10374 | def PrependItem(*args, **kwargs): |
10375 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10376 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10377 | ||
10378 | def Break(*args, **kwargs): | |
10379 | """Break(self)""" | |
10380 | return _core_.Menu_Break(*args, **kwargs) | |
10381 | ||
e811c8ce | 10382 | def Insert(*args, **kwargs): |
0df68c9f | 10383 | """ |
97ab0f6a | 10384 | Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString, |
a41e16b6 | 10385 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 10386 | """ |
54f9ee45 | 10387 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
10388 | |
10389 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 10390 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 10391 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
10392 | |
10393 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 10394 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10395 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
10396 | |
10397 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 10398 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10399 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
10400 | |
10401 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 10402 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10403 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce | 10404 | |
e811c8ce | 10405 | def Prepend(*args, **kwargs): |
97ab0f6a RD |
10406 | """ |
10407 | Prepend(self, int id, String text=EmptyString, String help=EmptyString, | |
10408 | int kind=ITEM_NORMAL) -> MenuItem | |
10409 | """ | |
54f9ee45 | 10410 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
10411 | |
10412 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 10413 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 10414 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
10415 | |
10416 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 10417 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10418 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
10419 | |
10420 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 10421 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10422 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
10423 | |
10424 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 10425 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10426 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
10427 | |
10428 | def Remove(*args, **kwargs): | |
a95a7133 | 10429 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 10430 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce RD |
10431 | |
10432 | def RemoveItem(*args, **kwargs): | |
a95a7133 | 10433 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10434 | return _core_.Menu_RemoveItem(*args, **kwargs) |
e811c8ce RD |
10435 | |
10436 | def Delete(*args, **kwargs): | |
a95a7133 | 10437 | """Delete(self, int id) -> bool""" |
54f9ee45 | 10438 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
10439 | |
10440 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 10441 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 10442 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
10443 | |
10444 | def Destroy(*args, **kwargs): | |
0df68c9f | 10445 | """ |
a95a7133 | 10446 | Destroy(self) |
e811c8ce | 10447 | |
0df68c9f RD |
10448 | Deletes the C++ object this Python object is a proxy for. |
10449 | """ | |
7e08d4ef RD |
10450 | val = _core_.Menu_Destroy(*args, **kwargs) |
10451 | args[0].thisown = 0 | |
10452 | return val | |
e811c8ce RD |
10453 | |
10454 | def DestroyId(*args, **kwargs): | |
0df68c9f | 10455 | """ |
a95a7133 | 10456 | DestroyId(self, int id) -> bool |
e811c8ce | 10457 | |
0df68c9f RD |
10458 | Deletes the C++ object this Python object is a proxy for. |
10459 | """ | |
7e08d4ef RD |
10460 | val = _core_.Menu_DestroyId(*args, **kwargs) |
10461 | args[0].thisown = 0 | |
10462 | return val | |
e811c8ce RD |
10463 | |
10464 | def DestroyItem(*args, **kwargs): | |
0df68c9f | 10465 | """ |
a95a7133 | 10466 | DestroyItem(self, MenuItem item) -> bool |
e811c8ce | 10467 | |
0df68c9f RD |
10468 | Deletes the C++ object this Python object is a proxy for. |
10469 | """ | |
7e08d4ef RD |
10470 | val = _core_.Menu_DestroyItem(*args, **kwargs) |
10471 | args[0].thisown = 0 | |
10472 | return val | |
e811c8ce RD |
10473 | |
10474 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 10475 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 10476 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
10477 | |
10478 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 10479 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 10480 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
10481 | |
10482 | def FindItem(*args, **kwargs): | |
a95a7133 | 10483 | """FindItem(self, String item) -> int""" |
54f9ee45 | 10484 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
10485 | |
10486 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10487 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10488 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
10489 | |
10490 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 10491 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 10492 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
10493 | |
10494 | def Enable(*args, **kwargs): | |
a95a7133 | 10495 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10496 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
10497 | |
10498 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10499 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10500 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10501 | |
10502 | def Check(*args, **kwargs): | |
a95a7133 | 10503 | """Check(self, int id, bool check)""" |
54f9ee45 | 10504 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
10505 | |
10506 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10507 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10508 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
10509 | |
10510 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10511 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10512 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
10513 | |
10514 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10515 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10516 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
10517 | |
10518 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10519 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10520 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10521 | |
10522 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10523 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10524 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10525 | |
10526 | def SetTitle(*args, **kwargs): | |
a95a7133 | 10527 | """SetTitle(self, String title)""" |
54f9ee45 | 10528 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
10529 | |
10530 | def GetTitle(*args, **kwargs): | |
a95a7133 | 10531 | """GetTitle(self) -> String""" |
54f9ee45 | 10532 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
10533 | |
10534 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 10535 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 10536 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
10537 | |
10538 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 10539 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 10540 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
10541 | |
10542 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10543 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 10544 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10545 | |
10546 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10547 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 10548 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10549 | |
10550 | def GetStyle(*args, **kwargs): | |
a95a7133 | 10551 | """GetStyle(self) -> long""" |
54f9ee45 | 10552 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
10553 | |
10554 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 10555 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 10556 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
10557 | |
10558 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 10559 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 10560 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
10561 | |
10562 | def Attach(*args, **kwargs): | |
a95a7133 | 10563 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 10564 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
10565 | |
10566 | def Detach(*args, **kwargs): | |
a95a7133 | 10567 | """Detach(self)""" |
54f9ee45 | 10568 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
10569 | |
10570 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10571 | """IsAttached(self) -> bool""" |
54f9ee45 | 10572 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
10573 | |
10574 | def SetParent(*args, **kwargs): | |
a95a7133 | 10575 | """SetParent(self, Menu parent)""" |
54f9ee45 | 10576 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
10577 | |
10578 | def GetParent(*args, **kwargs): | |
a95a7133 | 10579 | """GetParent(self) -> Menu""" |
54f9ee45 | 10580 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 10581 | |
57332a5a RD |
10582 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") |
10583 | HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`") | |
10584 | InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`") | |
10585 | MenuBar = property(GetMenuBar,doc="See `GetMenuBar`") | |
10586 | MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`") | |
10587 | MenuItems = property(GetMenuItems,doc="See `GetMenuItems`") | |
10588 | Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`") | |
10589 | Style = property(GetStyle,doc="See `GetStyle`") | |
10590 | Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`") | |
2131d850 | 10591 | _core_.Menu_swigregister(Menu) |
d14a1e28 RD |
10592 | DefaultValidator = cvar.DefaultValidator |
10593 | ||
10594 | #--------------------------------------------------------------------------- | |
10595 | ||
10596 | class MenuBar(Window): | |
093d3ff1 | 10597 | """Proxy of C++ MenuBar class""" |
0085ce49 RD |
10598 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10599 | __repr__ = _swig_repr | |
10600 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10601 | """__init__(self, long style=0) -> MenuBar""" |
0085ce49 | 10602 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d14a1e28 | 10603 | self._setOORInfo(self) |
e811c8ce RD |
10604 | |
10605 | def Append(*args, **kwargs): | |
a95a7133 | 10606 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 10607 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
10608 | |
10609 | def Insert(*args, **kwargs): | |
a95a7133 | 10610 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 10611 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
10612 | |
10613 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 10614 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 10615 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
10616 | |
10617 | def GetMenu(*args, **kwargs): | |
a95a7133 | 10618 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 10619 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
10620 | |
10621 | def Replace(*args, **kwargs): | |
a95a7133 | 10622 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 10623 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
10624 | |
10625 | def Remove(*args, **kwargs): | |
a95a7133 | 10626 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 10627 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
10628 | |
10629 | def EnableTop(*args, **kwargs): | |
a95a7133 | 10630 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 10631 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
10632 | |
10633 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 10634 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 10635 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
10636 | |
10637 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 10638 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 10639 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
10640 | |
10641 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 10642 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 10643 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
10644 | |
10645 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 10646 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 10647 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
10648 | |
10649 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10650 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10651 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
10652 | |
10653 | def FindMenu(*args, **kwargs): | |
a95a7133 | 10654 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 10655 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
10656 | |
10657 | def Enable(*args, **kwargs): | |
a95a7133 | 10658 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10659 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
10660 | |
10661 | def Check(*args, **kwargs): | |
a95a7133 | 10662 | """Check(self, int id, bool check)""" |
54f9ee45 | 10663 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
10664 | |
10665 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10666 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10667 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
10668 | |
10669 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10670 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10671 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10672 | |
10673 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10674 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10675 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
10676 | |
10677 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10678 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10679 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
10680 | |
10681 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10682 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10683 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10684 | |
10685 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10686 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10687 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10688 | |
10689 | def GetFrame(*args, **kwargs): | |
a95a7133 | 10690 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 10691 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
10692 | |
10693 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10694 | """IsAttached(self) -> bool""" |
54f9ee45 | 10695 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
10696 | |
10697 | def Attach(*args, **kwargs): | |
a95a7133 | 10698 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 10699 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
10700 | |
10701 | def Detach(*args, **kwargs): | |
a95a7133 | 10702 | """Detach(self)""" |
54f9ee45 | 10703 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 10704 | |
587d0f36 RD |
10705 | def UpdateMenus(*args, **kwargs): |
10706 | """UpdateMenus(self)""" | |
10707 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
10708 | ||
4f433fef RD |
10709 | def SetAutoWindowMenu(*args, **kwargs): |
10710 | """SetAutoWindowMenu(bool enable)""" | |
10711 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10712 | ||
10713 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10714 | def GetAutoWindowMenu(*args, **kwargs): | |
10715 | """GetAutoWindowMenu() -> bool""" | |
10716 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10717 | ||
10718 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
97ab0f6a RD |
10719 | def GetMenus(self): |
10720 | """Return a list of (menu, label) items for the menus in the MenuBar. """ | |
10721 | return [(self.GetMenu(i), self.GetLabelTop(i)) | |
10722 | for i in range(self.GetMenuCount())] | |
10723 | ||
10724 | def SetMenus(self, items): | |
10725 | """Clear and add new menus to the MenuBar from a list of (menu, label) items. """ | |
10726 | for i in range(self.GetMenuCount()-1, -1, -1): | |
10727 | self.Remove(i) | |
10728 | for m, l in items: | |
10729 | self.Append(m, l) | |
10730 | ||
57332a5a RD |
10731 | Frame = property(GetFrame,doc="See `GetFrame`") |
10732 | Menu = property(GetMenu,doc="See `GetMenu`") | |
10733 | MenuCount = property(GetMenuCount,doc="See `GetMenuCount`") | |
10734 | Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`") | |
2131d850 | 10735 | _core_.MenuBar_swigregister(MenuBar) |
d14a1e28 | 10736 | |
4f433fef | 10737 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
0085ce49 RD |
10738 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
10739 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 10740 | |
0085ce49 RD |
10741 | def MenuBar_GetAutoWindowMenu(*args): |
10742 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10743 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 10744 | |
d14a1e28 RD |
10745 | #--------------------------------------------------------------------------- |
10746 | ||
10747 | class MenuItem(Object): | |
093d3ff1 | 10748 | """Proxy of C++ MenuItem class""" |
0085ce49 RD |
10749 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10750 | __repr__ = _swig_repr | |
10751 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10752 | """ |
a95a7133 | 10753 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
196addbf RD |
10754 | String help=EmptyString, int kind=ITEM_NORMAL, |
10755 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 10756 | """ |
0085ce49 RD |
10757 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
10758 | __swig_destroy__ = _core_.delete_MenuItem | |
10759 | __del__ = lambda self : None; | |
e811c8ce | 10760 | def GetMenu(*args, **kwargs): |
a95a7133 | 10761 | """GetMenu(self) -> Menu""" |
54f9ee45 | 10762 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
10763 | |
10764 | def SetMenu(*args, **kwargs): | |
a95a7133 | 10765 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 10766 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
10767 | |
10768 | def SetId(*args, **kwargs): | |
a95a7133 | 10769 | """SetId(self, int id)""" |
54f9ee45 | 10770 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
10771 | |
10772 | def GetId(*args, **kwargs): | |
a95a7133 | 10773 | """GetId(self) -> int""" |
54f9ee45 | 10774 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
10775 | |
10776 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 10777 | """IsSeparator(self) -> bool""" |
54f9ee45 | 10778 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
10779 | |
10780 | def SetText(*args, **kwargs): | |
a95a7133 | 10781 | """SetText(self, String str)""" |
54f9ee45 | 10782 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
10783 | |
10784 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10785 | """GetLabel(self) -> String""" |
54f9ee45 | 10786 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
10787 | |
10788 | def GetText(*args, **kwargs): | |
a95a7133 | 10789 | """GetText(self) -> String""" |
54f9ee45 | 10790 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
10791 | |
10792 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 10793 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 10794 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
10795 | |
10796 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10797 | def GetKind(*args, **kwargs): | |
a95a7133 | 10798 | """GetKind(self) -> int""" |
54f9ee45 | 10799 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 10800 | |
a95a7133 RD |
10801 | def SetKind(*args, **kwargs): |
10802 | """SetKind(self, int kind)""" | |
54f9ee45 | 10803 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 10804 | |
e811c8ce | 10805 | def SetCheckable(*args, **kwargs): |
a95a7133 | 10806 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 10807 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
10808 | |
10809 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 10810 | """IsCheckable(self) -> bool""" |
54f9ee45 | 10811 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
10812 | |
10813 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 10814 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 10815 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
10816 | |
10817 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 10818 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 10819 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
10820 | |
10821 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 10822 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 10823 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
10824 | |
10825 | def Enable(*args, **kwargs): | |
a95a7133 | 10826 | """Enable(self, bool enable=True)""" |
54f9ee45 | 10827 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
10828 | |
10829 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10830 | """IsEnabled(self) -> bool""" |
54f9ee45 | 10831 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10832 | |
10833 | def Check(*args, **kwargs): | |
a95a7133 | 10834 | """Check(self, bool check=True)""" |
54f9ee45 | 10835 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
10836 | |
10837 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10838 | """IsChecked(self) -> bool""" |
54f9ee45 | 10839 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
10840 | |
10841 | def Toggle(*args, **kwargs): | |
a95a7133 | 10842 | """Toggle(self)""" |
54f9ee45 | 10843 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
10844 | |
10845 | def SetHelp(*args, **kwargs): | |
a95a7133 | 10846 | """SetHelp(self, String str)""" |
54f9ee45 | 10847 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
10848 | |
10849 | def GetHelp(*args, **kwargs): | |
a95a7133 | 10850 | """GetHelp(self) -> String""" |
54f9ee45 | 10851 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
10852 | |
10853 | def GetAccel(*args, **kwargs): | |
a95a7133 | 10854 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 10855 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
10856 | |
10857 | def SetAccel(*args, **kwargs): | |
a95a7133 | 10858 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 10859 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 10860 | |
091f5bed RD |
10861 | def SetBitmap(*args, **kwargs): |
10862 | """SetBitmap(self, Bitmap bitmap)""" | |
10863 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10864 | ||
10865 | def GetBitmap(*args, **kwargs): | |
10866 | """GetBitmap(self) -> Bitmap""" | |
10867 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10868 | ||
c1280d1e RD |
10869 | def SetFont(*args, **kwargs): |
10870 | """SetFont(self, Font font)""" | |
10871 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10872 | ||
10873 | def GetFont(*args, **kwargs): | |
10874 | """GetFont(self) -> Font""" | |
10875 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10876 | ||
10877 | def SetTextColour(*args, **kwargs): | |
10878 | """SetTextColour(self, Colour colText)""" | |
10879 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10880 | ||
10881 | def GetTextColour(*args, **kwargs): | |
10882 | """GetTextColour(self) -> Colour""" | |
10883 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10884 | ||
10885 | def SetBackgroundColour(*args, **kwargs): | |
10886 | """SetBackgroundColour(self, Colour colBack)""" | |
10887 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10888 | ||
10889 | def GetBackgroundColour(*args, **kwargs): | |
10890 | """GetBackgroundColour(self) -> Colour""" | |
10891 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10892 | ||
10893 | def SetBitmaps(*args, **kwargs): | |
10894 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10895 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10896 | ||
10897 | def SetDisabledBitmap(*args, **kwargs): | |
10898 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10899 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10900 | ||
10901 | def GetDisabledBitmap(*args, **kwargs): | |
10902 | """GetDisabledBitmap(self) -> Bitmap""" | |
10903 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10904 | ||
10905 | def SetMarginWidth(*args, **kwargs): | |
10906 | """SetMarginWidth(self, int nWidth)""" | |
10907 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10908 | ||
10909 | def GetMarginWidth(*args, **kwargs): | |
10910 | """GetMarginWidth(self) -> int""" | |
10911 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10912 | ||
e811c8ce | 10913 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 10914 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 10915 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
10916 | |
10917 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10918 | def IsOwnerDrawn(*args, **kwargs): |
10919 | """IsOwnerDrawn(self) -> bool""" | |
10920 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10921 | ||
10922 | def SetOwnerDrawn(*args, **kwargs): | |
10923 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10924 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10925 | ||
10926 | def ResetOwnerDrawn(*args, **kwargs): | |
10927 | """ResetOwnerDrawn(self)""" | |
10928 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10929 | ||
57332a5a RD |
10930 | Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`") |
10931 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
10932 | Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`") | |
10933 | DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`") | |
10934 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
10935 | Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`") | |
10936 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
10937 | Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`") | |
10938 | Label = property(GetLabel,doc="See `GetLabel`") | |
10939 | MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`") | |
10940 | Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`") | |
10941 | SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`") | |
10942 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
10943 | TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`") | |
2131d850 | 10944 | _core_.MenuItem_swigregister(MenuItem) |
d14a1e28 | 10945 | |
e811c8ce | 10946 | def MenuItem_GetLabelFromText(*args, **kwargs): |
0085ce49 RD |
10947 | """MenuItem_GetLabelFromText(String text) -> String""" |
10948 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d14a1e28 | 10949 | |
0085ce49 RD |
10950 | def MenuItem_GetDefaultMarginWidth(*args): |
10951 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10952 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d14a1e28 RD |
10953 | |
10954 | #--------------------------------------------------------------------------- | |
10955 | ||
10956 | class Control(Window): | |
15afbcd0 RD |
10957 | """ |
10958 | This is the base class for a control or 'widget'. | |
10959 | ||
41e2b43e RD |
10960 | A control is generally a small window which processes user input |
10961 | and/or displays one or more item of data. | |
15afbcd0 | 10962 | """ |
0085ce49 RD |
10963 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10964 | __repr__ = _swig_repr | |
10965 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10966 | """ |
248ed943 RD |
10967 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10968 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10969 | String name=ControlNameStr) -> Control |
15afbcd0 | 10970 | |
41e2b43e RD |
10971 | Create a Control. Normally you should only call this from a subclass' |
10972 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 10973 | """ |
0085ce49 | 10974 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d14a1e28 | 10975 | self._setOORInfo(self) |
e811c8ce RD |
10976 | |
10977 | def Create(*args, **kwargs): | |
0df68c9f | 10978 | """ |
248ed943 RD |
10979 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10980 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10981 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
10982 | |
10983 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 10984 | """ |
54f9ee45 | 10985 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce | 10986 | |
10044bf1 RD |
10987 | def GetAlignment(*args, **kwargs): |
10988 | """ | |
10989 | GetAlignment(self) -> int | |
10990 | ||
10991 | Get the control alignment (left/right/centre, top/bottom/centre) | |
10992 | """ | |
10993 | return _core_.Control_GetAlignment(*args, **kwargs) | |
10994 | ||
34e0a3bb | 10995 | def GetLabelText(*args, **kwargs): |
10044bf1 | 10996 | """ |
10044bf1 RD |
10997 | GetLabelText(self) -> String |
10998 | ||
10999 | Get just the text of the label, without mnemonic characters ('&') | |
11000 | """ | |
34e0a3bb | 11001 | return _core_.Control_GetLabelText(*args, **kwargs) |
10044bf1 | 11002 | |
e811c8ce | 11003 | def Command(*args, **kwargs): |
15afbcd0 | 11004 | """ |
a95a7133 | 11005 | Command(self, CommandEvent event) |
15afbcd0 | 11006 | |
41e2b43e RD |
11007 | Simulates the effect of the user issuing a command to the item. |
11008 | ||
11009 | :see: `wx.CommandEvent` | |
11010 | ||
15afbcd0 | 11011 | """ |
54f9ee45 | 11012 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce | 11013 | |
74a57fcd | 11014 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
11015 | """ |
11016 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
11017 | ||
11018 | Get the default attributes for this class. This is useful if you want | |
11019 | to use the same font or colour in your own control as in a standard | |
11020 | control -- which is a much better idea than hard coding specific | |
11021 | colours or fonts which might look completely out of place on the | |
11022 | user's system, especially if it uses themes. | |
11023 | ||
11024 | The variant parameter is only relevant under Mac currently and is | |
11025 | ignore under other platforms. Under Mac, it will change the size of | |
11026 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11027 | this. | |
11028 | """ | |
54f9ee45 | 11029 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
11030 | |
11031 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2bf58437 | 11032 | Alignment = property(GetAlignment,doc="See `GetAlignment`") |
2bf58437 | 11033 | LabelText = property(GetLabelText,doc="See `GetLabelText`") |
2131d850 | 11034 | _core_.Control_swigregister(Control) |
b2dc1044 | 11035 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
11036 | |
11037 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
11038 | """ |
11039 | PreControl() -> Control | |
11040 | ||
11041 | Precreate a Control control for 2-phase creation | |
11042 | """ | |
54f9ee45 | 11043 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
11044 | return val |
11045 | ||
74a57fcd | 11046 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 11047 | """ |
110da5b0 RD |
11048 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
11049 | ||
11050 | Get the default attributes for this class. This is useful if you want | |
11051 | to use the same font or colour in your own control as in a standard | |
11052 | control -- which is a much better idea than hard coding specific | |
11053 | colours or fonts which might look completely out of place on the | |
11054 | user's system, especially if it uses themes. | |
11055 | ||
11056 | The variant parameter is only relevant under Mac currently and is | |
11057 | ignore under other platforms. Under Mac, it will change the size of | |
11058 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11059 | this. | |
11060 | """ | |
0085ce49 | 11061 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 11062 | |
d14a1e28 RD |
11063 | #--------------------------------------------------------------------------- |
11064 | ||
11065 | class ItemContainer(object): | |
15afbcd0 | 11066 | """ |
53aa7709 RD |
11067 | The wx.ItemContainer class defines an interface which is implemented |
11068 | by all controls which have string subitems, each of which may be | |
11069 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
11070 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 11071 | this one. |
15afbcd0 | 11072 | |
41e2b43e RD |
11073 | It defines the methods for accessing the control's items and although |
11074 | each of the derived classes implements them differently, they still | |
11075 | all conform to the same interface. | |
15afbcd0 | 11076 | |
41e2b43e RD |
11077 | The items in a wx.ItemContainer have (non empty) string labels and, |
11078 | optionally, client data associated with them. | |
15afbcd0 RD |
11079 | |
11080 | """ | |
0085ce49 RD |
11081 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11082 | def __init__(self): raise AttributeError, "No constructor defined" | |
11083 | __repr__ = _swig_repr | |
e811c8ce | 11084 | def Append(*args, **kwargs): |
15afbcd0 | 11085 | """ |
a95a7133 | 11086 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 11087 | |
41e2b43e RD |
11088 | Adds the item to the control, associating the given data with the item |
11089 | if not None. The return value is the index of the newly added item | |
11090 | which may be different from the last one if the control is sorted (e.g. | |
11091 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 11092 | """ |
54f9ee45 | 11093 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
11094 | |
11095 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 11096 | """ |
f5b96ee1 | 11097 | AppendItems(self, List strings) |
15afbcd0 | 11098 | |
41e2b43e RD |
11099 | Apend several items at once to the control. Notice that calling this |
11100 | method may be much faster than appending the items one by one if you | |
11101 | need to add a lot of items. | |
15afbcd0 | 11102 | """ |
54f9ee45 | 11103 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
11104 | |
11105 | def Insert(*args, **kwargs): | |
15afbcd0 | 11106 | """ |
50f151d7 | 11107 | Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int |
15afbcd0 | 11108 | |
41e2b43e | 11109 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
11110 | optionally associating some data object with the item. |
11111 | """ | |
54f9ee45 | 11112 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
11113 | |
11114 | def Clear(*args, **kwargs): | |
15afbcd0 | 11115 | """ |
a95a7133 | 11116 | Clear(self) |
15afbcd0 RD |
11117 | |
11118 | Removes all items from the control. | |
11119 | """ | |
54f9ee45 | 11120 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
11121 | |
11122 | def Delete(*args, **kwargs): | |
15afbcd0 | 11123 | """ |
50f151d7 | 11124 | Delete(self, unsigned int n) |
15afbcd0 | 11125 | |
41e2b43e RD |
11126 | Deletes the item at the zero-based index 'n' from the control. Note |
11127 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11128 | enabled) to remove an item with the index negative or greater or equal | |
11129 | than the number of items in the control. | |
15afbcd0 | 11130 | """ |
54f9ee45 | 11131 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 11132 | |
53aa7709 RD |
11133 | def GetClientData(*args, **kwargs): |
11134 | """ | |
50f151d7 | 11135 | GetClientData(self, unsigned int n) -> PyObject |
53aa7709 RD |
11136 | |
11137 | Returns the client data associated with the given item, (if any.) | |
11138 | """ | |
11139 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
11140 | ||
11141 | def SetClientData(*args, **kwargs): | |
11142 | """ | |
50f151d7 | 11143 | SetClientData(self, unsigned int n, PyObject clientData) |
53aa7709 RD |
11144 | |
11145 | Associate the given client data with the item at position n. | |
11146 | """ | |
11147 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
11148 | ||
e811c8ce | 11149 | def GetCount(*args, **kwargs): |
15afbcd0 | 11150 | """ |
50f151d7 | 11151 | GetCount(self) -> unsigned int |
15afbcd0 RD |
11152 | |
11153 | Returns the number of items in the control. | |
11154 | """ | |
54f9ee45 | 11155 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
11156 | |
11157 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 11158 | """ |
a95a7133 | 11159 | IsEmpty(self) -> bool |
15afbcd0 RD |
11160 | |
11161 | Returns True if the control is empty or False if it has some items. | |
11162 | """ | |
54f9ee45 | 11163 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
11164 | |
11165 | def GetString(*args, **kwargs): | |
15afbcd0 | 11166 | """ |
50f151d7 | 11167 | GetString(self, unsigned int n) -> String |
15afbcd0 RD |
11168 | |
11169 | Returns the label of the item with the given index. | |
11170 | """ | |
54f9ee45 | 11171 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
11172 | |
11173 | def GetStrings(*args, **kwargs): | |
a95a7133 | 11174 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 11175 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
11176 | |
11177 | def SetString(*args, **kwargs): | |
15afbcd0 | 11178 | """ |
50f151d7 | 11179 | SetString(self, unsigned int n, String s) |
15afbcd0 RD |
11180 | |
11181 | Sets the label for the given item. | |
11182 | """ | |
54f9ee45 | 11183 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
11184 | |
11185 | def FindString(*args, **kwargs): | |
15afbcd0 | 11186 | """ |
a95a7133 | 11187 | FindString(self, String s) -> int |
15afbcd0 RD |
11188 | |
11189 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
11190 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11191 | found. | |
15afbcd0 | 11192 | """ |
54f9ee45 | 11193 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 11194 | |
53aa7709 | 11195 | def SetSelection(*args, **kwargs): |
15afbcd0 | 11196 | """ |
53aa7709 | 11197 | SetSelection(self, int n) |
15afbcd0 RD |
11198 | |
11199 | Sets the item at index 'n' to be the selected item. | |
11200 | """ | |
53aa7709 | 11201 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
11202 | |
11203 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 11204 | """ |
a95a7133 | 11205 | GetSelection(self) -> int |
15afbcd0 | 11206 | |
41e2b43e RD |
11207 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11208 | is selected. | |
15afbcd0 | 11209 | """ |
54f9ee45 | 11210 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 11211 | |
53aa7709 RD |
11212 | def SetStringSelection(*args, **kwargs): |
11213 | """SetStringSelection(self, String s) -> bool""" | |
11214 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11215 | ||
e811c8ce | 11216 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 11217 | """ |
a95a7133 | 11218 | GetStringSelection(self) -> String |
15afbcd0 | 11219 | |
41e2b43e RD |
11220 | Returns the label of the selected item or an empty string if no item |
11221 | is selected. | |
15afbcd0 | 11222 | """ |
54f9ee45 | 11223 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 11224 | |
53aa7709 | 11225 | def Select(*args, **kwargs): |
15afbcd0 | 11226 | """ |
53aa7709 | 11227 | Select(self, int n) |
15afbcd0 | 11228 | |
53aa7709 RD |
11229 | This is the same as `SetSelection` and exists only because it is |
11230 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 11231 | """ |
53aa7709 | 11232 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 11233 | |
97ab0f6a RD |
11234 | def GetItems(self): |
11235 | """Return a list of the strings in the control""" | |
11236 | return [self.GetString(i) for i in xrange(self.GetCount())] | |
11237 | ||
11238 | def SetItems(self, items): | |
11239 | """Clear and set the strings in the control from a list""" | |
11240 | self.Clear() | |
11241 | for i in items: | |
11242 | self.Append(i) | |
11243 | ||
11244 | Count = property(GetCount,doc="See `GetCount`") | |
11245 | Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`") | |
11246 | Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`") | |
11247 | StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`") | |
11248 | Strings = property(GetStrings,doc="See `GetStrings`") | |
2131d850 | 11249 | _core_.ItemContainer_swigregister(ItemContainer) |
d14a1e28 RD |
11250 | |
11251 | #--------------------------------------------------------------------------- | |
11252 | ||
11253 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 11254 | """ |
41e2b43e RD |
11255 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11256 | wx.Control class, and is used for the base class of various controls | |
11257 | that have items. | |
15afbcd0 | 11258 | """ |
0085ce49 RD |
11259 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11260 | def __init__(self): raise AttributeError, "No constructor defined" | |
11261 | __repr__ = _swig_repr | |
2131d850 | 11262 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d14a1e28 RD |
11263 | |
11264 | #--------------------------------------------------------------------------- | |
11265 | ||
11266 | class SizerItem(Object): | |
248ed943 RD |
11267 | """ |
11268 | The wx.SizerItem class is used to track the position, size and other | |
01f6b6d3 RD |
11269 | attributes of each item managed by a `wx.Sizer`. It is not usually |
11270 | necessary to use this class because the sizer elements can also be | |
11271 | identified by their positions or window or sizer references but | |
11272 | sometimes it may be more convenient to use wx.SizerItem directly. | |
11273 | Also, custom classes derived from `wx.PySizer` will probably need to | |
11274 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
11275 | layout. | |
248ed943 RD |
11276 | |
11277 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11278 | """ | |
0085ce49 RD |
11279 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11280 | __repr__ = _swig_repr | |
11281 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11282 | """ |
11283 | __init__(self) -> SizerItem | |
11284 | ||
11285 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11286 | size will need to be set before this item can be used in a Sizer. | |
11287 | ||
11288 | You will probably never need to create a wx.SizerItem directly as they | |
11289 | are created automatically when the sizer's Add, Insert or Prepend | |
11290 | methods are called. | |
11291 | ||
11292 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11293 | """ | |
0085ce49 RD |
11294 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
11295 | __swig_destroy__ = _core_.delete_SizerItem | |
11296 | __del__ = lambda self : None; | |
e811c8ce | 11297 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
11298 | """ |
11299 | DeleteWindows(self) | |
11300 | ||
11301 | Destroy the window or the windows in a subsizer, depending on the type | |
11302 | of item. | |
11303 | """ | |
54f9ee45 | 11304 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11305 | |
11306 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
11307 | """ |
11308 | DetachSizer(self) | |
11309 | ||
11310 | Enable deleting the SizerItem without destroying the contained sizer. | |
11311 | """ | |
54f9ee45 | 11312 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
11313 | |
11314 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11315 | """ |
11316 | GetSize(self) -> Size | |
11317 | ||
11318 | Get the current size of the item, as set in the last Layout. | |
11319 | """ | |
54f9ee45 | 11320 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
11321 | |
11322 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11323 | """ |
11324 | CalcMin(self) -> Size | |
11325 | ||
11326 | Calculates the minimum desired size for the item, including any space | |
11327 | needed by borders. | |
11328 | """ | |
54f9ee45 | 11329 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
11330 | |
11331 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
11332 | """ |
11333 | SetDimension(self, Point pos, Size size) | |
11334 | ||
11335 | Set the position and size of the space allocated for this item by the | |
11336 | sizer, and adjust the position and size of the item (window or | |
11337 | subsizer) to be within that space taking alignment and borders into | |
11338 | account. | |
11339 | """ | |
54f9ee45 | 11340 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
11341 | |
11342 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11343 | """ |
11344 | GetMinSize(self) -> Size | |
11345 | ||
11346 | Get the minimum size needed for the item. | |
11347 | """ | |
54f9ee45 | 11348 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 11349 | |
dfbb5885 RD |
11350 | def GetMinSizeWithBorder(*args, **kwargs): |
11351 | """ | |
11352 | GetMinSizeWithBorder(self) -> Size | |
11353 | ||
11354 | Get the minimum size needed for the item with space for the borders | |
11355 | added, if needed. | |
11356 | """ | |
11357 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11358 | ||
e811c8ce | 11359 | def SetInitSize(*args, **kwargs): |
a95a7133 | 11360 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 11361 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
11362 | |
11363 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
11364 | """ |
11365 | SetRatioWH(self, int width, int height) | |
11366 | ||
11367 | Set the ratio item attribute. | |
11368 | """ | |
54f9ee45 | 11369 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
11370 | |
11371 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
11372 | """ |
11373 | SetRatioSize(self, Size size) | |
11374 | ||
11375 | Set the ratio item attribute. | |
11376 | """ | |
54f9ee45 | 11377 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
11378 | |
11379 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
11380 | """ |
11381 | SetRatio(self, float ratio) | |
11382 | ||
11383 | Set the ratio item attribute. | |
11384 | """ | |
54f9ee45 | 11385 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
11386 | |
11387 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
11388 | """ |
11389 | GetRatio(self) -> float | |
11390 | ||
11391 | Set the ratio item attribute. | |
11392 | """ | |
54f9ee45 | 11393 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 11394 | |
d3b6e4ff RD |
11395 | def GetRect(*args, **kwargs): |
11396 | """ | |
11397 | GetRect(self) -> Rect | |
11398 | ||
11399 | Returns the rectangle that the sizer item should occupy | |
11400 | """ | |
11401 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
11402 | ||
e811c8ce | 11403 | def IsWindow(*args, **kwargs): |
248ed943 RD |
11404 | """ |
11405 | IsWindow(self) -> bool | |
11406 | ||
11407 | Is this sizer item a window? | |
11408 | """ | |
54f9ee45 | 11409 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
11410 | |
11411 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
11412 | """ |
11413 | IsSizer(self) -> bool | |
11414 | ||
11415 | Is this sizer item a subsizer? | |
11416 | """ | |
54f9ee45 | 11417 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
11418 | |
11419 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
11420 | """ |
11421 | IsSpacer(self) -> bool | |
11422 | ||
11423 | Is this sizer item a spacer? | |
11424 | """ | |
54f9ee45 | 11425 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
11426 | |
11427 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
11428 | """ |
11429 | SetProportion(self, int proportion) | |
11430 | ||
11431 | Set the proportion value for this item. | |
11432 | """ | |
54f9ee45 | 11433 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
11434 | |
11435 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
11436 | """ |
11437 | GetProportion(self) -> int | |
11438 | ||
11439 | Get the proportion value for this item. | |
11440 | """ | |
54f9ee45 | 11441 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 11442 | |
248ed943 RD |
11443 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11444 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 11445 | def SetFlag(*args, **kwargs): |
248ed943 RD |
11446 | """ |
11447 | SetFlag(self, int flag) | |
11448 | ||
11449 | Set the flag value for this item. | |
11450 | """ | |
54f9ee45 | 11451 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
11452 | |
11453 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
11454 | """ |
11455 | GetFlag(self) -> int | |
11456 | ||
11457 | Get the flag value for this item. | |
11458 | """ | |
54f9ee45 | 11459 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
11460 | |
11461 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
11462 | """ |
11463 | SetBorder(self, int border) | |
11464 | ||
11465 | Set the border value for this item. | |
11466 | """ | |
54f9ee45 | 11467 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
11468 | |
11469 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
11470 | """ |
11471 | GetBorder(self) -> int | |
11472 | ||
11473 | Get the border value for this item. | |
11474 | """ | |
54f9ee45 | 11475 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
11476 | |
11477 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
11478 | """ |
11479 | GetWindow(self) -> Window | |
11480 | ||
11481 | Get the window (if any) that is managed by this sizer item. | |
11482 | """ | |
54f9ee45 | 11483 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce RD |
11484 | |
11485 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
11486 | """ |
11487 | SetWindow(self, Window window) | |
11488 | ||
11489 | Set the window to be managed by this sizer item. | |
11490 | """ | |
54f9ee45 | 11491 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
e811c8ce RD |
11492 | |
11493 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
11494 | """ |
11495 | GetSizer(self) -> Sizer | |
11496 | ||
11497 | Get the subsizer (if any) that is managed by this sizer item. | |
11498 | """ | |
54f9ee45 | 11499 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce RD |
11500 | |
11501 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
11502 | """ |
11503 | SetSizer(self, Sizer sizer) | |
11504 | ||
11505 | Set the subsizer to be managed by this sizer item. | |
11506 | """ | |
54f9ee45 | 11507 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce RD |
11508 | |
11509 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
11510 | """ |
11511 | GetSpacer(self) -> Size | |
11512 | ||
11513 | Get the size of the spacer managed by this sizer item. | |
11514 | """ | |
54f9ee45 | 11515 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
e811c8ce RD |
11516 | |
11517 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
11518 | """ |
11519 | SetSpacer(self, Size size) | |
11520 | ||
11521 | Set the size of the spacer to be managed by this sizer item. | |
11522 | """ | |
54f9ee45 | 11523 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce RD |
11524 | |
11525 | def Show(*args, **kwargs): | |
248ed943 RD |
11526 | """ |
11527 | Show(self, bool show) | |
11528 | ||
11529 | Set the show item attribute, which sizers use to determine if the item | |
11530 | is to be made part of the layout or not. If the item is tracking a | |
11531 | window then it is shown or hidden as needed. | |
11532 | """ | |
54f9ee45 | 11533 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
11534 | |
11535 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11536 | """ |
11537 | IsShown(self) -> bool | |
11538 | ||
11539 | Is the item to be shown in the layout? | |
11540 | """ | |
54f9ee45 | 11541 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
11542 | |
11543 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11544 | """ |
11545 | GetPosition(self) -> Point | |
11546 | ||
11547 | Returns the current position of the item, as set in the last Layout. | |
11548 | """ | |
54f9ee45 | 11549 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
11550 | |
11551 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
11552 | """ |
11553 | GetUserData(self) -> PyObject | |
11554 | ||
11555 | Returns the userData associated with this sizer item, or None if there | |
11556 | isn't any. | |
11557 | """ | |
54f9ee45 | 11558 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 11559 | |
091f5bed RD |
11560 | def SetUserData(*args, **kwargs): |
11561 | """ | |
11562 | SetUserData(self, PyObject userData) | |
11563 | ||
11564 | Associate a Python object with this sizer item. | |
11565 | """ | |
11566 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
11567 | ||
33d6fd3b RD |
11568 | Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`") |
11569 | Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`") | |
11570 | MinSize = property(GetMinSize,doc="See `GetMinSize`") | |
11571 | MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`") | |
11572 | Position = property(GetPosition,doc="See `GetPosition`") | |
11573 | Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`") | |
11574 | Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`") | |
11575 | Rect = property(GetRect,doc="See `GetRect`") | |
11576 | Size = property(GetSize,doc="See `GetSize`") | |
11577 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
11578 | Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`") | |
11579 | UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`") | |
11580 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") | |
2131d850 | 11581 | _core_.SizerItem_swigregister(SizerItem) |
d14a1e28 | 11582 | |
248ed943 | 11583 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 11584 | """ |
248ed943 RD |
11585 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11586 | PyObject userData=None) -> SizerItem | |
11587 | ||
11588 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 11589 | """ |
248ed943 | 11590 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
11591 | return val |
11592 | ||
248ed943 | 11593 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 11594 | """ |
248ed943 RD |
11595 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
11596 | PyObject userData=None) -> SizerItem | |
11597 | ||
11598 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 11599 | """ |
248ed943 | 11600 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
11601 | return val |
11602 | ||
11603 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
11604 | """ |
11605 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
11606 | PyObject userData=None) -> SizerItem |
11607 | ||
11608 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 11609 | """ |
54f9ee45 | 11610 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
11611 | return val |
11612 | ||
11613 | class Sizer(Object): | |
248ed943 RD |
11614 | """ |
11615 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11616 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11617 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
1d5ee749 RD |
11618 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and |
11619 | `wx.GridBagSizer`. | |
248ed943 RD |
11620 | |
11621 | The concept implemented by sizers in wxWidgets is closely related to | |
11622 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11623 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11624 | subwindows reporting their minimal required size and their ability to | |
11625 | get stretched if the size of the parent window has changed. This will | |
11626 | most often mean that the programmer does not set the original size of | |
11627 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11628 | this sizer will be queried about the recommended size. The sizer in | |
11629 | turn will query its children, which can be normal windows or contorls, | |
11630 | empty space or other sizers, so that a hierarchy of sizers can be | |
11631 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11632 | do not interfere with tab ordering and requires very little resources | |
11633 | compared to a real window on screen. | |
11634 | ||
11635 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11636 | every control reports its own minimal size and the algorithm can | |
11637 | handle differences in font sizes or different window (dialog item) | |
11638 | sizes on different platforms without problems. If for example the | |
11639 | standard font as well as the overall design of Mac widgets requires | |
11640 | more space than on Windows, then the initial size of a dialog using a | |
11641 | sizer will automatically be bigger on Mac than on Windows. | |
11642 | """ | |
0085ce49 RD |
11643 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11644 | def __init__(self): raise AttributeError, "No constructor defined" | |
11645 | __repr__ = _swig_repr | |
11646 | __swig_destroy__ = _core_.delete_Sizer | |
11647 | __del__ = lambda self : None; | |
e811c8ce | 11648 | def _setOORInfo(*args, **kwargs): |
a95a7133 | 11649 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 11650 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
11651 | |
11652 | def Add(*args, **kwargs): | |
0df68c9f | 11653 | """ |
248ed943 | 11654 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11655 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11656 | |
11657 | Appends a child item to the sizer. | |
0df68c9f | 11658 | """ |
54f9ee45 | 11659 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce RD |
11660 | |
11661 | def Insert(*args, **kwargs): | |
0df68c9f | 11662 | """ |
248ed943 | 11663 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11664 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11665 | |
11666 | Inserts a new item into the list of items managed by this sizer before | |
11667 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 11668 | """ |
54f9ee45 | 11669 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce RD |
11670 | |
11671 | def Prepend(*args, **kwargs): | |
0df68c9f | 11672 | """ |
248ed943 | 11673 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11674 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11675 | |
11676 | Adds a new item to the begining of the list of sizer items managed by | |
11677 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 11678 | """ |
54f9ee45 | 11679 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce RD |
11680 | |
11681 | def Remove(*args, **kwargs): | |
248ed943 RD |
11682 | """ |
11683 | Remove(self, item) -> bool | |
11684 | ||
11685 | Removes an item from the sizer and destroys it. This method does not | |
11686 | cause any layout or resizing to take place, call `Layout` to update | |
11687 | the layout on screen after removing a child from the sizer. The | |
11688 | *item* parameter can be either a window, a sizer, or the zero-based | |
11689 | index of an item to remove. Returns True if the child item was found | |
11690 | and removed. | |
11691 | """ | |
54f9ee45 | 11692 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 11693 | |
1c0f361b | 11694 | def Detach(*args, **kwargs): |
248ed943 RD |
11695 | """ |
11696 | Detach(self, item) -> bool | |
11697 | ||
11698 | Detaches an item from the sizer without destroying it. This method | |
11699 | does not cause any layout or resizing to take place, call `Layout` to | |
11700 | do so. The *item* parameter can be either a window, a sizer, or the | |
11701 | zero-based index of the item to be detached. Returns True if the child item | |
11702 | was found and detached. | |
11703 | """ | |
1c0f361b RD |
11704 | return _core_.Sizer_Detach(*args, **kwargs) |
11705 | ||
d3b6e4ff RD |
11706 | def GetItem(*args, **kwargs): |
11707 | """ | |
11708 | GetItem(self, item) -> wx.SizerItem | |
11709 | ||
11710 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11711 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11712 | the item to be found. |
d3b6e4ff RD |
11713 | """ |
11714 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11715 | ||
e811c8ce | 11716 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 11717 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 11718 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 11719 | |
97ab0f6a RD |
11720 | def _ReplaceWin(*args, **kwargs): |
11721 | """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool""" | |
11722 | return _core_.Sizer__ReplaceWin(*args, **kwargs) | |
11723 | ||
11724 | def _ReplaceSizer(*args, **kwargs): | |
11725 | """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool""" | |
11726 | return _core_.Sizer__ReplaceSizer(*args, **kwargs) | |
11727 | ||
11728 | def _ReplaceItem(*args, **kwargs): | |
11729 | """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool""" | |
11730 | return _core_.Sizer__ReplaceItem(*args, **kwargs) | |
11731 | ||
11732 | def Replace(self, olditem, item, recursive=False): | |
11733 | """ | |
11734 | Detaches the given ``olditem`` from the sizer and replaces it with | |
11735 | ``item`` which can be a window, sizer, or `wx.SizerItem`. The | |
11736 | detached child is destroyed only if it is not a window, (because | |
11737 | windows are owned by their parent, not the sizer.) The | |
11738 | ``recursive`` parameter can be used to search for the given | |
11739 | element recursivly in subsizers. | |
11740 | ||
11741 | This method does not cause any layout or resizing to take place, | |
11742 | call `Layout` to do so. | |
11743 | ||
11744 | Returns ``True`` if the child item was found and removed. | |
11745 | """ | |
11746 | if isinstance(olditem, wx.Window): | |
11747 | return self._ReplaceWin(olditem, item, recursive) | |
11748 | elif isinstnace(olditem, wx.Sizer): | |
11749 | return self._ReplaceSizer(olditem, item, recursive) | |
11750 | elif isinstnace(olditem, int): | |
11751 | return self._ReplaceItem(olditem, item) | |
11752 | else: | |
11753 | raise TypeError("Expected Window, Sizer, or integer for first parameter.") | |
11754 | ||
11755 | def SetContainingWindow(*args, **kwargs): | |
11756 | """ | |
11757 | SetContainingWindow(self, Window window) | |
11758 | ||
11759 | Set (or unset) the window this sizer is used in. | |
11760 | """ | |
11761 | return _core_.Sizer_SetContainingWindow(*args, **kwargs) | |
11762 | ||
11763 | def GetContainingWindow(*args, **kwargs): | |
11764 | """ | |
11765 | GetContainingWindow(self) -> Window | |
11766 | ||
11767 | Get the window this sizer is used in. | |
11768 | """ | |
11769 | return _core_.Sizer_GetContainingWindow(*args, **kwargs) | |
11770 | ||
248ed943 RD |
11771 | def SetItemMinSize(self, item, *args): |
11772 | """ | |
11773 | SetItemMinSize(self, item, Size size) | |
11774 | ||
11775 | Sets the minimum size that will be allocated for an item in the sizer. | |
11776 | The *item* parameter can be either a window, a sizer, or the | |
11777 | zero-based index of the item. If a window or sizer is given then it | |
11778 | will be searched for recursivly in subsizers if neccessary. | |
11779 | """ | |
11780 | if len(args) == 2: | |
11781 | # for backward compatibility accept separate width,height args too | |
11782 | return self._SetItemMinSize(item, args) | |
11783 | else: | |
11784 | return self._SetItemMinSize(item, args[0]) | |
11785 | ||
e811c8ce | 11786 | def AddItem(*args, **kwargs): |
248ed943 RD |
11787 | """ |
11788 | AddItem(self, SizerItem item) | |
11789 | ||
11790 | Adds a `wx.SizerItem` to the sizer. | |
11791 | """ | |
54f9ee45 | 11792 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
11793 | |
11794 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11795 | """ |
11796 | InsertItem(self, int index, SizerItem item) | |
11797 | ||
11798 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11799 | """ | |
54f9ee45 | 11800 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
11801 | |
11802 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11803 | """ |
11804 | PrependItem(self, SizerItem item) | |
11805 | ||
11806 | Prepends a `wx.SizerItem` to the sizer. | |
11807 | """ | |
54f9ee45 | 11808 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 11809 | |
248ed943 | 11810 | def AddMany(self, items): |
66c033b4 RD |
11811 | """ |
11812 | AddMany is a convenience method for adding several items | |
11813 | to a sizer at one time. Simply pass it a list of tuples, | |
11814 | where each tuple consists of the parameters that you | |
11815 | would normally pass to the `Add` method. | |
11816 | """ | |
248ed943 RD |
11817 | for item in items: |
11818 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11819 | item = (item, ) | |
11820 | self.Add(*item) | |
d14a1e28 | 11821 | |
ae5bc7f3 RD |
11822 | def AddSpacer(self, *args, **kw): |
11823 | """AddSpacer(int size) --> SizerItem | |
11824 | ||
11825 | Add a spacer that is (size,size) pixels. | |
11826 | """ | |
11827 | if args and type(args[0]) == int: | |
11828 | return self.Add( (args[0],args[0] ), 0) | |
11829 | else: # otherwise stay compatible with old AddSpacer | |
11830 | return self.Add(*args, **kw) | |
11831 | def PrependSpacer(self, *args, **kw): | |
11832 | """PrependSpacer(int size) --> SizerItem | |
11833 | ||
11834 | Prepend a spacer that is (size, size) pixels.""" | |
11835 | if args and type(args[0]) == int: | |
11836 | return self.Prepend( (args[0],args[0] ), 0) | |
11837 | else: # otherwise stay compatible with old PrependSpacer | |
11838 | return self.Prepend(*args, **kw) | |
11839 | def InsertSpacer(self, index, *args, **kw): | |
11840 | """InsertSpacer(int index, int size) --> SizerItem | |
11841 | ||
11842 | Insert a spacer at position index that is (size, size) pixels.""" | |
11843 | if args and type(args[0]) == int: | |
11844 | return self.Insert( index, (args[0],args[0] ), 0) | |
11845 | else: # otherwise stay compatible with old InsertSpacer | |
11846 | return self.Insert(index, *args, **kw) | |
11847 | ||
11848 | ||
11849 | def AddStretchSpacer(self, prop=1): | |
11850 | """AddStretchSpacer(int prop=1) --> SizerItem | |
11851 | ||
11852 | Add a stretchable spacer.""" | |
11853 | return self.Add((0,0), prop) | |
11854 | def PrependStretchSpacer(self, prop=1): | |
11855 | """PrependStretchSpacer(int prop=1) --> SizerItem | |
11856 | ||
11857 | Prepend a stretchable spacer.""" | |
11858 | return self.Prepend((0,0), prop) | |
11859 | def InsertStretchSpacer(self, index, prop=1): | |
11860 | """InsertStretchSpacer(int index, int prop=1) --> SizerItem | |
11861 | ||
11862 | Insert a stretchable spacer.""" | |
11863 | return self.Insert(index, (0,0), prop) | |
11864 | ||
11865 | ||
74e96f3d | 11866 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
11867 | def AddWindow(self, *args, **kw): |
11868 | """Compatibility alias for `Add`.""" | |
11869 | return self.Add(*args, **kw) | |
11870 | def AddSizer(self, *args, **kw): | |
11871 | """Compatibility alias for `Add`.""" | |
11872 | return self.Add(*args, **kw) | |
b9d6a5f3 RD |
11873 | |
11874 | def PrependWindow(self, *args, **kw): | |
11875 | """Compatibility alias for `Prepend`.""" | |
11876 | return self.Prepend(*args, **kw) | |
11877 | def PrependSizer(self, *args, **kw): | |
11878 | """Compatibility alias for `Prepend`.""" | |
11879 | return self.Prepend(*args, **kw) | |
b9d6a5f3 RD |
11880 | |
11881 | def InsertWindow(self, *args, **kw): | |
11882 | """Compatibility alias for `Insert`.""" | |
11883 | return self.Insert(*args, **kw) | |
11884 | def InsertSizer(self, *args, **kw): | |
11885 | """Compatibility alias for `Insert`.""" | |
b9d6a5f3 RD |
11886 | return self.Insert(*args, **kw) |
11887 | ||
11888 | def RemoveWindow(self, *args, **kw): | |
11889 | """Compatibility alias for `Remove`.""" | |
11890 | return self.Remove(*args, **kw) | |
11891 | def RemoveSizer(self, *args, **kw): | |
11892 | """Compatibility alias for `Remove`.""" | |
11893 | return self.Remove(*args, **kw) | |
11894 | def RemovePos(self, *args, **kw): | |
11895 | """Compatibility alias for `Remove`.""" | |
11896 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
11897 | |
11898 | ||
e811c8ce | 11899 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11900 | """ |
11901 | SetDimension(self, int x, int y, int width, int height) | |
11902 | ||
11903 | Call this to force the sizer to take the given dimension and thus | |
11904 | force the items owned by the sizer to resize themselves according to | |
11905 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11906 | methods. | |
11907 | """ | |
54f9ee45 | 11908 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
11909 | |
11910 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11911 | """ |
11912 | SetMinSize(self, Size size) | |
11913 | ||
11914 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11915 | calculate its minimal size based purely on how much space its children | |
11916 | need. After calling this method `GetMinSize` will return either the | |
11917 | minimal size as requested by its children or the minimal size set | |
11918 | here, depending on which is bigger. | |
11919 | """ | |
54f9ee45 | 11920 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
11921 | |
11922 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11923 | """ |
11924 | GetSize(self) -> Size | |
11925 | ||
11926 | Returns the current size of the space managed by the sizer. | |
11927 | """ | |
54f9ee45 | 11928 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
11929 | |
11930 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11931 | """ |
11932 | GetPosition(self) -> Point | |
11933 | ||
11934 | Returns the current position of the sizer's managed space. | |
11935 | """ | |
54f9ee45 | 11936 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
11937 | |
11938 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11939 | """ |
11940 | GetMinSize(self) -> Size | |
11941 | ||
11942 | Returns the minimal size of the sizer. This is either the combined | |
11943 | minimal size of all the children and their borders or the minimal size | |
11944 | set by SetMinSize, depending on which is bigger. | |
11945 | """ | |
54f9ee45 | 11946 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 11947 | |
d14a1e28 | 11948 | def GetSizeTuple(self): |
1c0f361b | 11949 | return self.GetSize().Get() |
d14a1e28 | 11950 | def GetPositionTuple(self): |
1c0f361b | 11951 | return self.GetPosition().Get() |
d14a1e28 | 11952 | def GetMinSizeTuple(self): |
1c0f361b | 11953 | return self.GetMinSize().Get() |
d14a1e28 | 11954 | |
e811c8ce | 11955 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
11956 | """ |
11957 | RecalcSizes(self) | |
11958 | ||
11959 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11960 | items managed by this sizer. You should not need to call this directly as | |
11961 | it is called by `Layout`. | |
11962 | """ | |
54f9ee45 | 11963 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
11964 | |
11965 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11966 | """ |
11967 | CalcMin(self) -> Size | |
11968 | ||
11969 | This method is where the sizer will do the actual calculation of its | |
11970 | children's minimal sizes. You should not need to call this directly as | |
11971 | it is called by `Layout`. | |
11972 | """ | |
54f9ee45 | 11973 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
11974 | |
11975 | def Layout(*args, **kwargs): | |
248ed943 RD |
11976 | """ |
11977 | Layout(self) | |
11978 | ||
11979 | This method will force the recalculation and layout of the items | |
11980 | controlled by the sizer using the current space allocated to the | |
11981 | sizer. Normally this is called automatically from the owning window's | |
11982 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11983 | one of the items in a sizer change size, or items are added or | |
11984 | removed. | |
11985 | """ | |
54f9ee45 | 11986 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
11987 | |
11988 | def Fit(*args, **kwargs): | |
248ed943 RD |
11989 | """ |
11990 | Fit(self, Window window) -> Size | |
11991 | ||
11992 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11993 | size. This is commonly done in the constructor of the window itself in | |
11994 | order to set its initial size to match the needs of the children as | |
11995 | determined by the sizer. Returns the new size. | |
11996 | ||
11997 | For a top level window this is the total window size, not the client size. | |
11998 | """ | |
54f9ee45 | 11999 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
12000 | |
12001 | def FitInside(*args, **kwargs): | |
248ed943 RD |
12002 | """ |
12003 | FitInside(self, Window window) | |
12004 | ||
12005 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
12006 | sizer's minimal size. This will not alter the on screen size of the | |
12007 | window, but may cause the addition/removal/alteration of scrollbars | |
12008 | required to view the virtual area in windows which manage it. | |
12009 | ||
12010 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
12011 | ||
12012 | """ | |
54f9ee45 | 12013 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
12014 | |
12015 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
12016 | """ |
12017 | SetSizeHints(self, Window window) | |
12018 | ||
12019 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
12020 | match the sizer's minimal size. This is commonly done in the | |
12021 | constructor of the window itself if the window is resizable (as are | |
12022 | many dialogs under Unix and frames on probably all platforms) in order | |
12023 | to prevent the window from being sized smaller than the minimal size | |
12024 | required by the sizer. | |
12025 | """ | |
54f9ee45 | 12026 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
12027 | |
12028 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
12029 | """ |
12030 | SetVirtualSizeHints(self, Window window) | |
12031 | ||
12032 | Tell the sizer to set the minimal size of the window virtual area to | |
12033 | match the sizer's minimal size. For windows with managed scrollbars | |
12034 | this will set them appropriately. | |
12035 | ||
12036 | :see: `wx.ScrolledWindow.SetScrollbars` | |
12037 | ||
12038 | """ | |
54f9ee45 | 12039 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
12040 | |
12041 | def Clear(*args, **kwargs): | |
248ed943 RD |
12042 | """ |
12043 | Clear(self, bool deleteWindows=False) | |
12044 | ||
12045 | Clear all items from the sizer, optionally destroying the window items | |
12046 | as well. | |
12047 | """ | |
54f9ee45 | 12048 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
12049 | |
12050 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
12051 | """ |
12052 | DeleteWindows(self) | |
12053 | ||
12054 | Destroy all windows managed by the sizer. | |
12055 | """ | |
54f9ee45 | 12056 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
12057 | |
12058 | def GetChildren(*args, **kwargs): | |
248ed943 | 12059 | """ |
51b83b37 | 12060 | GetChildren(self) -> list |
248ed943 RD |
12061 | |
12062 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
12063 | """ | |
54f9ee45 | 12064 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
12065 | |
12066 | def Show(*args, **kwargs): | |
248ed943 | 12067 | """ |
ae8162c8 | 12068 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 12069 | |
248ed943 RD |
12070 | Shows or hides an item managed by the sizer. To make a sizer item |
12071 | disappear or reappear, use Show followed by `Layout`. The *item* | |
12072 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
12073 | the item. Use the recursive parameter to show or hide an item in a |
12074 | subsizer. Returns True if the item was found. | |
248ed943 RD |
12075 | """ |
12076 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
12077 | |
12078 | def IsShown(*args, **kwargs): | |
248ed943 RD |
12079 | """ |
12080 | IsShown(self, item) | |
12081 | ||
b1fcee84 | 12082 | Determines if the item is currently shown. To make a sizer |
248ed943 RD |
12083 | item disappear or reappear, use Show followed by `Layout`. The *item* |
12084 | parameter can be either a window, a sizer, or the zero-based index of | |
12085 | the item. | |
12086 | """ | |
54f9ee45 | 12087 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 12088 | |
7e63a440 | 12089 | def Hide(self, item, recursive=False): |
248ed943 | 12090 | """ |
27fb7603 | 12091 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 12092 | """ |
06759a38 | 12093 | return self.Show(item, False, recursive) |
248ed943 | 12094 | |
e811c8ce | 12095 | def ShowItems(*args, **kwargs): |
248ed943 RD |
12096 | """ |
12097 | ShowItems(self, bool show) | |
12098 | ||
84f85550 | 12099 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 12100 | """ |
54f9ee45 | 12101 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 12102 | |
33d6fd3b RD |
12103 | Children = property(GetChildren,doc="See `GetChildren`") |
12104 | ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`") | |
12105 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
12106 | Position = property(GetPosition,doc="See `GetPosition`") | |
12107 | Size = property(GetSize,doc="See `GetSize`") | |
2131d850 | 12108 | _core_.Sizer_swigregister(Sizer) |
d14a1e28 RD |
12109 | |
12110 | class PySizer(Sizer): | |
248ed943 RD |
12111 | """ |
12112 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12113 | instrumented to allow the C++ virtual methods to be overloaded in | |
12114 | Python derived classes. You would derive from this class if you are | |
12115 | wanting to implement a custom sizer in Python code. Simply implement | |
12116 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12117 | For example:: | |
12118 | ||
12119 | class MySizer(wx.PySizer): | |
12120 | def __init__(self): | |
12121 | wx.PySizer.__init__(self) | |
12122 | ||
12123 | def CalcMin(self): | |
12124 | for item in self.GetChildren(): | |
12125 | # calculate the total minimum width and height needed | |
12126 | # by all items in the sizer according to this sizer's | |
12127 | # layout algorithm. | |
12128 | ... | |
12129 | return wx.Size(width, height) | |
12130 | ||
12131 | def RecalcSizes(self): | |
12132 | # find the space allotted to this sizer | |
12133 | pos = self.GetPosition() | |
12134 | size = self.GetSize() | |
12135 | for item in self.GetChildren(): | |
12136 | # Recalculate (if necessary) the position and size of | |
12137 | # each item and then call item.SetDimension to do the | |
12138 | # actual positioning and sizing of the items within the | |
12139 | # space alloted to this sizer. | |
12140 | ... | |
12141 | item.SetDimension(itemPos, itemSize) | |
12142 | ||
12143 | ||
12144 | When `Layout` is called it first calls `CalcMin` followed by | |
12145 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 12146 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
12147 | |
12148 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12149 | ||
12150 | ||
12151 | """ | |
0085ce49 RD |
12152 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12153 | __repr__ = _swig_repr | |
12154 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12155 | """ |
12156 | __init__(self) -> PySizer | |
12157 | ||
12158 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12159 | class. | |
12160 | """ | |
0085ce49 | 12161 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
d14a1e28 | 12162 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) |
e811c8ce RD |
12163 | |
12164 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 12165 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 12166 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 12167 | |
2131d850 | 12168 | _core_.PySizer_swigregister(PySizer) |
d14a1e28 RD |
12169 | |
12170 | #--------------------------------------------------------------------------- | |
12171 | ||
12172 | class BoxSizer(Sizer): | |
248ed943 RD |
12173 | """ |
12174 | The basic idea behind a box sizer is that windows will most often be | |
12175 | laid out in rather simple basic geometry, typically in a row or a | |
12176 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12177 | its items in a simple row or column, depending on the orientation | |
12178 | parameter passed to the constructor. | |
12179 | """ | |
0085ce49 RD |
12180 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12181 | __repr__ = _swig_repr | |
12182 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12183 | """ |
12184 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
12185 | ||
12186 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12187 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12188 | sizer. | |
12189 | """ | |
0085ce49 | 12190 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d14a1e28 | 12191 | self._setOORInfo(self) |
e811c8ce RD |
12192 | |
12193 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
12194 | """ |
12195 | GetOrientation(self) -> int | |
12196 | ||
12197 | Returns the current orientation of the sizer. | |
12198 | """ | |
54f9ee45 | 12199 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
12200 | |
12201 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
12202 | """ |
12203 | SetOrientation(self, int orient) | |
e811c8ce | 12204 | |
248ed943 RD |
12205 | Resets the orientation of the sizer. |
12206 | """ | |
12207 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 12208 | |
2bf58437 | 12209 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
2131d850 | 12210 | _core_.BoxSizer_swigregister(BoxSizer) |
d14a1e28 RD |
12211 | |
12212 | #--------------------------------------------------------------------------- | |
12213 | ||
12214 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
12215 | """ |
12216 | wx.StaticBoxSizer derives from and functions identically to the | |
12217 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12218 | manages. Note that this static box must be created separately and | |
12219 | passed to the sizer constructor. | |
12220 | """ | |
0085ce49 RD |
12221 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12222 | __repr__ = _swig_repr | |
12223 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12224 | """ |
12225 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
12226 | ||
12227 | Constructor. It takes an associated static box and the orientation | |
12228 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12229 | ``wx.HORIZONTAL``. | |
12230 | """ | |
0085ce49 | 12231 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d14a1e28 | 12232 | self._setOORInfo(self) |
e811c8ce RD |
12233 | |
12234 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
12235 | """ |
12236 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 12237 | |
248ed943 RD |
12238 | Returns the static box associated with this sizer. |
12239 | """ | |
12240 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 12241 | |
33d6fd3b | 12242 | StaticBox = property(GetStaticBox,doc="See `GetStaticBox`") |
2131d850 | 12243 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d14a1e28 RD |
12244 | |
12245 | #--------------------------------------------------------------------------- | |
12246 | ||
12247 | class GridSizer(Sizer): | |
248ed943 RD |
12248 | """ |
12249 | A grid sizer is a sizer which lays out its children in a | |
12250 | two-dimensional table with all cells having the same size. In other | |
12251 | words, the width of each cell within the grid is the width of the | |
12252 | widest item added to the sizer and the height of each grid cell is the | |
12253 | height of the tallest item. An optional vertical and/or horizontal | |
12254 | gap between items can also be specified (in pixels.) | |
12255 | ||
12256 | Items are placed in the cells of the grid in the order they are added, | |
12257 | in row-major order. In other words, the first row is filled first, | |
12258 | then the second, and so on until all items have been added. (If | |
12259 | neccessary, additional rows will be added as items are added.) If you | |
12260 | need to have greater control over the cells that items are placed in | |
12261 | then use the `wx.GridBagSizer`. | |
12262 | ||
12263 | """ | |
0085ce49 RD |
12264 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12265 | __repr__ = _swig_repr | |
12266 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12267 | """ |
12268 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
12269 | ||
12270 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12271 | of columns and rows in the sizer - if either of the parameters is | |
12272 | zero, it will be calculated to from the total number of children in | |
12273 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12274 | define extra space between all children. | |
12275 | """ | |
0085ce49 | 12276 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d14a1e28 | 12277 | self._setOORInfo(self) |
e811c8ce | 12278 | |
e811c8ce | 12279 | def SetCols(*args, **kwargs): |
248ed943 RD |
12280 | """ |
12281 | SetCols(self, int cols) | |
12282 | ||
12283 | Sets the number of columns in the sizer. | |
12284 | """ | |
54f9ee45 | 12285 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
12286 | |
12287 | def SetRows(*args, **kwargs): | |
248ed943 RD |
12288 | """ |
12289 | SetRows(self, int rows) | |
12290 | ||
12291 | Sets the number of rows in the sizer. | |
12292 | """ | |
54f9ee45 | 12293 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
12294 | |
12295 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
12296 | """ |
12297 | SetVGap(self, int gap) | |
12298 | ||
12299 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12300 | """ | |
54f9ee45 | 12301 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
12302 | |
12303 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
12304 | """ |
12305 | SetHGap(self, int gap) | |
12306 | ||
12307 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12308 | """ | |
54f9ee45 | 12309 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
12310 | |
12311 | def GetCols(*args, **kwargs): | |
248ed943 RD |
12312 | """ |
12313 | GetCols(self) -> int | |
12314 | ||
12315 | Returns the number of columns in the sizer. | |
12316 | """ | |
54f9ee45 | 12317 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
12318 | |
12319 | def GetRows(*args, **kwargs): | |
248ed943 RD |
12320 | """ |
12321 | GetRows(self) -> int | |
12322 | ||
12323 | Returns the number of rows in the sizer. | |
12324 | """ | |
54f9ee45 | 12325 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
12326 | |
12327 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
12328 | """ |
12329 | GetVGap(self) -> int | |
12330 | ||
12331 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12332 | """ | |
54f9ee45 | 12333 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
12334 | |
12335 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
12336 | """ |
12337 | GetHGap(self) -> int | |
12338 | ||
12339 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12340 | """ | |
54f9ee45 | 12341 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 12342 | |
0085ce49 RD |
12343 | def CalcRowsCols(self): |
12344 | """ | |
12345 | CalcRowsCols() -> (rows, cols) | |
12346 | ||
12347 | Calculates how many rows and columns will be in the sizer based | |
12348 | on the current number of items and also the rows, cols specified | |
12349 | in the constructor. | |
12350 | """ | |
12351 | nitems = len(self.GetChildren()) | |
12352 | rows = self.GetRows() | |
12353 | cols = self.GetCols() | |
12354 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
12355 | if cols != 0: | |
12356 | rows = (nitems + cols - 1) / cols | |
12357 | elif rows != 0: | |
12358 | cols = (nitems + rows - 1) / rows | |
12359 | return (rows, cols) | |
d14a1e28 | 12360 | |
97ab0f6a RD |
12361 | Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`") |
12362 | HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`") | |
12363 | Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`") | |
12364 | VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`") | |
2131d850 | 12365 | _core_.GridSizer_swigregister(GridSizer) |
d14a1e28 RD |
12366 | |
12367 | #--------------------------------------------------------------------------- | |
12368 | ||
54f9ee45 RD |
12369 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
12370 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12371 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 12372 | class FlexGridSizer(GridSizer): |
248ed943 RD |
12373 | """ |
12374 | A flex grid sizer is a sizer which lays out its children in a | |
12375 | two-dimensional table with all table cells in one row having the same | |
12376 | height and all cells in one column having the same width, but all | |
12377 | rows or all columns are not necessarily the same height or width as in | |
12378 | the `wx.GridSizer`. | |
12379 | ||
12380 | wx.FlexGridSizer can also size items equally in one direction but | |
12381 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12382 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12383 | needs to be decided how the sizer should grow in the other ("non | |
12384 | flexible") direction in order to fill the available space. The | |
12385 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12386 | ||
12387 | ||
12388 | """ | |
0085ce49 RD |
12389 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12390 | __repr__ = _swig_repr | |
12391 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12392 | """ |
12393 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
12394 | ||
12395 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12396 | number of columns and rows in the sizer - if either of the parameters | |
12397 | is zero, it will be calculated to from the total number of children in | |
12398 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12399 | define extra space between all children. | |
12400 | """ | |
0085ce49 | 12401 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d14a1e28 | 12402 | self._setOORInfo(self) |
e811c8ce | 12403 | |
248ed943 RD |
12404 | def AddGrowableRow(*args, **kwargs): |
12405 | """ | |
12406 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 12407 | |
248ed943 RD |
12408 | Specifies that row *idx* (starting from zero) should be grown if there |
12409 | is extra space available to the sizer. | |
e811c8ce | 12410 | |
248ed943 RD |
12411 | The *proportion* parameter has the same meaning as the stretch factor |
12412 | for the box sizers except that if all proportions are 0, then all | |
12413 | columns are resized equally (instead of not being resized at all). | |
12414 | """ | |
54f9ee45 | 12415 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
12416 | |
12417 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
12418 | """ |
12419 | RemoveGrowableRow(self, size_t idx) | |
12420 | ||
12421 | Specifies that row *idx* is no longer growable. | |
12422 | """ | |
54f9ee45 | 12423 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
12424 | |
12425 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
12426 | """ |
12427 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12428 | ||
12429 | Specifies that column *idx* (starting from zero) should be grown if | |
12430 | there is extra space available to the sizer. | |
12431 | ||
12432 | The *proportion* parameter has the same meaning as the stretch factor | |
12433 | for the box sizers except that if all proportions are 0, then all | |
12434 | columns are resized equally (instead of not being resized at all). | |
12435 | """ | |
54f9ee45 | 12436 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
12437 | |
12438 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
12439 | """ |
12440 | RemoveGrowableCol(self, size_t idx) | |
12441 | ||
12442 | Specifies that column *idx* is no longer growable. | |
12443 | """ | |
54f9ee45 | 12444 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
12445 | |
12446 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12447 | """ |
12448 | SetFlexibleDirection(self, int direction) | |
12449 | ||
12450 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12451 | or both. Argument *direction* can be one of the following values. Any | |
12452 | other value is ignored. | |
12453 | ||
12454 | ============== ======================================= | |
12455 | wx.VERTICAL Rows are flexibly sized. | |
12456 | wx.HORIZONTAL Columns are flexibly sized. | |
12457 | wx.BOTH Both rows and columns are flexibly sized | |
12458 | (this is the default value). | |
12459 | ============== ======================================= | |
12460 | ||
12461 | Note that this method does not trigger relayout. | |
12462 | ||
12463 | """ | |
54f9ee45 | 12464 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12465 | |
12466 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12467 | """ |
12468 | GetFlexibleDirection(self) -> int | |
12469 | ||
12470 | Returns a value that specifies whether the sizer | |
12471 | flexibly resizes its columns, rows, or both (default). | |
12472 | ||
12473 | :see: `SetFlexibleDirection` | |
12474 | """ | |
54f9ee45 | 12475 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12476 | |
12477 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12478 | """ |
12479 | SetNonFlexibleGrowMode(self, int mode) | |
12480 | ||
12481 | Specifies how the sizer should grow in the non-flexible direction if | |
12482 | there is one (so `SetFlexibleDirection` must have been called | |
12483 | previously). Argument *mode* can be one of the following values: | |
12484 | ||
12485 | ========================== ================================================= | |
12486 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12487 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12488 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12489 | case equal sizing applies to minimum sizes of | |
12490 | columns or rows (this is the default value). | |
12491 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12492 | the non flexible direction, whether they are | |
12493 | growable or not in the flexbile direction. | |
12494 | ========================== ================================================= | |
12495 | ||
12496 | Note that this method does not trigger relayout. | |
248ed943 | 12497 | """ |
54f9ee45 | 12498 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12499 | |
12500 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12501 | """ |
12502 | GetNonFlexibleGrowMode(self) -> int | |
12503 | ||
12504 | Returns the value that specifies how the sizer grows in the | |
12505 | non-flexible direction if there is one. | |
12506 | ||
12507 | :see: `SetNonFlexibleGrowMode` | |
12508 | """ | |
54f9ee45 | 12509 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12510 | |
12511 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12512 | """ |
12513 | GetRowHeights(self) -> list | |
12514 | ||
12515 | Returns a list of integers representing the heights of each of the | |
12516 | rows in the sizer. | |
12517 | """ | |
54f9ee45 | 12518 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
12519 | |
12520 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12521 | """ |
12522 | GetColWidths(self) -> list | |
12523 | ||
12524 | Returns a list of integers representing the widths of each of the | |
12525 | columns in the sizer. | |
12526 | """ | |
54f9ee45 | 12527 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 12528 | |
97ab0f6a RD |
12529 | ColWidths = property(GetColWidths,doc="See `GetColWidths`") |
12530 | FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`") | |
12531 | NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`") | |
12532 | RowHeights = property(GetRowHeights,doc="See `GetRowHeights`") | |
2131d850 | 12533 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d14a1e28 | 12534 | |
e505d15e RD |
12535 | class StdDialogButtonSizer(BoxSizer): |
12536 | """ | |
12537 | A special sizer that knows how to order and position standard buttons | |
12538 | in order to conform to the current platform's standards. You simply | |
12539 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12540 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
12541 | will take care of the rest. |
12542 | ||
12543 | """ | |
0085ce49 RD |
12544 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12545 | __repr__ = _swig_repr | |
12546 | def __init__(self, *args, **kwargs): | |
e505d15e | 12547 | """__init__(self) -> StdDialogButtonSizer""" |
0085ce49 | 12548 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
e505d15e RD |
12549 | def AddButton(*args, **kwargs): |
12550 | """ | |
12551 | AddButton(self, wxButton button) | |
12552 | ||
12553 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12554 | method in the base class. | |
12555 | """ | |
12556 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
12557 | ||
53aa7709 | 12558 | def Realize(*args, **kwargs): |
e505d15e | 12559 | """ |
53aa7709 | 12560 | Realize(self) |
e505d15e RD |
12561 | |
12562 | This funciton needs to be called after all the buttons have been added | |
12563 | to the sizer. It will reorder them and position them in a platform | |
12564 | specifc manner. | |
12565 | """ | |
53aa7709 | 12566 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12567 | |
12568 | def SetAffirmativeButton(*args, **kwargs): | |
12569 | """SetAffirmativeButton(self, wxButton button)""" | |
12570 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
12571 | ||
12572 | def SetNegativeButton(*args, **kwargs): | |
12573 | """SetNegativeButton(self, wxButton button)""" | |
12574 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
12575 | ||
12576 | def SetCancelButton(*args, **kwargs): | |
12577 | """SetCancelButton(self, wxButton button)""" | |
12578 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
12579 | |
12580 | def GetAffirmativeButton(*args, **kwargs): | |
12581 | """GetAffirmativeButton(self) -> wxButton""" | |
12582 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
12583 | ||
12584 | def GetApplyButton(*args, **kwargs): | |
12585 | """GetApplyButton(self) -> wxButton""" | |
12586 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
12587 | ||
12588 | def GetNegativeButton(*args, **kwargs): | |
12589 | """GetNegativeButton(self) -> wxButton""" | |
12590 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
12591 | ||
12592 | def GetCancelButton(*args, **kwargs): | |
12593 | """GetCancelButton(self) -> wxButton""" | |
12594 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
12595 | ||
12596 | def GetHelpButton(*args, **kwargs): | |
12597 | """GetHelpButton(self) -> wxButton""" | |
12598 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
12599 | ||
33d6fd3b RD |
12600 | AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`") |
12601 | ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`") | |
12602 | CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`") | |
12603 | HelpButton = property(GetHelpButton,doc="See `GetHelpButton`") | |
12604 | NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`") | |
2131d850 | 12605 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
e505d15e | 12606 | |
d14a1e28 RD |
12607 | #--------------------------------------------------------------------------- |
12608 | ||
12609 | class GBPosition(object): | |
248ed943 RD |
12610 | """ |
12611 | This class represents the position of an item in a virtual grid of | |
12612 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12613 | typemaps that will automatically convert from a 2-element sequence of | |
12614 | integers to a wx.GBPosition, so you can use the more pythonic | |
12615 | representation of the position nearly transparently in Python code. | |
12616 | """ | |
0085ce49 RD |
12617 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12618 | __repr__ = _swig_repr | |
12619 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12620 | """ |
12621 | __init__(self, int row=0, int col=0) -> GBPosition | |
12622 | ||
12623 | This class represents the position of an item in a virtual grid of | |
12624 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12625 | typemaps that will automatically convert from a 2-element sequence of | |
12626 | integers to a wx.GBPosition, so you can use the more pythonic | |
12627 | representation of the position nearly transparently in Python code. | |
12628 | """ | |
0085ce49 RD |
12629 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
12630 | __swig_destroy__ = _core_.delete_GBPosition | |
12631 | __del__ = lambda self : None; | |
e811c8ce | 12632 | def GetRow(*args, **kwargs): |
a95a7133 | 12633 | """GetRow(self) -> int""" |
54f9ee45 | 12634 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
12635 | |
12636 | def GetCol(*args, **kwargs): | |
a95a7133 | 12637 | """GetCol(self) -> int""" |
54f9ee45 | 12638 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
12639 | |
12640 | def SetRow(*args, **kwargs): | |
a95a7133 | 12641 | """SetRow(self, int row)""" |
54f9ee45 | 12642 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
12643 | |
12644 | def SetCol(*args, **kwargs): | |
a95a7133 | 12645 | """SetCol(self, int col)""" |
54f9ee45 | 12646 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
12647 | |
12648 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12649 | """ |
12650 | __eq__(self, PyObject other) -> bool | |
12651 | ||
12652 | Compare GBPosition for equality. | |
12653 | """ | |
54f9ee45 | 12654 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
12655 | |
12656 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12657 | """ |
12658 | __ne__(self, PyObject other) -> bool | |
12659 | ||
12660 | Compare GBPosition for inequality. | |
12661 | """ | |
54f9ee45 | 12662 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
12663 | |
12664 | def Set(*args, **kwargs): | |
a95a7133 | 12665 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 12666 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
12667 | |
12668 | def Get(*args, **kwargs): | |
a95a7133 | 12669 | """Get(self) -> PyObject""" |
54f9ee45 | 12670 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 12671 | |
41e2b43e | 12672 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12673 | def __str__(self): return str(self.Get()) |
12674 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12675 | def __len__(self): return len(self.Get()) | |
12676 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12677 | def __setitem__(self, index, val): |
12678 | if index == 0: self.SetRow(val) | |
12679 | elif index == 1: self.SetCol(val) | |
12680 | else: raise IndexError | |
e811c8ce | 12681 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12682 | __safe_for_unpickling__ = True |
12683 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
12684 | |
12685 | row = property(GetRow, SetRow) | |
12686 | col = property(GetCol, SetCol) | |
12687 | ||
2131d850 | 12688 | _core_.GBPosition_swigregister(GBPosition) |
d14a1e28 RD |
12689 | |
12690 | class GBSpan(object): | |
248ed943 RD |
12691 | """ |
12692 | This class is used to hold the row and column spanning attributes of | |
12693 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12694 | automatically convert from a 2-element sequence of integers to a | |
12695 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12696 | nearly transparently in Python code. | |
12697 | ||
12698 | """ | |
0085ce49 RD |
12699 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12700 | __repr__ = _swig_repr | |
12701 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12702 | """ |
12703 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
12704 | ||
12705 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12706 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12707 | cell in each direction. | |
12708 | """ | |
0085ce49 RD |
12709 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
12710 | __swig_destroy__ = _core_.delete_GBSpan | |
12711 | __del__ = lambda self : None; | |
e811c8ce | 12712 | def GetRowspan(*args, **kwargs): |
a95a7133 | 12713 | """GetRowspan(self) -> int""" |
54f9ee45 | 12714 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
12715 | |
12716 | def GetColspan(*args, **kwargs): | |
a95a7133 | 12717 | """GetColspan(self) -> int""" |
54f9ee45 | 12718 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
12719 | |
12720 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 12721 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 12722 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
12723 | |
12724 | def SetColspan(*args, **kwargs): | |
a95a7133 | 12725 | """SetColspan(self, int colspan)""" |
54f9ee45 | 12726 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
12727 | |
12728 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12729 | """ |
12730 | __eq__(self, PyObject other) -> bool | |
12731 | ||
12732 | Compare wxGBSpan for equality. | |
12733 | """ | |
54f9ee45 | 12734 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
12735 | |
12736 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12737 | """ |
12738 | __ne__(self, PyObject other) -> bool | |
12739 | ||
12740 | Compare GBSpan for inequality. | |
12741 | """ | |
54f9ee45 | 12742 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
12743 | |
12744 | def Set(*args, **kwargs): | |
a95a7133 | 12745 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 12746 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
12747 | |
12748 | def Get(*args, **kwargs): | |
a95a7133 | 12749 | """Get(self) -> PyObject""" |
54f9ee45 | 12750 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 12751 | |
41e2b43e | 12752 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12753 | def __str__(self): return str(self.Get()) |
12754 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12755 | def __len__(self): return len(self.Get()) | |
12756 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12757 | def __setitem__(self, index, val): |
12758 | if index == 0: self.SetRowspan(val) | |
12759 | elif index == 1: self.SetColspan(val) | |
12760 | else: raise IndexError | |
e811c8ce | 12761 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12762 | __safe_for_unpickling__ = True |
12763 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
12764 | |
12765 | rowspan = property(GetRowspan, SetRowspan) | |
12766 | colspan = property(GetColspan, SetColspan) | |
12767 | ||
2131d850 | 12768 | _core_.GBSpan_swigregister(GBSpan) |
d14a1e28 RD |
12769 | |
12770 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12771 | """ |
12772 | The wx.GBSizerItem class is used to track the additional data about | |
12773 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12774 | and how many rows or columns it spans. | |
12775 | ||
12776 | """ | |
0085ce49 RD |
12777 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12778 | __repr__ = _swig_repr | |
12779 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12780 | """ |
12781 | __init__(self) -> GBSizerItem | |
12782 | ||
12783 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12784 | size will need to be set, as well as a position and span before this | |
12785 | item can be used in a Sizer. | |
12786 | ||
12787 | You will probably never need to create a wx.GBSizerItem directly as they | |
12788 | are created automatically when the sizer's Add method is called. | |
12789 | """ | |
0085ce49 RD |
12790 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
12791 | __swig_destroy__ = _core_.delete_GBSizerItem | |
12792 | __del__ = lambda self : None; | |
e811c8ce | 12793 | def GetPos(*args, **kwargs): |
248ed943 RD |
12794 | """ |
12795 | GetPos(self) -> GBPosition | |
12796 | ||
12797 | Get the grid position of the item | |
12798 | """ | |
54f9ee45 | 12799 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
12800 | |
12801 | def GetPosTuple(self): return self.GetPos().Get() | |
12802 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12803 | """ |
12804 | GetSpan(self) -> GBSpan | |
12805 | ||
12806 | Get the row and column spanning of the item | |
12807 | """ | |
54f9ee45 | 12808 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
12809 | |
12810 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12811 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12812 | """ |
12813 | SetPos(self, GBPosition pos) -> bool | |
12814 | ||
12815 | If the item is already a member of a sizer then first ensure that | |
12816 | there is no other item that would intersect with this one at the new | |
12817 | position, then set the new position. Returns True if the change is | |
12818 | successful and after the next Layout() the item will be moved. | |
12819 | """ | |
54f9ee45 | 12820 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
12821 | |
12822 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12823 | """ |
12824 | SetSpan(self, GBSpan span) -> bool | |
12825 | ||
12826 | If the item is already a member of a sizer then first ensure that | |
12827 | there is no other item that would intersect with this one with its new | |
12828 | spanning size, then set the new spanning. Returns True if the change | |
12829 | is successful and after the next Layout() the item will be resized. | |
12830 | ||
12831 | """ | |
54f9ee45 | 12832 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 12833 | |
248ed943 | 12834 | def Intersects(*args, **kwargs): |
0df68c9f | 12835 | """ |
a95a7133 | 12836 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
12837 | |
12838 | Returns True if this item and the other item instersect. | |
0df68c9f | 12839 | """ |
248ed943 RD |
12840 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12841 | ||
12842 | def IntersectsPos(*args, **kwargs): | |
12843 | """ | |
12844 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12845 | ||
12846 | Returns True if the given pos/span would intersect with this item. | |
12847 | """ | |
12848 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
12849 | |
12850 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12851 | """ |
12852 | GetEndPos(self) -> GBPosition | |
12853 | ||
12854 | Get the row and column of the endpoint of this item. | |
12855 | """ | |
54f9ee45 | 12856 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
12857 | |
12858 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12859 | """ |
12860 | GetGBSizer(self) -> GridBagSizer | |
12861 | ||
12862 | Get the sizer this item is a member of. | |
12863 | """ | |
54f9ee45 | 12864 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
12865 | |
12866 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12867 | """ |
12868 | SetGBSizer(self, GridBagSizer sizer) | |
12869 | ||
12870 | Set the sizer this item is a member of. | |
12871 | """ | |
54f9ee45 | 12872 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 12873 | |
97ab0f6a RD |
12874 | EndPos = property(GetEndPos,doc="See `GetEndPos`") |
12875 | GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`") | |
12876 | Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`") | |
12877 | Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`") | |
2131d850 | 12878 | _core_.GBSizerItem_swigregister(GBSizerItem) |
d14a1e28 RD |
12879 | DefaultSpan = cvar.DefaultSpan |
12880 | ||
12881 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
12882 | """ |
12883 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12884 | int border, PyObject userData=None) -> GBSizerItem |
12885 | ||
12886 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 12887 | """ |
54f9ee45 | 12888 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12889 | return val |
12890 | ||
12891 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12892 | """ |
12893 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12894 | int border, PyObject userData=None) -> GBSizerItem |
12895 | ||
12896 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 12897 | """ |
54f9ee45 | 12898 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12899 | return val |
12900 | ||
12901 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
12902 | """ |
12903 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12904 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12905 | ||
12906 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 12907 | """ |
54f9ee45 | 12908 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12909 | return val |
12910 | ||
12911 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12912 | """ |
12913 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12914 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12915 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12916 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12917 | virtual grid is determined by the largest row and column that items are | |
12918 | positioned at, adjusted for spanning. | |
12919 | ||
12920 | """ | |
0085ce49 RD |
12921 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12922 | __repr__ = _swig_repr | |
12923 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12924 | """ |
12925 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12926 | ||
12927 | Constructor, with optional parameters to specify the gap between the | |
12928 | rows and columns. | |
12929 | """ | |
0085ce49 | 12930 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
1823fbb4 RD |
12931 | self._setOORInfo(self) |
12932 | ||
e811c8ce | 12933 | def Add(*args, **kwargs): |
0df68c9f | 12934 | """ |
248ed943 | 12935 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 12936 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12937 | |
12938 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12939 | more than one row or column as specified with *span*. The remaining | |
12940 | args behave similarly to `wx.Sizer.Add`. | |
12941 | ||
12942 | Returns True if the item was successfully placed at the given cell | |
12943 | position, False if something was already there. | |
12944 | ||
0df68c9f | 12945 | """ |
54f9ee45 | 12946 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
12947 | |
12948 | def AddItem(*args, **kwargs): | |
248ed943 | 12949 | """ |
d3b6e4ff | 12950 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12951 | |
12952 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12953 | the item was successfully placed at its given cell position, False if | |
12954 | something was already there. | |
12955 | """ | |
54f9ee45 | 12956 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 12957 | |
84f85550 RD |
12958 | def GetCellSize(*args, **kwargs): |
12959 | """ | |
12960 | GetCellSize(self, int row, int col) -> Size | |
12961 | ||
12962 | Get the size of the specified cell, including hgap and | |
12963 | vgap. Only valid after a Layout. | |
12964 | """ | |
12965 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12966 | ||
e811c8ce | 12967 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12968 | """ |
12969 | GetEmptyCellSize(self) -> Size | |
12970 | ||
12971 | Get the size used for cells in the grid with no item. | |
12972 | """ | |
54f9ee45 | 12973 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12974 | |
12975 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12976 | """ |
12977 | SetEmptyCellSize(self, Size sz) | |
12978 | ||
12979 | Set the size used for cells in the grid with no item. | |
12980 | """ | |
54f9ee45 | 12981 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12982 | |
12983 | def GetItemPosition(*args): | |
0df68c9f | 12984 | """ |
248ed943 RD |
12985 | GetItemPosition(self, item) -> GBPosition |
12986 | ||
12987 | Get the grid position of the specified *item* where *item* is either a | |
12988 | window or subsizer that is a member of this sizer, or a zero-based | |
12989 | index of an item. | |
0df68c9f | 12990 | """ |
54f9ee45 | 12991 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
12992 | |
12993 | def SetItemPosition(*args): | |
0df68c9f | 12994 | """ |
248ed943 RD |
12995 | SetItemPosition(self, item, GBPosition pos) -> bool |
12996 | ||
12997 | Set the grid position of the specified *item* where *item* is either a | |
12998 | window or subsizer that is a member of this sizer, or a zero-based | |
12999 | index of an item. Returns True on success. If the move is not | |
13000 | allowed (because an item is already there) then False is returned. | |
13001 | ||
0df68c9f | 13002 | """ |
54f9ee45 | 13003 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
13004 | |
13005 | def GetItemSpan(*args): | |
0df68c9f | 13006 | """ |
248ed943 RD |
13007 | GetItemSpan(self, item) -> GBSpan |
13008 | ||
13009 | Get the row/col spanning of the specified *item* where *item* is | |
13010 | either a window or subsizer that is a member of this sizer, or a | |
13011 | zero-based index of an item. | |
0df68c9f | 13012 | """ |
54f9ee45 | 13013 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
13014 | |
13015 | def SetItemSpan(*args): | |
0df68c9f | 13016 | """ |
248ed943 RD |
13017 | SetItemSpan(self, item, GBSpan span) -> bool |
13018 | ||
13019 | Set the row/col spanning of the specified *item* where *item* is | |
13020 | either a window or subsizer that is a member of this sizer, or a | |
13021 | zero-based index of an item. Returns True on success. If the move is | |
13022 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 13023 | """ |
54f9ee45 | 13024 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
13025 | |
13026 | def FindItem(*args): | |
0df68c9f | 13027 | """ |
248ed943 RD |
13028 | FindItem(self, item) -> GBSizerItem |
13029 | ||
13030 | Find the sizer item for the given window or subsizer, returns None if | |
13031 | not found. (non-recursive) | |
0df68c9f | 13032 | """ |
54f9ee45 | 13033 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce RD |
13034 | |
13035 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
13036 | """ |
13037 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
13038 | ||
13039 | Return the sizer item for the given grid cell, or None if there is no | |
13040 | item at that position. (non-recursive) | |
13041 | """ | |
54f9ee45 | 13042 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
13043 | |
13044 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
13045 | """ |
13046 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
13047 | ||
13048 | Return the sizer item located at the point given in *pt*, or None if | |
13049 | there is no item at that point. The (x,y) coordinates in pt correspond | |
13050 | to the client coordinates of the window using the sizer for | |
13051 | layout. (non-recursive) | |
13052 | """ | |
54f9ee45 | 13053 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 13054 | |
248ed943 RD |
13055 | def CheckForIntersection(*args, **kwargs): |
13056 | """ | |
13057 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 13058 | |
248ed943 RD |
13059 | Look at all items and see if any intersect (or would overlap) the |
13060 | given *item*. Returns True if so, False if there would be no overlap. | |
13061 | If an *excludeItem* is given then it will not be checked for | |
13062 | intersection, for example it may be the item we are checking the | |
13063 | position of. | |
e811c8ce | 13064 | |
248ed943 RD |
13065 | """ |
13066 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 13067 | |
248ed943 | 13068 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 13069 | """ |
248ed943 RD |
13070 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
13071 | ||
13072 | Look at all items and see if any intersect (or would overlap) the | |
13073 | given position and span. Returns True if so, False if there would be | |
13074 | no overlap. If an *excludeItem* is given then it will not be checked | |
13075 | for intersection, for example it may be the item we are checking the | |
13076 | position of. | |
0df68c9f | 13077 | """ |
248ed943 | 13078 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 13079 | |
2131d850 | 13080 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d14a1e28 RD |
13081 | |
13082 | #--------------------------------------------------------------------------- | |
13083 | ||
54f9ee45 RD |
13084 | Left = _core_.Left |
13085 | Top = _core_.Top | |
13086 | Right = _core_.Right | |
13087 | Bottom = _core_.Bottom | |
13088 | Width = _core_.Width | |
13089 | Height = _core_.Height | |
13090 | Centre = _core_.Centre | |
13091 | Center = _core_.Center | |
13092 | CentreX = _core_.CentreX | |
13093 | CentreY = _core_.CentreY | |
13094 | Unconstrained = _core_.Unconstrained | |
13095 | AsIs = _core_.AsIs | |
13096 | PercentOf = _core_.PercentOf | |
13097 | Above = _core_.Above | |
13098 | Below = _core_.Below | |
13099 | LeftOf = _core_.LeftOf | |
13100 | RightOf = _core_.RightOf | |
13101 | SameAs = _core_.SameAs | |
13102 | Absolute = _core_.Absolute | |
d14a1e28 | 13103 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 13104 | """ |
41e2b43e RD |
13105 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
13106 | one of eight possible constraints that a window can be involved in. | |
13107 | You will never need to create an instance of | |
13108 | wx.IndividualLayoutConstraint, rather you should create a | |
13109 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 13110 | that it contains. |
15afbcd0 | 13111 | """ |
0085ce49 RD |
13112 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13113 | def __init__(self): raise AttributeError, "No constructor defined" | |
13114 | __repr__ = _swig_repr | |
e811c8ce | 13115 | def Set(*args, **kwargs): |
41e2b43e RD |
13116 | """ |
13117 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
13118 | ||
13119 | Sets the properties of the constraint. Normally called by one of the | |
13120 | convenience functions such as Above, RightOf, SameAs. | |
13121 | """ | |
54f9ee45 | 13122 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
13123 | |
13124 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 13125 | """ |
a95a7133 | 13126 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 13127 | |
41e2b43e RD |
13128 | Constrains this edge to be to the left of the given window, with an |
13129 | optional margin. Implicitly, this is relative to the left edge of the | |
13130 | other window. | |
15afbcd0 | 13131 | """ |
54f9ee45 | 13132 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
13133 | |
13134 | def RightOf(*args, **kwargs): | |
15afbcd0 | 13135 | """ |
a95a7133 | 13136 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 13137 | |
41e2b43e RD |
13138 | Constrains this edge to be to the right of the given window, with an |
13139 | optional margin. Implicitly, this is relative to the right edge of the | |
13140 | other window. | |
15afbcd0 | 13141 | """ |
54f9ee45 | 13142 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
13143 | |
13144 | def Above(*args, **kwargs): | |
15afbcd0 | 13145 | """ |
a95a7133 | 13146 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 13147 | |
41e2b43e RD |
13148 | Constrains this edge to be above the given window, with an optional |
13149 | margin. Implicitly, this is relative to the top edge of the other | |
13150 | window. | |
15afbcd0 | 13151 | """ |
54f9ee45 | 13152 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
13153 | |
13154 | def Below(*args, **kwargs): | |
15afbcd0 | 13155 | """ |
a95a7133 | 13156 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 13157 | |
41e2b43e RD |
13158 | Constrains this edge to be below the given window, with an optional |
13159 | margin. Implicitly, this is relative to the bottom edge of the other | |
13160 | window. | |
15afbcd0 | 13161 | """ |
54f9ee45 | 13162 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
13163 | |
13164 | def SameAs(*args, **kwargs): | |
15afbcd0 | 13165 | """ |
a95a7133 | 13166 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 13167 | |
41e2b43e RD |
13168 | Constrains this edge or dimension to be to the same as the edge of the |
13169 | given window, with an optional margin. | |
15afbcd0 | 13170 | """ |
54f9ee45 | 13171 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
13172 | |
13173 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 13174 | """ |
a95a7133 | 13175 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 13176 | |
41e2b43e RD |
13177 | Constrains this edge or dimension to be to a percentage of the given |
13178 | window, with an optional margin. | |
15afbcd0 | 13179 | """ |
54f9ee45 | 13180 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
13181 | |
13182 | def Absolute(*args, **kwargs): | |
15afbcd0 | 13183 | """ |
a95a7133 | 13184 | Absolute(self, int val) |
15afbcd0 | 13185 | |
41e2b43e | 13186 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 13187 | """ |
54f9ee45 | 13188 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
13189 | |
13190 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 13191 | """ |
a95a7133 | 13192 | Unconstrained(self) |
15afbcd0 | 13193 | |
41e2b43e RD |
13194 | Sets this edge or dimension to be unconstrained, that is, dependent on |
13195 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 13196 | """ |
54f9ee45 | 13197 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
13198 | |
13199 | def AsIs(*args, **kwargs): | |
15afbcd0 | 13200 | """ |
a95a7133 | 13201 | AsIs(self) |
15afbcd0 | 13202 | |
41e2b43e RD |
13203 | Sets this edge or constraint to be whatever the window's value is at |
13204 | the moment. If either of the width and height constraints are *as is*, | |
13205 | the window will not be resized, but moved instead. This is important | |
13206 | when considering panel items which are intended to have a default | |
13207 | size, such as a button, which may take its size from the size of the | |
13208 | button label. | |
15afbcd0 | 13209 | """ |
54f9ee45 | 13210 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
13211 | |
13212 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 13213 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 13214 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
13215 | |
13216 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 13217 | """GetMyEdge(self) -> int""" |
54f9ee45 | 13218 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
13219 | |
13220 | def SetEdge(*args, **kwargs): | |
a95a7133 | 13221 | """SetEdge(self, int which)""" |
54f9ee45 | 13222 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
13223 | |
13224 | def SetValue(*args, **kwargs): | |
a95a7133 | 13225 | """SetValue(self, int v)""" |
54f9ee45 | 13226 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
13227 | |
13228 | def GetMargin(*args, **kwargs): | |
a95a7133 | 13229 | """GetMargin(self) -> int""" |
54f9ee45 | 13230 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
13231 | |
13232 | def SetMargin(*args, **kwargs): | |
a95a7133 | 13233 | """SetMargin(self, int m)""" |
54f9ee45 | 13234 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
13235 | |
13236 | def GetValue(*args, **kwargs): | |
a95a7133 | 13237 | """GetValue(self) -> int""" |
54f9ee45 | 13238 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
13239 | |
13240 | def GetPercent(*args, **kwargs): | |
a95a7133 | 13241 | """GetPercent(self) -> int""" |
54f9ee45 | 13242 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
13243 | |
13244 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 13245 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 13246 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
13247 | |
13248 | def GetDone(*args, **kwargs): | |
a95a7133 | 13249 | """GetDone(self) -> bool""" |
54f9ee45 | 13250 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
13251 | |
13252 | def SetDone(*args, **kwargs): | |
a95a7133 | 13253 | """SetDone(self, bool d)""" |
54f9ee45 | 13254 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
13255 | |
13256 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 13257 | """GetRelationship(self) -> int""" |
54f9ee45 | 13258 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
13259 | |
13260 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 13261 | """SetRelationship(self, int r)""" |
54f9ee45 | 13262 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
13263 | |
13264 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 13265 | """ |
a95a7133 | 13266 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
13267 | |
13268 | Reset constraint if it mentions otherWin | |
13269 | """ | |
54f9ee45 | 13270 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
13271 | |
13272 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 13273 | """ |
a95a7133 | 13274 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
13275 | |
13276 | Try to satisfy constraint | |
13277 | """ | |
54f9ee45 | 13278 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
13279 | |
13280 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 13281 | """ |
a95a7133 | 13282 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
13283 | |
13284 | Get the value of this edge or dimension, or if this | |
13285 | is not determinable, -1. | |
13286 | """ | |
54f9ee45 | 13287 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 13288 | |
97ab0f6a RD |
13289 | Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`") |
13290 | Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`") | |
13291 | MyEdge = property(GetMyEdge,doc="See `GetMyEdge`") | |
13292 | OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`") | |
13293 | OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`") | |
13294 | Percent = property(GetPercent,doc="See `GetPercent`") | |
13295 | Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`") | |
13296 | Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`") | |
2131d850 | 13297 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d14a1e28 RD |
13298 | |
13299 | class LayoutConstraints(Object): | |
15afbcd0 | 13300 | """ |
41e2b43e RD |
13301 | **Note:** constraints are now deprecated and you should use sizers |
13302 | instead. | |
15afbcd0 | 13303 | |
41e2b43e RD |
13304 | Objects of this class can be associated with a window to define its |
13305 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
13306 | |
13307 | The class consists of the following eight constraints of class | |
13308 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13309 | directly to set the appropriate constraints. | |
13310 | ||
13311 | * left: represents the left hand edge of the window | |
13312 | * right: represents the right hand edge of the window | |
13313 | * top: represents the top edge of the window | |
13314 | * bottom: represents the bottom edge of the window | |
13315 | * width: represents the width of the window | |
13316 | * height: represents the height of the window | |
13317 | * centreX: represents the horizontal centre point of the window | |
13318 | * centreY: represents the vertical centre point of the window | |
13319 | ||
41e2b43e RD |
13320 | Most constraints are initially set to have the relationship |
13321 | wxUnconstrained, which means that their values should be calculated by | |
13322 | looking at known constraints. The exceptions are width and height, | |
13323 | which are set to wxAsIs to ensure that if the user does not specify a | |
13324 | constraint, the existing width and height will be used, to be | |
13325 | compatible with panel items which often have take a default size. If | |
13326 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13327 | ||
13328 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
13329 | |
13330 | """ | |
0085ce49 RD |
13331 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13332 | __repr__ = _swig_repr | |
54f9ee45 RD |
13333 | left = property(_core_.LayoutConstraints_left_get) |
13334 | top = property(_core_.LayoutConstraints_top_get) | |
13335 | right = property(_core_.LayoutConstraints_right_get) | |
13336 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13337 | width = property(_core_.LayoutConstraints_width_get) | |
13338 | height = property(_core_.LayoutConstraints_height_get) | |
13339 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13340 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
0085ce49 | 13341 | def __init__(self, *args, **kwargs): |
a95a7133 | 13342 | """__init__(self) -> LayoutConstraints""" |
0085ce49 RD |
13343 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
13344 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
13345 | __del__ = lambda self : None; | |
e811c8ce | 13346 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 13347 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 13348 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
13349 | |
13350 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 13351 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 13352 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 13353 | |
2131d850 | 13354 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d14a1e28 RD |
13355 | |
13356 | #---------------------------------------------------------------------------- | |
13357 | ||
322913ce | 13358 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
13359 | try: |
13360 | True | |
13361 | except NameError: | |
322913ce RD |
13362 | __builtins__.True = 1==1 |
13363 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
13364 | def bool(value): return not not value |
13365 | __builtins__.bool = bool | |
d14a1e28 | 13366 | |
d14a1e28 RD |
13367 | |
13368 | ||
13369 | # workarounds for bad wxRTTI names | |
13370 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13371 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13372 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13373 | ||
13374 | ||
13375 | #---------------------------------------------------------------------------- | |
13376 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 13377 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
13378 | |
13379 | from __version__ import * | |
13380 | __version__ = VERSION_STRING | |
13381 | ||
7bc1e663 RD |
13382 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13383 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 13384 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 13385 | import warnings |
7bc1e663 | 13386 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 RD |
13387 | |
13388 | #---------------------------------------------------------------------------- | |
13389 | ||
70b7a5fe RD |
13390 | # Set wxPython's default string<-->unicode conversion encoding from |
13391 | # the locale, but only if Python's default hasn't been changed. (We | |
13392 | # assume that if the user has customized it already then that is the | |
13393 | # encoding we need to use as well.) | |
13394 | # | |
13395 | # The encoding selected here is used when string or unicode objects | |
13396 | # need to be converted in order to pass them to wxWidgets. Please be | |
13397 | # aware that the default encoding within the same locale may be | |
13398 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
13399 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13400 | # between the common latin/roman encodings. | |
396fb509 RD |
13401 | |
13402 | default = _sys.getdefaultencoding() | |
13403 | if default == 'ascii': | |
13404 | import locale | |
13405 | import codecs | |
13406 | try: | |
13407 | default = locale.getdefaultlocale()[1] | |
13408 | codecs.lookup(default) | |
70b7a5fe | 13409 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
13410 | default = _sys.getdefaultencoding() |
13411 | del locale | |
13412 | del codecs | |
5cbf236d RD |
13413 | if default: |
13414 | wx.SetDefaultPyEncoding(default) | |
13415 | del default | |
5cbf236d RD |
13416 | |
13417 | #---------------------------------------------------------------------------- | |
13418 | ||
d14a1e28 RD |
13419 | class PyDeadObjectError(AttributeError): |
13420 | pass | |
13421 | ||
d14a1e28 RD |
13422 | class _wxPyDeadObject(object): |
13423 | """ | |
13424 | Instances of wx objects that are OOR capable will have their __class__ | |
13425 | changed to this class when the C++ object is deleted. This should help | |
13426 | prevent crashes due to referencing a bogus C++ pointer. | |
13427 | """ | |
13428 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13429 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13430 | ||
3a04f143 | 13431 | def __repr__(self): |
d14a1e28 RD |
13432 | if not hasattr(self, "_name"): |
13433 | self._name = "[unknown]" | |
13434 | return self.reprStr % self._name | |
13435 | ||
3a04f143 | 13436 | def __getattr__(self, *args): |
d14a1e28 RD |
13437 | if not hasattr(self, "_name"): |
13438 | self._name = "[unknown]" | |
3a04f143 RD |
13439 | raise PyDeadObjectError(self.attrStr % self._name) |
13440 | ||
13441 | def __nonzero__(self): | |
13442 | return 0 | |
13443 | ||
13444 | ||
13445 | ||
13446 | class PyUnbornObjectError(AttributeError): | |
13447 | pass | |
13448 | ||
13449 | class _wxPyUnbornObject(object): | |
13450 | """ | |
54f9ee45 | 13451 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
13452 | imported, but their C++ instance is not created until the wx.App |
13453 | object is created and initialized. These object instances will | |
13454 | temporarily have their __class__ changed to this class so an | |
13455 | exception will be raised if they are used before the C++ instance | |
13456 | is ready. | |
13457 | """ | |
13458 | ||
13459 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13460 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13461 | ||
13462 | def __repr__(self): | |
13463 | #if not hasattr(self, "_name"): | |
13464 | # self._name = "[unknown]" | |
13465 | return self.reprStr #% self._name | |
13466 | ||
13467 | def __getattr__(self, *args): | |
13468 | #if not hasattr(self, "_name"): | |
13469 | # self._name = "[unknown]" | |
13470 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
13471 | |
13472 | def __nonzero__(self): | |
13473 | return 0 | |
13474 | ||
13475 | ||
13476 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
13477 | |
13478 | def CallAfter(callable, *args, **kw): | |
13479 | """ | |
13480 | Call the specified function after the current and pending event | |
13481 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
13482 | method calls from non-GUI threads. Any extra positional or |
13483 | keyword args are passed on to the callable when it is called. | |
13484 | ||
13485 | :see: `wx.FutureCall` | |
d14a1e28 RD |
13486 | """ |
13487 | app = wx.GetApp() | |
dfbb5885 | 13488 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 13489 | |
148275d3 RD |
13490 | if not hasattr(app, "_CallAfterId"): |
13491 | app._CallAfterId = wx.NewEventType() | |
13492 | app.Connect(-1, -1, app._CallAfterId, | |
13493 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 13494 | evt = wx.PyEvent() |
148275d3 | 13495 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
13496 | evt.callable = callable |
13497 | evt.args = args | |
13498 | evt.kw = kw | |
13499 | wx.PostEvent(app, evt) | |
13500 | ||
d14a1e28 RD |
13501 | #---------------------------------------------------------------------------- |
13502 | ||
13503 | ||
13504 | class FutureCall: | |
13505 | """ | |
8ac8dba0 | 13506 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
13507 | object once after the given amount of milliseconds, passing any |
13508 | positional or keyword args. The return value of the callable is | |
61863841 | 13509 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
13510 | |
13511 | If you don't need to get the return value or restart the timer | |
13512 | then there is no need to hold a reference to this object. It will | |
13513 | hold a reference to itself while the timer is running (the timer | |
13514 | has a reference to self.Notify) but the cycle will be broken when | |
13515 | the timer completes, automatically cleaning up the wx.FutureCall | |
13516 | object. | |
61863841 RD |
13517 | |
13518 | :see: `wx.CallAfter` | |
d14a1e28 RD |
13519 | """ |
13520 | def __init__(self, millis, callable, *args, **kwargs): | |
13521 | self.millis = millis | |
13522 | self.callable = callable | |
13523 | self.SetArgs(*args, **kwargs) | |
13524 | self.runCount = 0 | |
4276dc52 | 13525 | self.running = False |
d14a1e28 RD |
13526 | self.hasRun = False |
13527 | self.result = None | |
13528 | self.timer = None | |
13529 | self.Start() | |
13530 | ||
13531 | def __del__(self): | |
13532 | self.Stop() | |
13533 | ||
13534 | ||
13535 | def Start(self, millis=None, *args, **kwargs): | |
13536 | """ | |
13537 | (Re)start the timer | |
13538 | """ | |
13539 | self.hasRun = False | |
13540 | if millis is not None: | |
13541 | self.millis = millis | |
13542 | if args or kwargs: | |
13543 | self.SetArgs(*args, **kwargs) | |
13544 | self.Stop() | |
13545 | self.timer = wx.PyTimer(self.Notify) | |
13546 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 13547 | self.running = True |
d14a1e28 RD |
13548 | Restart = Start |
13549 | ||
13550 | ||
13551 | def Stop(self): | |
13552 | """ | |
13553 | Stop and destroy the timer. | |
13554 | """ | |
13555 | if self.timer is not None: | |
13556 | self.timer.Stop() | |
13557 | self.timer = None | |
13558 | ||
13559 | ||
13560 | def GetInterval(self): | |
13561 | if self.timer is not None: | |
13562 | return self.timer.GetInterval() | |
13563 | else: | |
13564 | return 0 | |
13565 | ||
13566 | ||
13567 | def IsRunning(self): | |
13568 | return self.timer is not None and self.timer.IsRunning() | |
13569 | ||
13570 | ||
13571 | def SetArgs(self, *args, **kwargs): | |
13572 | """ | |
13573 | (Re)set the args passed to the callable object. This is | |
13574 | useful in conjunction with Restart if you want to schedule a | |
13575 | new call to the same callable object but with different | |
13576 | parameters. | |
13577 | """ | |
13578 | self.args = args | |
13579 | self.kwargs = kwargs | |
13580 | ||
13581 | ||
13582 | def HasRun(self): | |
13583 | return self.hasRun | |
13584 | ||
13585 | def GetResult(self): | |
13586 | return self.result | |
13587 | ||
13588 | def Notify(self): | |
13589 | """ | |
13590 | The timer has expired so call the callable. | |
13591 | """ | |
13592 | if self.callable and getattr(self.callable, 'im_self', True): | |
13593 | self.runCount += 1 | |
4276dc52 | 13594 | self.running = False |
d14a1e28 RD |
13595 | self.result = self.callable(*self.args, **self.kwargs) |
13596 | self.hasRun = True | |
4276dc52 RD |
13597 | if not self.running: |
13598 | # if it wasn't restarted, then cleanup | |
13599 | wx.CallAfter(self.Stop) | |
d14a1e28 | 13600 | |
97ab0f6a RD |
13601 | Interval = property(GetInterval) |
13602 | Result = property(GetResult) | |
d14a1e28 | 13603 | |
a95a7133 RD |
13604 | |
13605 | #---------------------------------------------------------------------------- | |
13606 | # Control which items in this module should be documented by epydoc. | |
13607 | # We allow only classes and functions, which will help reduce the size | |
13608 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13609 | # and etc that don't make much sense by themselves, but are instead | |
13610 | # documented (or will be) as part of the classes/functions/methods | |
13611 | # where they should be used. | |
13612 | ||
66c033b4 RD |
13613 | class __DocFilter: |
13614 | """ | |
13615 | A filter for epydoc that only allows non-Ptr classes and | |
34e0a3bb | 13616 | functions, in order to reduce the clutter in the API docs. |
66c033b4 RD |
13617 | """ |
13618 | def __init__(self, globals): | |
13619 | self._globals = globals | |
13620 | ||
13621 | def __call__(self, name): | |
13622 | import types | |
13623 | obj = self._globals.get(name, None) | |
34e0a3bb RD |
13624 | |
13625 | # only document classes and function | |
66c033b4 RD |
13626 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: |
13627 | return False | |
34e0a3bb RD |
13628 | |
13629 | # skip other things that are private or will be documented as part of somethign else | |
0085ce49 | 13630 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
66c033b4 | 13631 | return False |
34e0a3bb RD |
13632 | |
13633 | # skip functions that are duplicates of static functions in a class | |
13634 | if name.find('_') != -1: | |
13635 | cls = self._globals.get(name.split('_')[0], None) | |
13636 | methname = name.split('_')[1] | |
13637 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
13638 | return False | |
13639 | ||
66c033b4 | 13640 | return True |
a95a7133 | 13641 | |
d14a1e28 RD |
13642 | #---------------------------------------------------------------------------- |
13643 | #---------------------------------------------------------------------------- | |
13644 | ||
13645 | # Import other modules in this package that should show up in the | |
13646 | # "core" wx namespace | |
54f9ee45 RD |
13647 | from _gdi import * |
13648 | from _windows import * | |
13649 | from _controls import * | |
13650 | from _misc import * | |
d14a1e28 RD |
13651 | |
13652 | #---------------------------------------------------------------------------- | |
13653 | #---------------------------------------------------------------------------- | |
13654 | ||
13655 | ||
32fe5131 | 13656 |