]>
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 | |
10044bf1 RD |
844 | def Scale(*args, **kwargs): |
845 | """ | |
846 | Scale(self, float xscale, float yscale) | |
847 | ||
848 | Scales the dimensions of this object by the given factors. | |
849 | """ | |
850 | return _core_.Size_Scale(*args, **kwargs) | |
851 | ||
e811c8ce | 852 | def Set(*args, **kwargs): |
0df68c9f | 853 | """ |
a95a7133 | 854 | Set(self, int w, int h) |
e811c8ce | 855 | |
0df68c9f RD |
856 | Set both width and height. |
857 | """ | |
54f9ee45 | 858 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
859 | |
860 | def SetWidth(*args, **kwargs): | |
a95a7133 | 861 | """SetWidth(self, int w)""" |
54f9ee45 | 862 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
863 | |
864 | def SetHeight(*args, **kwargs): | |
a95a7133 | 865 | """SetHeight(self, int h)""" |
54f9ee45 | 866 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
867 | |
868 | def GetWidth(*args, **kwargs): | |
a95a7133 | 869 | """GetWidth(self) -> int""" |
54f9ee45 | 870 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
871 | |
872 | def GetHeight(*args, **kwargs): | |
a95a7133 | 873 | """GetHeight(self) -> int""" |
54f9ee45 | 874 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 875 | |
74a57fcd RD |
876 | def IsFullySpecified(*args, **kwargs): |
877 | """ | |
a95a7133 | 878 | IsFullySpecified(self) -> bool |
74a57fcd RD |
879 | |
880 | Returns True if both components of the size are non-default values. | |
881 | """ | |
54f9ee45 | 882 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
883 | |
884 | def SetDefaults(*args, **kwargs): | |
885 | """ | |
a95a7133 | 886 | SetDefaults(self, Size size) |
74a57fcd | 887 | |
41e2b43e RD |
888 | Combine this size with the other one replacing the default components |
889 | of this object (i.e. equal to -1) with those of the other. | |
74a57fcd | 890 | """ |
54f9ee45 | 891 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 892 | |
e811c8ce | 893 | def Get(*args, **kwargs): |
0df68c9f RD |
894 | """ |
895 | Get() -> (width,height) | |
e811c8ce | 896 | |
0df68c9f RD |
897 | Returns the width and height properties as a tuple. |
898 | """ | |
54f9ee45 | 899 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 900 | |
41e2b43e | 901 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
902 | def __str__(self): return str(self.Get()) |
903 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
904 | def __len__(self): return len(self.Get()) | |
905 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
906 | def __setitem__(self, index, val): |
907 | if index == 0: self.width = val | |
908 | elif index == 1: self.height = val | |
909 | else: raise IndexError | |
e811c8ce | 910 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
911 | __safe_for_unpickling__ = True |
912 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 | 913 | |
2131d850 | 914 | _core_.Size_swigregister(Size) |
d14a1e28 RD |
915 | |
916 | #--------------------------------------------------------------------------- | |
917 | ||
918 | class RealPoint(object): | |
0df68c9f | 919 | """ |
41e2b43e RD |
920 | A data structure for representing a point or position with floating |
921 | point x and y properties. In wxPython most places that expect a | |
922 | wx.RealPoint can also accept a (x,y) tuple. | |
0df68c9f | 923 | """ |
0085ce49 RD |
924 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
925 | __repr__ = _swig_repr | |
54f9ee45 RD |
926 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
927 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
0085ce49 | 928 | def __init__(self, *args, **kwargs): |
0df68c9f | 929 | """ |
a95a7133 | 930 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 931 | |
0df68c9f RD |
932 | Create a wx.RealPoint object |
933 | """ | |
0085ce49 RD |
934 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
935 | __swig_destroy__ = _core_.delete_RealPoint | |
936 | __del__ = lambda self : None; | |
e811c8ce | 937 | def __eq__(*args, **kwargs): |
0df68c9f | 938 | """ |
e9d6f3a4 | 939 | __eq__(self, PyObject other) -> bool |
e811c8ce | 940 | |
0df68c9f RD |
941 | Test for equality of wx.RealPoint objects. |
942 | """ | |
54f9ee45 | 943 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
944 | |
945 | def __ne__(*args, **kwargs): | |
0df68c9f | 946 | """ |
e9d6f3a4 | 947 | __ne__(self, PyObject other) -> bool |
e811c8ce | 948 | |
0df68c9f RD |
949 | Test for inequality of wx.RealPoint objects. |
950 | """ | |
54f9ee45 | 951 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
952 | |
953 | def __add__(*args, **kwargs): | |
0df68c9f | 954 | """ |
a95a7133 | 955 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 956 | |
0df68c9f RD |
957 | Add pt's proprties to this and return the result. |
958 | """ | |
54f9ee45 | 959 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
960 | |
961 | def __sub__(*args, **kwargs): | |
0df68c9f | 962 | """ |
a95a7133 | 963 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 964 | |
0df68c9f RD |
965 | Subtract pt's proprties from this and return the result |
966 | """ | |
54f9ee45 | 967 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
968 | |
969 | def Set(*args, **kwargs): | |
0df68c9f | 970 | """ |
a95a7133 | 971 | Set(self, double x, double y) |
e811c8ce | 972 | |
0df68c9f RD |
973 | Set both the x and y properties |
974 | """ | |
54f9ee45 | 975 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
976 | |
977 | def Get(*args, **kwargs): | |
0df68c9f RD |
978 | """ |
979 | Get() -> (x,y) | |
e811c8ce | 980 | |
0df68c9f RD |
981 | Return the x and y properties as a tuple. |
982 | """ | |
54f9ee45 | 983 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 984 | |
41e2b43e | 985 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
986 | def __str__(self): return str(self.Get()) |
987 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
988 | def __len__(self): return len(self.Get()) | |
989 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 990 | def __setitem__(self, index, val): |
e811c8ce RD |
991 | if index == 0: self.x = val |
992 | elif index == 1: self.y = val | |
d14a1e28 | 993 | else: raise IndexError |
e811c8ce | 994 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
995 | __safe_for_unpickling__ = True |
996 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 | 997 | |
2131d850 | 998 | _core_.RealPoint_swigregister(RealPoint) |
d14a1e28 RD |
999 | |
1000 | #--------------------------------------------------------------------------- | |
1001 | ||
1002 | class Point(object): | |
0df68c9f | 1003 | """ |
41e2b43e RD |
1004 | A data structure for representing a point or position with integer x |
1005 | and y properties. Most places in wxPython that expect a wx.Point can | |
1006 | also accept a (x,y) tuple. | |
0df68c9f | 1007 | """ |
0085ce49 RD |
1008 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1009 | __repr__ = _swig_repr | |
54f9ee45 RD |
1010 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1011 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
0085ce49 | 1012 | def __init__(self, *args, **kwargs): |
0df68c9f | 1013 | """ |
a95a7133 | 1014 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1015 | |
0df68c9f RD |
1016 | Create a wx.Point object |
1017 | """ | |
0085ce49 RD |
1018 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1019 | __swig_destroy__ = _core_.delete_Point | |
1020 | __del__ = lambda self : None; | |
e811c8ce | 1021 | def __eq__(*args, **kwargs): |
0df68c9f | 1022 | """ |
e9d6f3a4 | 1023 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1024 | |
0df68c9f RD |
1025 | Test for equality of wx.Point objects. |
1026 | """ | |
54f9ee45 | 1027 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1028 | |
1029 | def __ne__(*args, **kwargs): | |
0df68c9f | 1030 | """ |
e9d6f3a4 | 1031 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1032 | |
0df68c9f RD |
1033 | Test for inequality of wx.Point objects. |
1034 | """ | |
54f9ee45 | 1035 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1036 | |
1037 | def __add__(*args, **kwargs): | |
0df68c9f | 1038 | """ |
a95a7133 | 1039 | __add__(self, Point pt) -> Point |
e811c8ce | 1040 | |
0df68c9f RD |
1041 | Add pt's proprties to this and return the result. |
1042 | """ | |
54f9ee45 | 1043 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1044 | |
1045 | def __sub__(*args, **kwargs): | |
0df68c9f | 1046 | """ |
a95a7133 | 1047 | __sub__(self, Point pt) -> Point |
e811c8ce | 1048 | |
0df68c9f RD |
1049 | Subtract pt's proprties from this and return the result |
1050 | """ | |
54f9ee45 | 1051 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1052 | |
1053 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1054 | """ |
a95a7133 | 1055 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1056 | |
0df68c9f RD |
1057 | Add pt to this object. |
1058 | """ | |
54f9ee45 | 1059 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1060 | |
1061 | def __isub__(*args, **kwargs): | |
0df68c9f | 1062 | """ |
a95a7133 | 1063 | __isub__(self, Point pt) -> Point |
e811c8ce | 1064 | |
0df68c9f RD |
1065 | Subtract pt from this object. |
1066 | """ | |
54f9ee45 | 1067 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1068 | |
1069 | def Set(*args, **kwargs): | |
0df68c9f | 1070 | """ |
a95a7133 | 1071 | Set(self, long x, long y) |
e811c8ce | 1072 | |
0df68c9f RD |
1073 | Set both the x and y properties |
1074 | """ | |
54f9ee45 | 1075 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1076 | |
1077 | def Get(*args, **kwargs): | |
0df68c9f RD |
1078 | """ |
1079 | Get() -> (x,y) | |
e811c8ce | 1080 | |
0df68c9f RD |
1081 | Return the x and y properties as a tuple. |
1082 | """ | |
54f9ee45 | 1083 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1084 | |
41e2b43e | 1085 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1086 | def __str__(self): return str(self.Get()) |
1087 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1088 | def __len__(self): return len(self.Get()) | |
1089 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1090 | def __setitem__(self, index, val): |
1091 | if index == 0: self.x = val | |
1092 | elif index == 1: self.y = val | |
1093 | else: raise IndexError | |
e811c8ce | 1094 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1095 | __safe_for_unpickling__ = True |
1096 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 | 1097 | |
2131d850 | 1098 | _core_.Point_swigregister(Point) |
d14a1e28 RD |
1099 | |
1100 | #--------------------------------------------------------------------------- | |
1101 | ||
1102 | class Rect(object): | |
0df68c9f | 1103 | """ |
41e2b43e RD |
1104 | A class for representing and manipulating rectangles. It has x, y, |
1105 | width and height properties. In wxPython most palces that expect a | |
1106 | wx.Rect can also accept a (x,y,width,height) tuple. | |
0df68c9f | 1107 | """ |
0085ce49 RD |
1108 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1109 | __repr__ = _swig_repr | |
1110 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1111 | """ |
a95a7133 | 1112 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1113 | |
0df68c9f RD |
1114 | Create a new Rect object. |
1115 | """ | |
0085ce49 RD |
1116 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1117 | __swig_destroy__ = _core_.delete_Rect | |
1118 | __del__ = lambda self : None; | |
e811c8ce | 1119 | def GetX(*args, **kwargs): |
a95a7133 | 1120 | """GetX(self) -> int""" |
54f9ee45 | 1121 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1122 | |
1123 | def SetX(*args, **kwargs): | |
a95a7133 | 1124 | """SetX(self, int x)""" |
54f9ee45 | 1125 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1126 | |
1127 | def GetY(*args, **kwargs): | |
a95a7133 | 1128 | """GetY(self) -> int""" |
54f9ee45 | 1129 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1130 | |
1131 | def SetY(*args, **kwargs): | |
a95a7133 | 1132 | """SetY(self, int y)""" |
54f9ee45 | 1133 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1134 | |
1135 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1136 | """GetWidth(self) -> int""" |
54f9ee45 | 1137 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1138 | |
1139 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1140 | """SetWidth(self, int w)""" |
54f9ee45 | 1141 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1142 | |
1143 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1144 | """GetHeight(self) -> int""" |
54f9ee45 | 1145 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1146 | |
1147 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1148 | """SetHeight(self, int h)""" |
54f9ee45 | 1149 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1150 | |
1151 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1152 | """GetPosition(self) -> Point""" |
54f9ee45 | 1153 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1154 | |
1155 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1156 | """SetPosition(self, Point p)""" |
54f9ee45 | 1157 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1158 | |
1159 | def GetSize(*args, **kwargs): | |
a95a7133 | 1160 | """GetSize(self) -> Size""" |
54f9ee45 | 1161 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1162 | |
1163 | def SetSize(*args, **kwargs): | |
a95a7133 | 1164 | """SetSize(self, Size s)""" |
54f9ee45 | 1165 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1166 | |
aff4cc5c RD |
1167 | def IsEmpty(*args, **kwargs): |
1168 | """IsEmpty(self) -> bool""" | |
1169 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1170 | ||
c9c7117a | 1171 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1172 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1173 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1174 | |
1175 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1176 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1177 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1178 | |
1179 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1180 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1181 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1182 | |
1183 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1184 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1185 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1186 | |
e811c8ce | 1187 | def GetLeft(*args, **kwargs): |
a95a7133 | 1188 | """GetLeft(self) -> int""" |
54f9ee45 | 1189 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1190 | |
1191 | def GetTop(*args, **kwargs): | |
a95a7133 | 1192 | """GetTop(self) -> int""" |
54f9ee45 | 1193 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1194 | |
1195 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1196 | """GetBottom(self) -> int""" |
54f9ee45 | 1197 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1198 | |
1199 | def GetRight(*args, **kwargs): | |
a95a7133 | 1200 | """GetRight(self) -> int""" |
54f9ee45 | 1201 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1202 | |
1203 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1204 | """SetLeft(self, int left)""" |
54f9ee45 | 1205 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1206 | |
1207 | def SetRight(*args, **kwargs): | |
a95a7133 | 1208 | """SetRight(self, int right)""" |
54f9ee45 | 1209 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1210 | |
1211 | def SetTop(*args, **kwargs): | |
a95a7133 | 1212 | """SetTop(self, int top)""" |
54f9ee45 | 1213 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1214 | |
1215 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1216 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1217 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce RD |
1218 | |
1219 | position = property(GetPosition, SetPosition) | |
1220 | size = property(GetSize, SetSize) | |
1221 | left = property(GetLeft, SetLeft) | |
1222 | right = property(GetRight, SetRight) | |
1223 | top = property(GetTop, SetTop) | |
1224 | bottom = property(GetBottom, SetBottom) | |
1225 | ||
1226 | def Inflate(*args, **kwargs): | |
0df68c9f | 1227 | """ |
a95a7133 | 1228 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1229 | |
8e738329 RD |
1230 | Increases the size of the rectangle. |
1231 | ||
1232 | The left border is moved farther left and the right border is moved | |
1233 | farther right by ``dx``. The upper border is moved farther up and the | |
1234 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1235 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1236 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1237 | opposite happens: the rectangle size decreases in the respective | |
1238 | direction. | |
1239 | ||
1240 | The change is made to the rectangle inplace, if instead you need a | |
1241 | copy that is inflated, preserving the original then make the copy | |
1242 | first:: | |
1243 | ||
1244 | copy = wx.Rect(*original) | |
1245 | copy.Inflate(10,15) | |
1246 | ||
1247 | ||
0df68c9f | 1248 | """ |
54f9ee45 | 1249 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1250 | |
1251 | def Deflate(*args, **kwargs): | |
0df68c9f | 1252 | """ |
a95a7133 | 1253 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1254 | |
8e738329 RD |
1255 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1256 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1257 | `Inflate` for a full description. | |
0df68c9f | 1258 | """ |
54f9ee45 | 1259 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1260 | |
1261 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1262 | """ |
a95a7133 | 1263 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1264 | |
41e2b43e RD |
1265 | Moves the rectangle by the specified offset. If dx is positive, the |
1266 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1267 | bottom, otherwise it is moved to the left or top respectively. | |
0df68c9f | 1268 | """ |
54f9ee45 | 1269 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1270 | |
1271 | def Offset(*args, **kwargs): | |
0df68c9f | 1272 | """ |
a95a7133 | 1273 | Offset(self, Point pt) |
e811c8ce | 1274 | |
b1fcee84 | 1275 | Same as `OffsetXY` but uses dx,dy from Point |
0df68c9f | 1276 | """ |
54f9ee45 | 1277 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1278 | |
1279 | def Intersect(*args, **kwargs): | |
0df68c9f | 1280 | """ |
a95a7133 | 1281 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1282 | |
5cbf236d | 1283 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1284 | """ |
54f9ee45 | 1285 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1286 | |
5cbf236d RD |
1287 | def Union(*args, **kwargs): |
1288 | """ | |
1289 | Union(self, Rect rect) -> Rect | |
1290 | ||
1291 | Returns the union of this rectangle and rect. | |
1292 | """ | |
1293 | return _core_.Rect_Union(*args, **kwargs) | |
1294 | ||
e811c8ce | 1295 | def __add__(*args, **kwargs): |
0df68c9f | 1296 | """ |
a95a7133 | 1297 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1298 | |
0df68c9f RD |
1299 | Add the properties of rect to this rectangle and return the result. |
1300 | """ | |
54f9ee45 | 1301 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1302 | |
1303 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1304 | """ |
a95a7133 | 1305 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1306 | |
0df68c9f RD |
1307 | Add the properties of rect to this rectangle, updating this rectangle. |
1308 | """ | |
54f9ee45 | 1309 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1310 | |
1311 | def __eq__(*args, **kwargs): | |
0df68c9f | 1312 | """ |
e9d6f3a4 | 1313 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1314 | |
e9d6f3a4 | 1315 | Test for equality of wx.Rect objects. |
0df68c9f | 1316 | """ |
54f9ee45 | 1317 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1318 | |
1319 | def __ne__(*args, **kwargs): | |
0df68c9f | 1320 | """ |
e9d6f3a4 | 1321 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1322 | |
e9d6f3a4 | 1323 | Test for inequality of wx.Rect objects. |
0df68c9f | 1324 | """ |
54f9ee45 | 1325 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce | 1326 | |
33d6fd3b | 1327 | def ContainsXY(*args, **kwargs): |
0df68c9f | 1328 | """ |
33d6fd3b | 1329 | ContainsXY(self, int x, int y) -> bool |
e811c8ce | 1330 | |
33d6fd3b | 1331 | Return True if the point is inside the rect. |
0df68c9f | 1332 | """ |
33d6fd3b | 1333 | return _core_.Rect_ContainsXY(*args, **kwargs) |
e811c8ce | 1334 | |
33d6fd3b | 1335 | def Contains(*args, **kwargs): |
0df68c9f | 1336 | """ |
33d6fd3b | 1337 | Contains(self, Point pt) -> bool |
e811c8ce | 1338 | |
33d6fd3b | 1339 | Return True if the point is inside the rect. |
0df68c9f | 1340 | """ |
33d6fd3b | 1341 | return _core_.Rect_Contains(*args, **kwargs) |
e811c8ce | 1342 | |
33d6fd3b | 1343 | def ContainsRect(*args, **kwargs): |
fc46b7f3 | 1344 | """ |
33d6fd3b | 1345 | ContainsRect(self, Rect rect) -> bool |
fc46b7f3 RD |
1346 | |
1347 | Returns ``True`` if the given rectangle is completely inside this | |
1348 | rectangle or touches its boundary. | |
1349 | """ | |
33d6fd3b RD |
1350 | return _core_.Rect_ContainsRect(*args, **kwargs) |
1351 | ||
1352 | Inside = wx._deprecated(Contains, "Use `Contains` instead.") | |
1353 | InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.") | |
1354 | InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.") | |
fc46b7f3 | 1355 | |
e811c8ce | 1356 | def Intersects(*args, **kwargs): |
0df68c9f | 1357 | """ |
a95a7133 | 1358 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1359 | |
0df68c9f RD |
1360 | Returns True if the rectangles have a non empty intersection. |
1361 | """ | |
54f9ee45 | 1362 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1363 | |
b1fcee84 RD |
1364 | def CenterIn(*args, **kwargs): |
1365 | """ | |
1366 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1367 | ||
1368 | Center this rectangle within the one passed to the method, which is | |
1369 | usually, but not necessarily, the larger one. | |
1370 | """ | |
1371 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1372 | ||
1373 | CentreIn = CenterIn | |
54f9ee45 RD |
1374 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1375 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1376 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1377 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
e811c8ce | 1378 | def Set(*args, **kwargs): |
0df68c9f | 1379 | """ |
a95a7133 | 1380 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1381 | |
0df68c9f RD |
1382 | Set all rectangle properties. |
1383 | """ | |
54f9ee45 | 1384 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1385 | |
1386 | def Get(*args, **kwargs): | |
0df68c9f RD |
1387 | """ |
1388 | Get() -> (x,y,width,height) | |
e811c8ce | 1389 | |
0df68c9f RD |
1390 | Return the rectangle properties as a tuple. |
1391 | """ | |
54f9ee45 | 1392 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1393 | |
41e2b43e | 1394 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1395 | def __str__(self): return str(self.Get()) |
1396 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1397 | def __len__(self): return len(self.Get()) | |
1398 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1399 | def __setitem__(self, index, val): |
1400 | if index == 0: self.x = val | |
1401 | elif index == 1: self.y = val | |
1402 | elif index == 2: self.width = val | |
1403 | elif index == 3: self.height = val | |
1404 | else: raise IndexError | |
e811c8ce | 1405 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1406 | __safe_for_unpickling__ = True |
1407 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 | 1408 | |
33d6fd3b RD |
1409 | Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`") |
1410 | BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`") | |
1411 | Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`") | |
1412 | Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`") | |
1413 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
1414 | Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`") | |
1415 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
1416 | Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`") | |
1417 | TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`") | |
1418 | Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`") | |
1419 | X = property(GetX,SetX,doc="See `GetX` and `SetX`") | |
1420 | Y = property(GetY,SetY,doc="See `GetY` and `SetY`") | |
1421 | Empty = property(IsEmpty,doc="See `IsEmpty`") | |
2131d850 | 1422 | _core_.Rect_swigregister(Rect) |
d14a1e28 RD |
1423 | |
1424 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1425 | """ |
1426 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1427 | |
0df68c9f RD |
1428 | Create a new Rect object from Points representing two corners. |
1429 | """ | |
54f9ee45 | 1430 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1431 | return val |
1432 | ||
1433 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1434 | """ |
1435 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1436 | |
0df68c9f RD |
1437 | Create a new Rect from a position and size. |
1438 | """ | |
54f9ee45 | 1439 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1440 | return val |
1441 | ||
d3b6e4ff RD |
1442 | def RectS(*args, **kwargs): |
1443 | """ | |
1444 | RectS(Size size) -> Rect | |
1445 | ||
1446 | Create a new Rect from a size only. | |
1447 | """ | |
1448 | val = _core_.new_RectS(*args, **kwargs) | |
d3b6e4ff RD |
1449 | return val |
1450 | ||
d14a1e28 | 1451 | |
e811c8ce | 1452 | def IntersectRect(*args, **kwargs): |
0085ce49 | 1453 | """ |
0df68c9f | 1454 | IntersectRect(Rect r1, Rect r2) -> Rect |
e811c8ce | 1455 | |
0df68c9f RD |
1456 | Calculate and return the intersection of r1 and r2. |
1457 | """ | |
0085ce49 | 1458 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1459 | #--------------------------------------------------------------------------- |
1460 | ||
1461 | class Point2D(object): | |
41e2b43e RD |
1462 | """ |
1463 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1464 | with floating point values. | |
1465 | """ | |
0085ce49 RD |
1466 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1467 | __repr__ = _swig_repr | |
1468 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1469 | """ |
a95a7133 | 1470 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1471 | |
0df68c9f RD |
1472 | Create a w.Point2D object. |
1473 | """ | |
0085ce49 | 1474 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
e811c8ce | 1475 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1476 | """ |
1477 | GetFloor() -> (x,y) | |
1478 | ||
1479 | Convert to integer | |
1480 | """ | |
54f9ee45 | 1481 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1482 | |
1483 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1484 | """ |
1485 | GetRounded() -> (x,y) | |
1486 | ||
1487 | Convert to integer | |
1488 | """ | |
54f9ee45 | 1489 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1490 | |
1491 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1492 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1493 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1494 | |
1495 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1496 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1497 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1498 | |
1499 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1500 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1501 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1502 | |
1503 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1504 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1505 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1506 | |
d14a1e28 RD |
1507 | def SetPolarCoordinates(self, angle, length): |
1508 | self.SetVectorLength(length) | |
1509 | self.SetVectorAngle(angle) | |
1510 | def Normalize(self): | |
1511 | self.SetVectorLength(1.0) | |
1512 | ||
e811c8ce | 1513 | def GetDistance(*args, **kwargs): |
a95a7133 | 1514 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1515 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1516 | |
1517 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1518 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1519 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1520 | |
1521 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1522 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1523 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1524 | |
1525 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1526 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1527 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1528 | |
1529 | def __neg__(*args, **kwargs): | |
0df68c9f | 1530 | """ |
a95a7133 | 1531 | __neg__(self) -> Point2D |
e811c8ce | 1532 | |
0df68c9f RD |
1533 | the reflection of this point |
1534 | """ | |
54f9ee45 | 1535 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1536 | |
1537 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1538 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1539 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1540 | |
1541 | def __isub__(*args, **kwargs): | |
a95a7133 | 1542 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1543 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1544 | |
1545 | def __imul__(*args, **kwargs): | |
a95a7133 | 1546 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1547 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1548 | |
1549 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1550 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1551 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1552 | |
1553 | def __eq__(*args, **kwargs): | |
0df68c9f | 1554 | """ |
e9d6f3a4 | 1555 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1556 | |
e9d6f3a4 | 1557 | Test for equality of wx.Point2D objects. |
0df68c9f | 1558 | """ |
54f9ee45 | 1559 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1560 | |
1561 | def __ne__(*args, **kwargs): | |
0df68c9f | 1562 | """ |
e9d6f3a4 | 1563 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1564 | |
e9d6f3a4 | 1565 | Test for inequality of wx.Point2D objects. |
0df68c9f | 1566 | """ |
54f9ee45 | 1567 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1568 | |
54f9ee45 RD |
1569 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1570 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1571 | def Set(*args, **kwargs): |
a95a7133 | 1572 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1573 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1574 | |
1575 | def Get(*args, **kwargs): | |
0df68c9f RD |
1576 | """ |
1577 | Get() -> (x,y) | |
e811c8ce | 1578 | |
0df68c9f RD |
1579 | Return x and y properties as a tuple. |
1580 | """ | |
54f9ee45 | 1581 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1582 | |
41e2b43e | 1583 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1584 | def __str__(self): return str(self.Get()) |
1585 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1586 | def __len__(self): return len(self.Get()) | |
1587 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1588 | def __setitem__(self, index, val): |
e811c8ce RD |
1589 | if index == 0: self.x = val |
1590 | elif index == 1: self.y = val | |
d14a1e28 | 1591 | else: raise IndexError |
e811c8ce | 1592 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1593 | __safe_for_unpickling__ = True |
1594 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 | 1595 | |
33d6fd3b RD |
1596 | Floor = property(GetFloor,doc="See `GetFloor`") |
1597 | Rounded = property(GetRounded,doc="See `GetRounded`") | |
1598 | VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`") | |
1599 | VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`") | |
2131d850 | 1600 | _core_.Point2D_swigregister(Point2D) |
d14a1e28 RD |
1601 | |
1602 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1603 | """ |
1604 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1605 | |
0df68c9f RD |
1606 | Create a w.Point2D object. |
1607 | """ | |
54f9ee45 | 1608 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1609 | return val |
1610 | ||
1611 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1612 | """ |
1613 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1614 | |
0df68c9f RD |
1615 | Create a w.Point2D object. |
1616 | """ | |
54f9ee45 | 1617 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1618 | return val |
1619 | ||
1620 | #--------------------------------------------------------------------------- | |
1621 | ||
54f9ee45 RD |
1622 | FromStart = _core_.FromStart |
1623 | FromCurrent = _core_.FromCurrent | |
1624 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1625 | class InputStream(object): |
093d3ff1 | 1626 | """Proxy of C++ InputStream class""" |
0085ce49 RD |
1627 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1628 | __repr__ = _swig_repr | |
1629 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1630 | """__init__(self, PyObject p) -> InputStream""" |
0085ce49 RD |
1631 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1632 | __swig_destroy__ = _core_.delete_InputStream | |
1633 | __del__ = lambda self : None; | |
e811c8ce | 1634 | def close(*args, **kwargs): |
a95a7133 | 1635 | """close(self)""" |
54f9ee45 | 1636 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1637 | |
1638 | def flush(*args, **kwargs): | |
a95a7133 | 1639 | """flush(self)""" |
54f9ee45 | 1640 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
1641 | |
1642 | def eof(*args, **kwargs): | |
a95a7133 | 1643 | """eof(self) -> bool""" |
54f9ee45 | 1644 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
1645 | |
1646 | def read(*args, **kwargs): | |
a95a7133 | 1647 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 1648 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
1649 | |
1650 | def readline(*args, **kwargs): | |
a95a7133 | 1651 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 1652 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
1653 | |
1654 | def readlines(*args, **kwargs): | |
a95a7133 | 1655 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 1656 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
1657 | |
1658 | def seek(*args, **kwargs): | |
a95a7133 | 1659 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 1660 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
1661 | |
1662 | def tell(*args, **kwargs): | |
a95a7133 | 1663 | """tell(self) -> int""" |
54f9ee45 | 1664 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
1665 | |
1666 | def Peek(*args, **kwargs): | |
a95a7133 | 1667 | """Peek(self) -> char""" |
54f9ee45 | 1668 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
1669 | |
1670 | def GetC(*args, **kwargs): | |
a95a7133 | 1671 | """GetC(self) -> char""" |
54f9ee45 | 1672 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
1673 | |
1674 | def LastRead(*args, **kwargs): | |
a95a7133 | 1675 | """LastRead(self) -> size_t""" |
54f9ee45 | 1676 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
1677 | |
1678 | def CanRead(*args, **kwargs): | |
a95a7133 | 1679 | """CanRead(self) -> bool""" |
54f9ee45 | 1680 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
1681 | |
1682 | def Eof(*args, **kwargs): | |
a95a7133 | 1683 | """Eof(self) -> bool""" |
54f9ee45 | 1684 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
1685 | |
1686 | def Ungetch(*args, **kwargs): | |
a95a7133 | 1687 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 1688 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
1689 | |
1690 | def SeekI(*args, **kwargs): | |
a95a7133 | 1691 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 1692 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
1693 | |
1694 | def TellI(*args, **kwargs): | |
a95a7133 | 1695 | """TellI(self) -> long""" |
54f9ee45 | 1696 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 1697 | |
2131d850 | 1698 | _core_.InputStream_swigregister(InputStream) |
d14a1e28 RD |
1699 | DefaultPosition = cvar.DefaultPosition |
1700 | DefaultSize = cvar.DefaultSize | |
1701 | ||
1702 | class OutputStream(object): | |
093d3ff1 | 1703 | """Proxy of C++ OutputStream class""" |
0085ce49 RD |
1704 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1705 | def __init__(self): raise AttributeError, "No constructor defined" | |
1706 | __repr__ = _swig_repr | |
e811c8ce | 1707 | def write(*args, **kwargs): |
a95a7133 | 1708 | """write(self, PyObject obj)""" |
54f9ee45 | 1709 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 1710 | |
0085ce49 RD |
1711 | def LastWrite(*args, **kwargs): |
1712 | """LastWrite(self) -> size_t""" | |
1713 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d14a1e28 | 1714 | |
2131d850 | 1715 | _core_.OutputStream_swigregister(OutputStream) |
d14a1e28 RD |
1716 | |
1717 | #--------------------------------------------------------------------------- | |
1718 | ||
1719 | class FSFile(Object): | |
093d3ff1 | 1720 | """Proxy of C++ FSFile class""" |
0085ce49 RD |
1721 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1722 | __repr__ = _swig_repr | |
1723 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1724 | """ |
a95a7133 | 1725 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 1726 | DateTime modif) -> FSFile |
0df68c9f | 1727 | """ |
0085ce49 | 1728 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
0085ce49 RD |
1729 | __swig_destroy__ = _core_.delete_FSFile |
1730 | __del__ = lambda self : None; | |
e811c8ce | 1731 | def GetStream(*args, **kwargs): |
a95a7133 | 1732 | """GetStream(self) -> InputStream""" |
54f9ee45 | 1733 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce | 1734 | |
97ab0f6a RD |
1735 | def DetachStream(*args, **kwargs): |
1736 | """DetachStream(self)""" | |
1737 | return _core_.FSFile_DetachStream(*args, **kwargs) | |
1738 | ||
e811c8ce | 1739 | def GetMimeType(*args, **kwargs): |
a95a7133 | 1740 | """GetMimeType(self) -> String""" |
54f9ee45 | 1741 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1742 | |
1743 | def GetLocation(*args, **kwargs): | |
a95a7133 | 1744 | """GetLocation(self) -> String""" |
54f9ee45 | 1745 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
1746 | |
1747 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1748 | """GetAnchor(self) -> String""" |
54f9ee45 | 1749 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1750 | |
1751 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 1752 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 1753 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 1754 | |
97ab0f6a RD |
1755 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
1756 | Location = property(GetLocation,doc="See `GetLocation`") | |
1757 | MimeType = property(GetMimeType,doc="See `GetMimeType`") | |
1758 | ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`") | |
1759 | Stream = property(GetStream,doc="See `GetStream`") | |
2131d850 | 1760 | _core_.FSFile_swigregister(FSFile) |
d14a1e28 RD |
1761 | |
1762 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1763 | """Proxy of C++ CPPFileSystemHandler class""" |
0085ce49 RD |
1764 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1765 | def __init__(self): raise AttributeError, "No constructor defined" | |
1766 | __repr__ = _swig_repr | |
50f151d7 RD |
1767 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
1768 | __del__ = lambda self : None; | |
2131d850 | 1769 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d14a1e28 RD |
1770 | |
1771 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1772 | """Proxy of C++ FileSystemHandler class""" |
0085ce49 RD |
1773 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1774 | __repr__ = _swig_repr | |
1775 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1776 | """__init__(self) -> FileSystemHandler""" |
0085ce49 | 1777 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
d14a1e28 | 1778 | self._setCallbackInfo(self, FileSystemHandler) |
e811c8ce RD |
1779 | |
1780 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 1781 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 1782 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
1783 | |
1784 | def CanOpen(*args, **kwargs): | |
a95a7133 | 1785 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1786 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1787 | |
1788 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1789 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1790 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1791 | |
1792 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1793 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1794 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1795 | |
1796 | def FindNext(*args, **kwargs): | |
a95a7133 | 1797 | """FindNext(self) -> String""" |
54f9ee45 | 1798 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
1799 | |
1800 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 1801 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 1802 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
1803 | |
1804 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 1805 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 1806 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
1807 | |
1808 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1809 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 1810 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1811 | |
1812 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 1813 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 1814 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
1815 | |
1816 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 1817 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 1818 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 1819 | |
97ab0f6a RD |
1820 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
1821 | LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`") | |
1822 | MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`") | |
1823 | Protocol = property(GetProtocol,doc="See `GetProtocol`") | |
1824 | RightLocation = property(GetRightLocation,doc="See `GetRightLocation`") | |
2131d850 | 1825 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d14a1e28 RD |
1826 | |
1827 | class FileSystem(Object): | |
093d3ff1 | 1828 | """Proxy of C++ FileSystem class""" |
0085ce49 RD |
1829 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1830 | __repr__ = _swig_repr | |
1831 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1832 | """__init__(self) -> FileSystem""" |
0085ce49 RD |
1833 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
1834 | __swig_destroy__ = _core_.delete_FileSystem | |
1835 | __del__ = lambda self : None; | |
e811c8ce | 1836 | def ChangePathTo(*args, **kwargs): |
a95a7133 | 1837 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 1838 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
1839 | |
1840 | def GetPath(*args, **kwargs): | |
a95a7133 | 1841 | """GetPath(self) -> String""" |
54f9ee45 | 1842 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
1843 | |
1844 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1845 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 1846 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
1847 | |
1848 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1849 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1850 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
1851 | |
1852 | def FindNext(*args, **kwargs): | |
a95a7133 | 1853 | """FindNext(self) -> String""" |
54f9ee45 | 1854 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
1855 | |
1856 | def AddHandler(*args, **kwargs): | |
66c033b4 | 1857 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 1858 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
1859 | |
1860 | AddHandler = staticmethod(AddHandler) | |
97ab0f6a RD |
1861 | def RemoveHandler(*args, **kwargs): |
1862 | """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
1863 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
1864 | ||
1865 | RemoveHandler = staticmethod(RemoveHandler) | |
e811c8ce | 1866 | def CleanUpHandlers(*args, **kwargs): |
66c033b4 | 1867 | """CleanUpHandlers()""" |
54f9ee45 | 1868 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
1869 | |
1870 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1871 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 1872 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 1873 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
1874 | |
1875 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
1876 | def URLToFileName(*args, **kwargs): |
1877 | """URLToFileName(String url) -> String""" | |
1878 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1879 | ||
1880 | URLToFileName = staticmethod(URLToFileName) | |
97ab0f6a | 1881 | Path = property(GetPath,doc="See `GetPath`") |
2131d850 | 1882 | _core_.FileSystem_swigregister(FileSystem) |
d14a1e28 | 1883 | |
e811c8ce | 1884 | def FileSystem_AddHandler(*args, **kwargs): |
0085ce49 RD |
1885 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
1886 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d14a1e28 | 1887 | |
97ab0f6a RD |
1888 | def FileSystem_RemoveHandler(*args, **kwargs): |
1889 | """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
1890 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
1891 | ||
0085ce49 RD |
1892 | def FileSystem_CleanUpHandlers(*args): |
1893 | """FileSystem_CleanUpHandlers()""" | |
1894 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d14a1e28 | 1895 | |
e811c8ce | 1896 | def FileSystem_FileNameToURL(*args, **kwargs): |
0085ce49 RD |
1897 | """FileSystem_FileNameToURL(String filename) -> String""" |
1898 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d14a1e28 | 1899 | |
e811c8ce | 1900 | def FileSystem_URLToFileName(*args, **kwargs): |
0085ce49 RD |
1901 | """FileSystem_URLToFileName(String url) -> String""" |
1902 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2ef75293 | 1903 | |
d14a1e28 | 1904 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1905 | """Proxy of C++ InternetFSHandler class""" |
0085ce49 RD |
1906 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1907 | __repr__ = _swig_repr | |
1908 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1909 | """__init__(self) -> InternetFSHandler""" |
0085ce49 | 1910 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
e811c8ce | 1911 | def CanOpen(*args, **kwargs): |
a95a7133 | 1912 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1913 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1914 | |
1915 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1916 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1917 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 1918 | |
2131d850 | 1919 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d14a1e28 RD |
1920 | |
1921 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1922 | """Proxy of C++ ZipFSHandler class""" |
0085ce49 RD |
1923 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1924 | __repr__ = _swig_repr | |
1925 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1926 | """__init__(self) -> ZipFSHandler""" |
0085ce49 | 1927 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
e811c8ce | 1928 | def CanOpen(*args, **kwargs): |
a95a7133 | 1929 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1930 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1931 | |
1932 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1933 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1934 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1935 | |
1936 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1937 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1938 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1939 | |
1940 | def FindNext(*args, **kwargs): | |
a95a7133 | 1941 | """FindNext(self) -> String""" |
54f9ee45 | 1942 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1943 | |
2131d850 | 1944 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d14a1e28 RD |
1945 | |
1946 | ||
e811c8ce | 1947 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
0085ce49 RD |
1948 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
1949 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d14a1e28 | 1950 | |
e811c8ce | 1951 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
0085ce49 RD |
1952 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
1953 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d14a1e28 | 1954 | |
e811c8ce | 1955 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
0085ce49 RD |
1956 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
1957 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2ef75293 RD |
1958 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1959 | """ | |
1960 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1961 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1962 | arbitrary data. If a bitmap or image is used then the imgType | |
1963 | parameter should specify what kind of image file it should be | |
1964 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1965 | """ | |
1966 | if isinstance(dataItem, wx.Image): | |
1967 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1968 | elif isinstance(dataItem, wx.Bitmap): | |
1969 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1970 | elif type(dataItem) == str: | |
1971 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
1972 | else: | |
1973 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d14a1e28 RD |
1974 | |
1975 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1976 | """Proxy of C++ MemoryFSHandler class""" |
0085ce49 RD |
1977 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1978 | __repr__ = _swig_repr | |
1979 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1980 | """__init__(self) -> MemoryFSHandler""" |
0085ce49 | 1981 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
e811c8ce | 1982 | def RemoveFile(*args, **kwargs): |
66c033b4 | 1983 | """RemoveFile(String filename)""" |
54f9ee45 | 1984 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
1985 | |
1986 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 1987 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 1988 | def CanOpen(*args, **kwargs): |
a95a7133 | 1989 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1990 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1991 | |
1992 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1993 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1994 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1995 | |
1996 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1997 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1998 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1999 | |
2000 | def FindNext(*args, **kwargs): | |
a95a7133 | 2001 | """FindNext(self) -> String""" |
54f9ee45 | 2002 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2003 | |
2131d850 | 2004 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d14a1e28 | 2005 | |
e811c8ce | 2006 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
0085ce49 RD |
2007 | """MemoryFSHandler_RemoveFile(String filename)""" |
2008 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d14a1e28 | 2009 | |
bcd0d7b6 RD |
2010 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2011 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2012 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d14a1e28 RD |
2013 | #--------------------------------------------------------------------------- |
2014 | ||
2015 | class ImageHandler(Object): | |
27fb7603 RD |
2016 | """ |
2017 | This is the base class for implementing image file loading/saving, and | |
2018 | image creation from data. It is used within `wx.Image` and is not | |
2019 | normally seen by the application. | |
2020 | """ | |
0085ce49 RD |
2021 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2022 | def __init__(self): raise AttributeError, "No constructor defined" | |
2023 | __repr__ = _swig_repr | |
e811c8ce | 2024 | def GetName(*args, **kwargs): |
a95a7133 | 2025 | """GetName(self) -> String""" |
54f9ee45 | 2026 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
2027 | |
2028 | def GetExtension(*args, **kwargs): | |
a95a7133 | 2029 | """GetExtension(self) -> String""" |
54f9ee45 | 2030 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
2031 | |
2032 | def GetType(*args, **kwargs): | |
a95a7133 | 2033 | """GetType(self) -> long""" |
54f9ee45 | 2034 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
2035 | |
2036 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 2037 | """GetMimeType(self) -> String""" |
54f9ee45 | 2038 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
2039 | |
2040 | def CanRead(*args, **kwargs): | |
a95a7133 | 2041 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 2042 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce | 2043 | |
b02396e8 RD |
2044 | def CanReadStream(*args, **kwargs): |
2045 | """CanReadStream(self, InputStream stream) -> bool""" | |
2046 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2047 | ||
e811c8ce | 2048 | def SetName(*args, **kwargs): |
a95a7133 | 2049 | """SetName(self, String name)""" |
54f9ee45 | 2050 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
2051 | |
2052 | def SetExtension(*args, **kwargs): | |
a95a7133 | 2053 | """SetExtension(self, String extension)""" |
54f9ee45 | 2054 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
2055 | |
2056 | def SetType(*args, **kwargs): | |
a95a7133 | 2057 | """SetType(self, long type)""" |
54f9ee45 | 2058 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
2059 | |
2060 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2061 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2062 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2063 | |
97ab0f6a RD |
2064 | Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`") |
2065 | MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`") | |
2066 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
2067 | Type = property(GetType,SetType,doc="See `GetType` and `SetType`") | |
2131d850 | 2068 | _core_.ImageHandler_swigregister(ImageHandler) |
d14a1e28 | 2069 | |
943e8dfd RD |
2070 | class PyImageHandler(ImageHandler): |
2071 | """ | |
2072 | This is the base class for implementing image file loading/saving, and | |
2073 | image creation from data, all written in Python. To create a custom | |
2074 | image handler derive a new class from wx.PyImageHandler and provide | |
2075 | the following methods:: | |
2076 | ||
2077 | def DoCanRead(self, stream) --> bool | |
2078 | '''Check if this handler can read the image on the stream''' | |
2079 | ||
2080 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2081 | '''Load image data from the stream and load it into image.''' | |
2082 | ||
2083 | def SaveFile(self, image, stream, verbose) --> bool | |
2084 | '''Save the iamge data in image to the stream using | |
2085 | this handler's image file format.''' | |
2086 | ||
2087 | def GetImageCount(self, stream) --> int | |
2088 | '''If this image format can hold more than one image, | |
2089 | how many does the image on the stream have?''' | |
2090 | ||
2091 | To activate your handler create an instance of it and pass it to | |
2092 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2093 | `SetExtension` from your constructor. | |
2094 | ||
2095 | """ | |
0085ce49 RD |
2096 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2097 | __repr__ = _swig_repr | |
2098 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2099 | """ |
2100 | __init__(self) -> PyImageHandler | |
2101 | ||
2102 | This is the base class for implementing image file loading/saving, and | |
2103 | image creation from data, all written in Python. To create a custom | |
2104 | image handler derive a new class from wx.PyImageHandler and provide | |
2105 | the following methods:: | |
2106 | ||
2107 | def DoCanRead(self, stream) --> bool | |
2108 | '''Check if this handler can read the image on the stream''' | |
2109 | ||
2110 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2111 | '''Load image data from the stream and load it into image.''' | |
2112 | ||
2113 | def SaveFile(self, image, stream, verbose) --> bool | |
2114 | '''Save the iamge data in image to the stream using | |
2115 | this handler's image file format.''' | |
2116 | ||
2117 | def GetImageCount(self, stream) --> int | |
2118 | '''If this image format can hold more than one image, | |
2119 | how many does the image on the stream have?''' | |
2120 | ||
2121 | To activate your handler create an instance of it and pass it to | |
2122 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2123 | `SetExtension` from your constructor. | |
2124 | ||
2125 | """ | |
0085ce49 | 2126 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2127 | self._SetSelf(self) |
2128 | ||
2129 | def _SetSelf(*args, **kwargs): | |
2130 | """_SetSelf(self, PyObject self)""" | |
2131 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2132 | ||
2131d850 | 2133 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2134 | |
d14a1e28 | 2135 | class ImageHistogram(object): |
093d3ff1 | 2136 | """Proxy of C++ ImageHistogram class""" |
0085ce49 RD |
2137 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2138 | __repr__ = _swig_repr | |
2139 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2140 | """__init__(self) -> ImageHistogram""" |
0085ce49 | 2141 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
e811c8ce | 2142 | def MakeKey(*args, **kwargs): |
0df68c9f | 2143 | """ |
7a27cf7c | 2144 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2145 | |
0df68c9f RD |
2146 | Get the key in the histogram for the given RGB values |
2147 | """ | |
54f9ee45 | 2148 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce RD |
2149 | |
2150 | MakeKey = staticmethod(MakeKey) | |
2151 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2152 | """ |
2153 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2154 | ||
2155 | Find first colour that is not used in the image and has higher RGB | |
2156 | values than startR, startG, startB. Returns a tuple consisting of a | |
2157 | success flag and rgb values. | |
2158 | """ | |
54f9ee45 | 2159 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2160 | |
f1cbd8fa RD |
2161 | def GetCount(*args, **kwargs): |
2162 | """ | |
2163 | GetCount(self, unsigned long key) -> unsigned long | |
2164 | ||
2165 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2166 | key value from a RGB tripple. | |
2167 | """ | |
2168 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2169 | ||
2170 | def GetCountRGB(*args, **kwargs): | |
2171 | """ | |
7a27cf7c | 2172 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2173 | |
2174 | Returns the pixel count for the given RGB values. | |
2175 | """ | |
2176 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2177 | ||
2178 | def GetCountColour(*args, **kwargs): | |
2179 | """ | |
2180 | GetCountColour(self, Colour colour) -> unsigned long | |
2181 | ||
2182 | Returns the pixel count for the given `wx.Colour` value. | |
2183 | """ | |
2184 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2185 | ||
2131d850 | 2186 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d14a1e28 | 2187 | |
e811c8ce | 2188 | def ImageHistogram_MakeKey(*args, **kwargs): |
0085ce49 | 2189 | """ |
7a27cf7c | 2190 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2191 | |
0df68c9f RD |
2192 | Get the key in the histogram for the given RGB values |
2193 | """ | |
0085ce49 | 2194 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 | 2195 | |
943e8dfd RD |
2196 | class Image_RGBValue(object): |
2197 | """ | |
2198 | An object that contains values for red, green and blue which represent | |
2199 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2200 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2201 | color space. | |
2202 | """ | |
0085ce49 RD |
2203 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2204 | __repr__ = _swig_repr | |
2205 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2206 | """ |
2207 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2208 | ||
2209 | Constructor. | |
2210 | """ | |
0085ce49 | 2211 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2212 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2213 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2214 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2215 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2216 | |
2217 | class Image_HSVValue(object): | |
2218 | """ | |
2219 | An object that contains values for hue, saturation and value which | |
2220 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2221 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2222 | color space. | |
2223 | """ | |
0085ce49 RD |
2224 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2225 | __repr__ = _swig_repr | |
2226 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2227 | """ |
2228 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2229 | ||
2230 | Constructor. | |
2231 | """ | |
0085ce49 | 2232 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2233 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2234 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2235 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2236 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2237 | |
d14a1e28 | 2238 | class Image(Object): |
7a27cf7c RD |
2239 | """ |
2240 | A platform-independent image class. An image can be created from | |
2241 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2242 | variety of formats. Functions are available to set and get image | |
2243 | bits, so it can be used for basic image manipulation. | |
2244 | ||
2245 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2246 | platform-specific `wx.Bitmap` object must be created from it using the | |
2247 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2248 | device context, using `wx.DC.DrawBitmap`. | |
2249 | ||
2250 | One colour value of the image may be used as a mask colour which will | |
2251 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2252 | bitmap object. | |
2253 | ||
2254 | wx.Image supports alpha channel data, that is in addition to a byte | |
2255 | for the red, green and blue colour components for each pixel it also | |
2256 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2257 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2258 | means that the pixel is 100% opaque. | |
2259 | ||
2260 | Unlike RGB data, not all images have an alpha channel and before using | |
2261 | `GetAlpha` you should check if this image contains an alpha channel | |
2262 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2263 | with transparency information will have an alpha channel. | |
2264 | """ | |
0085ce49 RD |
2265 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2266 | __repr__ = _swig_repr | |
2267 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2268 | """ |
2269 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2270 | ||
2271 | Loads an image from a file. | |
2272 | """ | |
0085ce49 RD |
2273 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2274 | __swig_destroy__ = _core_.delete_Image | |
2275 | __del__ = lambda self : None; | |
e811c8ce | 2276 | def Create(*args, **kwargs): |
7a27cf7c RD |
2277 | """ |
2278 | Create(self, int width, int height, bool clear=True) | |
2279 | ||
2280 | Creates a fresh image. If clear is ``True``, the new image will be | |
2281 | initialized to black. Otherwise, the image data will be uninitialized. | |
2282 | """ | |
54f9ee45 | 2283 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2284 | |
2285 | def Destroy(*args, **kwargs): | |
0df68c9f | 2286 | """ |
a95a7133 | 2287 | Destroy(self) |
e811c8ce | 2288 | |
7a27cf7c | 2289 | Destroys the image data. |
0df68c9f | 2290 | """ |
7e08d4ef RD |
2291 | val = _core_.Image_Destroy(*args, **kwargs) |
2292 | args[0].thisown = 0 | |
2293 | return val | |
e811c8ce RD |
2294 | |
2295 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2296 | """ |
2297 | Scale(self, int width, int height) -> Image | |
2298 | ||
2299 | Returns a scaled version of the image. This is also useful for scaling | |
2300 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2301 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2302 | """ | |
54f9ee45 | 2303 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce RD |
2304 | |
2305 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2306 | """ |
2307 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2308 | ||
2309 | Return a version of the image scaled smaller by the given factors. | |
2310 | """ | |
54f9ee45 | 2311 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce RD |
2312 | |
2313 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2314 | """ |
2315 | Rescale(self, int width, int height) -> Image | |
2316 | ||
2317 | Changes the size of the image in-place by scaling it: after a call to | |
2318 | this function, the image will have the given width and height. | |
2319 | ||
2320 | Returns the (modified) image itself. | |
2321 | """ | |
54f9ee45 | 2322 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 2323 | |
aff4cc5c | 2324 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2325 | """ |
2326 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2327 | ||
2328 | Changes the size of the image in-place without scaling it, by adding | |
2329 | either a border with the given colour or cropping as necessary. The | |
2330 | image is pasted into a new image with the given size and background | |
2331 | colour at the position pos relative to the upper left of the new | |
2332 | image. If red = green = blue = -1 then use either the current mask | |
2333 | colour if set or find, use, and set a suitable mask colour for any | |
2334 | newly exposed areas. | |
2335 | ||
2336 | Returns the (modified) image itself. | |
2337 | """ | |
aff4cc5c RD |
2338 | return _core_.Image_Resize(*args, **kwargs) |
2339 | ||
e811c8ce | 2340 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2341 | """ |
2342 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2343 | ||
2344 | Sets the pixel at the given coordinate. This routine performs | |
2345 | bounds-checks for the coordinate so it can be considered a safe way to | |
2346 | manipulate the data, but in some cases this might be too slow so that | |
2347 | the data will have to be set directly. In that case you will have to | |
2348 | get access to the image data using the `GetData` method. | |
2349 | """ | |
54f9ee45 | 2350 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 2351 | |
aff4cc5c | 2352 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2353 | """ |
2354 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2355 | ||
2356 | Sets the colour of the pixels within the given rectangle. This routine | |
2357 | performs bounds-checks for the rectangle so it can be considered a | |
2358 | safe way to manipulate the data. | |
2359 | """ | |
aff4cc5c RD |
2360 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2361 | ||
e811c8ce | 2362 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2363 | """ |
2364 | GetRed(self, int x, int y) -> byte | |
2365 | ||
2366 | Returns the red intensity at the given coordinate. | |
2367 | """ | |
54f9ee45 | 2368 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce RD |
2369 | |
2370 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2371 | """ |
2372 | GetGreen(self, int x, int y) -> byte | |
2373 | ||
2374 | Returns the green intensity at the given coordinate. | |
2375 | """ | |
54f9ee45 | 2376 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce RD |
2377 | |
2378 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2379 | """ |
2380 | GetBlue(self, int x, int y) -> byte | |
2381 | ||
2382 | Returns the blue intensity at the given coordinate. | |
2383 | """ | |
54f9ee45 | 2384 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce RD |
2385 | |
2386 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2387 | """ |
2388 | SetAlpha(self, int x, int y, byte alpha) | |
2389 | ||
2390 | Sets the alpha value for the given pixel. This function should only be | |
2391 | called if the image has alpha channel data, use `HasAlpha` to check | |
2392 | for this. | |
2393 | """ | |
54f9ee45 | 2394 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce RD |
2395 | |
2396 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2397 | """ |
2398 | GetAlpha(self, int x, int y) -> byte | |
2399 | ||
2400 | Returns the alpha value for the given pixel. This function may only be | |
2401 | called for the images with alpha channel, use `HasAlpha` to check for | |
2402 | this. | |
2403 | ||
2404 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2405 | corresponds to the fully transparent pixels while the value of 255 to | |
2406 | the fully opaque pixels. | |
2407 | """ | |
54f9ee45 | 2408 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce RD |
2409 | |
2410 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2411 | """ |
2412 | HasAlpha(self) -> bool | |
2413 | ||
2414 | Returns true if this image has alpha channel, false otherwise. | |
2415 | """ | |
54f9ee45 | 2416 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 2417 | |
68350608 RD |
2418 | def InitAlpha(*args, **kwargs): |
2419 | """ | |
2420 | InitAlpha(self) | |
2421 | ||
2422 | Initializes the image alpha channel data. It is an error to call it if | |
2423 | the image already has alpha data. If it doesn't, alpha data will be by | |
2424 | default initialized to all pixels being fully opaque. But if the image | |
2425 | has a a mask colour, all mask pixels will be completely transparent. | |
2426 | """ | |
2427 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2428 | ||
bcd0d7b6 RD |
2429 | def IsTransparent(*args, **kwargs): |
2430 | """ | |
7a27cf7c | 2431 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2432 | |
7a27cf7c RD |
2433 | Returns ``True`` if this pixel is masked or has an alpha value less |
2434 | than the spcified threshold. | |
bcd0d7b6 RD |
2435 | """ |
2436 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2437 | ||
e811c8ce | 2438 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2439 | """ |
2440 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2441 | ||
2442 | Find first colour that is not used in the image and has higher RGB | |
2443 | values than startR, startG, startB. Returns a tuple consisting of a | |
2444 | success flag and rgb values. | |
2445 | """ | |
54f9ee45 | 2446 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2447 | |
4cf4100f RD |
2448 | def ConvertAlphaToMask(*args, **kwargs): |
2449 | """ | |
bcd0d7b6 | 2450 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2451 | |
7a27cf7c RD |
2452 | If the image has alpha channel, this method converts it to mask. All |
2453 | pixels with alpha value less than ``threshold`` are replaced with the | |
2454 | mask colour and the alpha channel is removed. The mask colour is | |
2455 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2456 | |
2457 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2458 | nothing. | |
2459 | """ | |
2460 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2461 | ||
8fb0e70a RD |
2462 | def ConvertColourToAlpha(*args, **kwargs): |
2463 | """ | |
7a27cf7c | 2464 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2465 | |
2466 | This method converts an image where the original alpha information is | |
2467 | only available as a shades of a colour (actually shades of grey) | |
2468 | typically when you draw anti-aliased text into a bitmap. The DC | |
2469 | drawing routines draw grey values on the black background although | |
2470 | they actually mean to draw white with differnt alpha values. This | |
2471 | method reverses it, assuming a black (!) background and white text. | |
2472 | The method will then fill up the whole image with the colour given. | |
2473 | """ | |
2474 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2475 | ||
e811c8ce | 2476 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2477 | """ |
2478 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2479 | ||
2480 | Sets the image's mask so that the pixels that have RGB value of | |
2481 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2482 | by first finding an unused colour in the image, setting this colour as | |
2483 | the mask colour and then using this colour to draw all pixels in the | |
2484 | image who corresponding pixel in mask has given RGB value. | |
2485 | ||
2486 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2487 | image or if there is no unused colour left. Returns ``True`` if the | |
2488 | mask was successfully applied. | |
2489 | ||
2490 | Note that this method involves computing the histogram, which is | |
2491 | computationally intensive operation. | |
2492 | """ | |
54f9ee45 | 2493 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce RD |
2494 | |
2495 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2496 | """ |
2497 | CanRead(String filename) -> bool | |
2498 | ||
2499 | Returns True if the image handlers can read this file. | |
2500 | """ | |
54f9ee45 | 2501 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce RD |
2502 | |
2503 | CanRead = staticmethod(CanRead) | |
2504 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2505 | """ |
2506 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2507 | ||
2508 | If the image file contains more than one image and the image handler | |
2509 | is capable of retrieving these individually, this function will return | |
2510 | the number of available images. | |
2511 | """ | |
54f9ee45 | 2512 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce RD |
2513 | |
2514 | GetImageCount = staticmethod(GetImageCount) | |
2515 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2516 | """ |
2517 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2518 | ||
2519 | Loads an image from a file. If no handler type is provided, the | |
2520 | library will try to autodetect the format. | |
2521 | """ | |
54f9ee45 | 2522 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce RD |
2523 | |
2524 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2525 | """ |
2526 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2527 | ||
2528 | Loads an image from a file, specifying the image type with a MIME type | |
2529 | string. | |
2530 | """ | |
54f9ee45 | 2531 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce RD |
2532 | |
2533 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2534 | """ |
2535 | SaveFile(self, String name, int type) -> bool | |
2536 | ||
2537 | Saves an image in the named file. | |
2538 | """ | |
54f9ee45 | 2539 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce RD |
2540 | |
2541 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2542 | """ |
2543 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2544 | ||
2545 | Saves an image in the named file. | |
2546 | """ | |
54f9ee45 | 2547 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce RD |
2548 | |
2549 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2550 | """ |
2551 | CanReadStream(InputStream stream) -> bool | |
2552 | ||
2553 | Returns True if the image handlers can read an image file from the | |
2554 | data currently on the input stream, or a readable Python file-like | |
2555 | object. | |
2556 | """ | |
54f9ee45 | 2557 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce RD |
2558 | |
2559 | CanReadStream = staticmethod(CanReadStream) | |
2560 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2561 | """ |
2562 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2563 | ||
2564 | Loads an image from an input stream or a readable Python file-like | |
2565 | object. If no handler type is provided, the library will try to | |
2566 | autodetect the format. | |
2567 | """ | |
54f9ee45 | 2568 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce RD |
2569 | |
2570 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2571 | """ |
2572 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2573 | ||
2574 | Loads an image from an input stream or a readable Python file-like | |
2575 | object, using a MIME type string to specify the image file format. | |
2576 | """ | |
54f9ee45 | 2577 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce RD |
2578 | |
2579 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2580 | """ |
2581 | Ok(self) -> bool | |
2582 | ||
2583 | Returns true if image data is present. | |
2584 | """ | |
54f9ee45 | 2585 | return _core_.Image_Ok(*args, **kwargs) |
e811c8ce RD |
2586 | |
2587 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2588 | """ |
2589 | GetWidth(self) -> int | |
2590 | ||
2591 | Gets the width of the image in pixels. | |
2592 | """ | |
54f9ee45 | 2593 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce RD |
2594 | |
2595 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2596 | """ |
2597 | GetHeight(self) -> int | |
2598 | ||
2599 | Gets the height of the image in pixels. | |
2600 | """ | |
54f9ee45 | 2601 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 2602 | |
b2df227b | 2603 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
2604 | """ |
2605 | GetSize(self) -> Size | |
2606 | ||
2607 | Returns the size of the image in pixels. | |
2608 | """ | |
54f9ee45 | 2609 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 2610 | |
e811c8ce | 2611 | def GetSubImage(*args, **kwargs): |
7a27cf7c RD |
2612 | """ |
2613 | GetSubImage(self, Rect rect) -> Image | |
2614 | ||
2615 | Returns a sub image of the current one as long as the rect belongs | |
2616 | entirely to the image. | |
2617 | """ | |
54f9ee45 | 2618 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 2619 | |
aff4cc5c | 2620 | def Size(*args, **kwargs): |
7a27cf7c RD |
2621 | """ |
2622 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2623 | ||
2624 | Returns a resized version of this image without scaling it by adding | |
2625 | either a border with the given colour or cropping as necessary. The | |
2626 | image is pasted into a new image with the given size and background | |
2627 | colour at the position ``pos`` relative to the upper left of the new | |
2628 | image. If red = green = blue = -1 then use either the current mask | |
2629 | colour if set or find, use, and set a suitable mask colour for any | |
2630 | newly exposed areas. | |
2631 | """ | |
aff4cc5c RD |
2632 | return _core_.Image_Size(*args, **kwargs) |
2633 | ||
e811c8ce | 2634 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2635 | """ |
2636 | Copy(self) -> Image | |
2637 | ||
2638 | Returns an identical copy of the image. | |
2639 | """ | |
54f9ee45 | 2640 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce RD |
2641 | |
2642 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2643 | """ |
2644 | Paste(self, Image image, int x, int y) | |
2645 | ||
2646 | Pastes ``image`` into this instance and takes care of the mask colour | |
2647 | and any out of bounds problems. | |
2648 | """ | |
54f9ee45 | 2649 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
2650 | |
2651 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
2652 | """ |
2653 | GetData(self) -> PyObject | |
2654 | ||
2655 | Returns a string containing a copy of the RGB bytes of the image. | |
2656 | """ | |
54f9ee45 | 2657 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
2658 | |
2659 | def SetData(*args, **kwargs): | |
61d07ac7 RD |
2660 | """ |
2661 | SetData(self, buffer data) | |
2662 | ||
2663 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2664 | either a string or a buffer object holding the data and the length of | |
2665 | the data must be width*height*3. | |
2666 | """ | |
54f9ee45 | 2667 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
2668 | |
2669 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2670 | """ |
2671 | GetDataBuffer(self) -> PyObject | |
2672 | ||
2673 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2674 | image data buffer inside the wx.Image. You need to ensure that you do |
2675 | not use this buffer object after the image has been destroyed. | |
61d07ac7 | 2676 | """ |
54f9ee45 | 2677 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2678 | |
2679 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2680 | """ |
2681 | SetDataBuffer(self, buffer data) | |
2682 | ||
2683 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2684 | object. This can save making an extra copy of the data but you must |
2685 | ensure that the buffer object lives longer than the wx.Image does. | |
61d07ac7 | 2686 | """ |
54f9ee45 | 2687 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2688 | |
2689 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2690 | """ |
2691 | GetAlphaData(self) -> PyObject | |
2692 | ||
2693 | Returns a string containing a copy of the alpha bytes of the image. | |
2694 | """ | |
54f9ee45 | 2695 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
2696 | |
2697 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2698 | """ |
2699 | SetAlphaData(self, buffer alpha) | |
2700 | ||
2701 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2702 | a string or a buffer object holding the data and the length of the | |
2703 | data must be width*height. | |
2704 | """ | |
54f9ee45 | 2705 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
2706 | |
2707 | def GetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2708 | """ |
2709 | GetAlphaBuffer(self) -> PyObject | |
2710 | ||
2711 | Returns a writable Python buffer object that is pointing at the Alpha | |
2712 | data buffer inside the wx.Image. You need to ensure that you do not | |
2713 | use this buffer object after the image has been destroyed. | |
2714 | """ | |
54f9ee45 | 2715 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2716 | |
2717 | def SetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2718 | """ |
2719 | SetAlphaBuffer(self, buffer alpha) | |
2720 | ||
2721 | Sets the internal image alpha pointer to point at a Python buffer | |
2722 | object. This can save making an extra copy of the data but you must | |
2723 | ensure that the buffer object lives as long as the wx.Image does. | |
2724 | """ | |
54f9ee45 | 2725 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2726 | |
2727 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2728 | """ |
2729 | SetMaskColour(self, byte r, byte g, byte b) | |
2730 | ||
2731 | Sets the mask colour for this image (and tells the image to use the | |
2732 | mask). | |
2733 | """ | |
54f9ee45 | 2734 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 2735 | |
aff4cc5c RD |
2736 | def GetOrFindMaskColour(*args, **kwargs): |
2737 | """ | |
2738 | GetOrFindMaskColour() -> (r,g,b) | |
2739 | ||
2740 | Get the current mask colour or find a suitable colour. | |
2741 | """ | |
2742 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2743 | ||
e811c8ce | 2744 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2745 | """ |
2746 | GetMaskRed(self) -> byte | |
2747 | ||
2748 | Gets the red component of the mask colour. | |
2749 | """ | |
54f9ee45 | 2750 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce RD |
2751 | |
2752 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2753 | """ |
2754 | GetMaskGreen(self) -> byte | |
2755 | ||
2756 | Gets the green component of the mask colour. | |
2757 | """ | |
54f9ee45 | 2758 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce RD |
2759 | |
2760 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2761 | """ |
2762 | GetMaskBlue(self) -> byte | |
2763 | ||
2764 | Gets the blue component of the mask colour. | |
2765 | """ | |
54f9ee45 | 2766 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce RD |
2767 | |
2768 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2769 | """ |
2770 | SetMask(self, bool mask=True) | |
2771 | ||
2772 | Specifies whether there is a mask or not. The area of the mask is | |
2773 | determined by the current mask colour. | |
2774 | """ | |
54f9ee45 | 2775 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce RD |
2776 | |
2777 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2778 | """ |
2779 | HasMask(self) -> bool | |
2780 | ||
2781 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2782 | """ | |
54f9ee45 | 2783 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
2784 | |
2785 | def Rotate(*args, **kwargs): | |
0df68c9f | 2786 | """ |
a95a7133 | 2787 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 2788 | Point offset_after_rotation=None) -> Image |
7a27cf7c RD |
2789 | |
2790 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2791 | ``True`` to ``interpolating`` results in better image quality, but is | |
2792 | slower. If the image has a mask, then the mask colour is used for the | |
2793 | uncovered pixels in the rotated image background. Otherwise, black | |
2794 | will be used as the fill colour. | |
2795 | ||
2796 | Returns the rotated image, leaving this image intact. | |
0df68c9f | 2797 | """ |
54f9ee45 | 2798 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce RD |
2799 | |
2800 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2801 | """ |
2802 | Rotate90(self, bool clockwise=True) -> Image | |
2803 | ||
2804 | Returns a copy of the image rotated 90 degrees in the direction | |
2805 | indicated by ``clockwise``. | |
2806 | """ | |
54f9ee45 | 2807 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce RD |
2808 | |
2809 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2810 | """ |
2811 | Mirror(self, bool horizontally=True) -> Image | |
2812 | ||
2813 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2814 | indicates the orientation. | |
2815 | """ | |
54f9ee45 | 2816 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
2817 | |
2818 | def Replace(*args, **kwargs): | |
0df68c9f | 2819 | """ |
7a27cf7c RD |
2820 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2821 | ||
2822 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2823 | ``(r2,g2,b2)``. | |
0df68c9f | 2824 | """ |
54f9ee45 | 2825 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce | 2826 | |
32fe5131 RD |
2827 | def ConvertToGreyscale(*args, **kwargs): |
2828 | """ | |
2829 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2830 | ||
2831 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2832 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2833 | defaults to ITU-T BT.601 | |
2834 | """ | |
2835 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2836 | ||
e811c8ce | 2837 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2838 | """ |
2839 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2840 | ||
2841 | Returns monochromatic version of the image. The returned image has | |
2842 | white colour where the original has ``(r,g,b)`` colour and black | |
2843 | colour everywhere else. | |
2844 | """ | |
54f9ee45 | 2845 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce RD |
2846 | |
2847 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2848 | """ |
2849 | SetOption(self, String name, String value) | |
2850 | ||
2851 | Sets an image handler defined option. For example, when saving as a | |
2852 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2853 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2854 | """ | |
54f9ee45 | 2855 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce RD |
2856 | |
2857 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2858 | """ |
2859 | SetOptionInt(self, String name, int value) | |
2860 | ||
2861 | Sets an image option as an integer. | |
2862 | """ | |
54f9ee45 | 2863 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce RD |
2864 | |
2865 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2866 | """ |
2867 | GetOption(self, String name) -> String | |
2868 | ||
2869 | Gets the value of an image handler option. | |
2870 | """ | |
54f9ee45 | 2871 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce RD |
2872 | |
2873 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2874 | """ |
2875 | GetOptionInt(self, String name) -> int | |
2876 | ||
2877 | Gets the value of an image handler option as an integer. If the given | |
2878 | option is not present, the function returns 0. | |
2879 | """ | |
54f9ee45 | 2880 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce RD |
2881 | |
2882 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2883 | """ |
2884 | HasOption(self, String name) -> bool | |
2885 | ||
2886 | Returns true if the given option is present. | |
2887 | """ | |
54f9ee45 | 2888 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
2889 | |
2890 | def CountColours(*args, **kwargs): | |
a95a7133 | 2891 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 2892 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
2893 | |
2894 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 2895 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 2896 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
2897 | |
2898 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2899 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 2900 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
2901 | |
2902 | AddHandler = staticmethod(AddHandler) | |
2903 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 2904 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 2905 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
2906 | |
2907 | InsertHandler = staticmethod(InsertHandler) | |
2908 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 2909 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 2910 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce RD |
2911 | |
2912 | RemoveHandler = staticmethod(RemoveHandler) | |
0085ce49 RD |
2913 | def GetHandlers(*args, **kwargs): |
2914 | """GetHandlers() -> PyObject""" | |
2915 | return _core_.Image_GetHandlers(*args, **kwargs) | |
2916 | ||
2917 | GetHandlers = staticmethod(GetHandlers) | |
e811c8ce | 2918 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
2919 | """ |
2920 | GetImageExtWildcard() -> String | |
2921 | ||
2922 | Iterates all registered wxImageHandler objects, and returns a string | |
2923 | containing file extension masks suitable for passing to file open/save | |
2924 | dialog boxes. | |
2925 | """ | |
54f9ee45 | 2926 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
2927 | |
2928 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2929 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 2930 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 2931 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
2932 | |
2933 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2934 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 2935 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce | 2936 | |
943e8dfd RD |
2937 | def RotateHue(*args, **kwargs): |
2938 | """ | |
2939 | RotateHue(self, double angle) | |
2940 | ||
2941 | Rotates the hue of each pixel of the image. Hue is a double in the | |
2942 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
2943 | """ | |
2944 | return _core_.Image_RotateHue(*args, **kwargs) | |
2945 | ||
2946 | def RGBtoHSV(*args, **kwargs): | |
2947 | """ | |
2948 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
2949 | ||
2950 | Converts a color in RGB color space to HSV color space. | |
2951 | """ | |
2952 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
2953 | ||
2954 | RGBtoHSV = staticmethod(RGBtoHSV) | |
2955 | def HSVtoRGB(*args, **kwargs): | |
2956 | """ | |
2957 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
2958 | ||
2959 | Converts a color in HSV color space to RGB color space. | |
2960 | """ | |
2961 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
2962 | ||
2963 | HSVtoRGB = staticmethod(HSVtoRGB) | |
e811c8ce | 2964 | def __nonzero__(self): return self.Ok() |
97ab0f6a RD |
2965 | AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`") |
2966 | AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`") | |
2967 | Data = property(GetData,SetData,doc="See `GetData` and `SetData`") | |
2968 | DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`") | |
2969 | Height = property(GetHeight,doc="See `GetHeight`") | |
2970 | MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`") | |
2971 | MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`") | |
2972 | MaskRed = property(GetMaskRed,doc="See `GetMaskRed`") | |
2973 | Size = property(GetSize,doc="See `GetSize`") | |
2974 | Width = property(GetWidth,doc="See `GetWidth`") | |
2131d850 | 2975 | _core_.Image_swigregister(Image) |
d14a1e28 RD |
2976 | |
2977 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
2978 | """ |
2979 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
2980 | ||
2981 | Loads an image from a file, using a MIME type string (such as | |
2982 | 'image/jpeg') to specify image type. | |
2983 | """ | |
54f9ee45 | 2984 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 RD |
2985 | return val |
2986 | ||
2987 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
2988 | """ |
2989 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2990 | ||
2991 | Loads an image from an input stream, or any readable Python file-like | |
2992 | object. | |
2993 | """ | |
54f9ee45 | 2994 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 RD |
2995 | return val |
2996 | ||
2997 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
2998 | """ |
2999 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3000 | ||
3001 | Loads an image from an input stream, or any readable Python file-like | |
3002 | object, specifying the image format with a MIME type string. | |
3003 | """ | |
54f9ee45 | 3004 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
3005 | return val |
3006 | ||
66c033b4 | 3007 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
3008 | """ |
3009 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
3010 | ||
3011 | Construct an empty image of a given size, optionally setting all | |
3012 | pixels to black. | |
3013 | """ | |
66c033b4 | 3014 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
3015 | return val |
3016 | ||
3017 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
3018 | """ |
3019 | ImageFromBitmap(Bitmap bitmap) -> Image | |
3020 | ||
3021 | Construct an Image from a `wx.Bitmap`. | |
3022 | """ | |
54f9ee45 | 3023 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
3024 | return val |
3025 | ||
3026 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
3027 | """ |
3028 | ImageFromData(int width, int height, buffer data) -> Image | |
3029 | ||
3030 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3031 | string or a buffer object holding the data and the length of the data | |
3032 | must be width*height*3. | |
3033 | """ | |
54f9ee45 | 3034 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
3035 | return val |
3036 | ||
1823fbb4 | 3037 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
3038 | """ |
3039 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
3040 | ||
3041 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3042 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
3043 | length of the data must be width*height*3 bytes, and the length of the |
3044 | alpha data must be width*height bytes. | |
61d07ac7 | 3045 | """ |
1823fbb4 | 3046 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
1823fbb4 RD |
3047 | return val |
3048 | ||
e811c8ce | 3049 | def Image_CanRead(*args, **kwargs): |
0085ce49 | 3050 | """ |
7a27cf7c RD |
3051 | Image_CanRead(String filename) -> bool |
3052 | ||
3053 | Returns True if the image handlers can read this file. | |
3054 | """ | |
0085ce49 | 3055 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 3056 | |
e811c8ce | 3057 | def Image_GetImageCount(*args, **kwargs): |
0085ce49 | 3058 | """ |
7a27cf7c RD |
3059 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
3060 | ||
3061 | If the image file contains more than one image and the image handler | |
3062 | is capable of retrieving these individually, this function will return | |
3063 | the number of available images. | |
3064 | """ | |
0085ce49 | 3065 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 3066 | |
e811c8ce | 3067 | def Image_CanReadStream(*args, **kwargs): |
0085ce49 | 3068 | """ |
7a27cf7c RD |
3069 | Image_CanReadStream(InputStream stream) -> bool |
3070 | ||
3071 | Returns True if the image handlers can read an image file from the | |
3072 | data currently on the input stream, or a readable Python file-like | |
3073 | object. | |
3074 | """ | |
0085ce49 | 3075 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 3076 | |
e811c8ce | 3077 | def Image_AddHandler(*args, **kwargs): |
0085ce49 RD |
3078 | """Image_AddHandler(ImageHandler handler)""" |
3079 | return _core_.Image_AddHandler(*args, **kwargs) | |
d14a1e28 | 3080 | |
e811c8ce | 3081 | def Image_InsertHandler(*args, **kwargs): |
0085ce49 RD |
3082 | """Image_InsertHandler(ImageHandler handler)""" |
3083 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d14a1e28 | 3084 | |
e811c8ce | 3085 | def Image_RemoveHandler(*args, **kwargs): |
0085ce49 RD |
3086 | """Image_RemoveHandler(String name) -> bool""" |
3087 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d14a1e28 | 3088 | |
0085ce49 RD |
3089 | def Image_GetHandlers(*args): |
3090 | """Image_GetHandlers() -> PyObject""" | |
3091 | return _core_.Image_GetHandlers(*args) | |
3092 | ||
3093 | def Image_GetImageExtWildcard(*args): | |
3094 | """ | |
7a27cf7c RD |
3095 | Image_GetImageExtWildcard() -> String |
3096 | ||
3097 | Iterates all registered wxImageHandler objects, and returns a string | |
3098 | containing file extension masks suitable for passing to file open/save | |
3099 | dialog boxes. | |
3100 | """ | |
0085ce49 | 3101 | return _core_.Image_GetImageExtWildcard(*args) |
d14a1e28 | 3102 | |
943e8dfd | 3103 | def Image_RGBtoHSV(*args, **kwargs): |
0085ce49 | 3104 | """ |
943e8dfd RD |
3105 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3106 | ||
3107 | Converts a color in RGB color space to HSV color space. | |
3108 | """ | |
0085ce49 | 3109 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3110 | |
3111 | def Image_HSVtoRGB(*args, **kwargs): | |
0085ce49 | 3112 | """ |
943e8dfd RD |
3113 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3114 | ||
3115 | Converts a color in HSV color space to RGB color space. | |
3116 | """ | |
0085ce49 | 3117 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3118 | |
fc46b7f3 RD |
3119 | |
3120 | def _ImageFromBuffer(*args, **kwargs): | |
3121 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3122 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3123 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3124 | """ | |
3125 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
eec1c382 RD |
3126 | parameter must be a Python object that implements the buffer interface, |
3127 | such as a string, array, etc. The dataBuffer object is expected to | |
3128 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3129 | object can optionally be supplied for the image's alpha channel data, and | |
3130 | it is expected to be width*height bytes long. | |
fc46b7f3 RD |
3131 | |
3132 | The wx.Image will be created with its data and alpha pointers initialized | |
3133 | to the memory address pointed to by the buffer objects, thus saving the | |
3134 | time needed to copy the image data from the buffer object to the wx.Image. | |
3135 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3136 | risks associated with sharing a C pointer between two objects. | |
3137 | ||
3138 | To help alleviate the risk a reference to the data and alpha buffer | |
3139 | objects are kept with the wx.Image, so that they won't get deleted until | |
3140 | after the wx.Image is deleted. However please be aware that it is not | |
3141 | guaranteed that an object won't move its memory buffer to a new location | |
3142 | when it needs to resize its contents. If that happens then the wx.Image | |
3143 | will end up referring to an invalid memory location and could cause the | |
3144 | application to crash. Therefore care should be taken to not manipulate | |
3145 | the objects used for the data and alpha buffers in a way that would cause | |
3146 | them to change size. | |
3147 | """ | |
fc46b7f3 RD |
3148 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) |
3149 | image._buffer = dataBuffer | |
3150 | image._alpha = alphaBuffer | |
3151 | return image | |
3152 | ||
5e4ca4a8 RD |
3153 | def InitAllImageHandlers(): |
3154 | """ | |
3155 | The former functionality of InitAllImageHanders is now done internal to | |
3156 | the _core_ extension module and so this function has become a simple NOP. | |
3157 | """ | |
3158 | pass | |
d14a1e28 | 3159 | |
54f9ee45 RD |
3160 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3161 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3162 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3163 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3164 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
54f9ee45 RD |
3165 | BMP_24BPP = _core_.BMP_24BPP |
3166 | BMP_8BPP = _core_.BMP_8BPP | |
3167 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3168 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3169 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3170 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3171 | BMP_4BPP = _core_.BMP_4BPP | |
3172 | BMP_1BPP = _core_.BMP_1BPP | |
3173 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
d14a1e28 | 3174 | class BMPHandler(ImageHandler): |
27fb7603 | 3175 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
0085ce49 RD |
3176 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3177 | __repr__ = _swig_repr | |
3178 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3179 | """ |
3180 | __init__(self) -> BMPHandler | |
3181 | ||
3182 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3183 | """ | |
0085ce49 | 3184 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3185 | _core_.BMPHandler_swigregister(BMPHandler) |
d14a1e28 | 3186 | NullImage = cvar.NullImage |
0c243d93 | 3187 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 RD |
3188 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3189 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3190 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3191 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
0c243d93 RD |
3192 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3193 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3194 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3195 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 RD |
3196 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3197 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3198 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3199 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3200 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3201 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3202 | |
3203 | class ICOHandler(BMPHandler): | |
27fb7603 | 3204 | """A `wx.ImageHandler` for \*.ico icon files.""" |
0085ce49 RD |
3205 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3206 | __repr__ = _swig_repr | |
3207 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3208 | """ |
3209 | __init__(self) -> ICOHandler | |
3210 | ||
3211 | A `wx.ImageHandler` for \*.ico icon files. | |
3212 | """ | |
0085ce49 | 3213 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3214 | _core_.ICOHandler_swigregister(ICOHandler) |
d14a1e28 RD |
3215 | |
3216 | class CURHandler(ICOHandler): | |
27fb7603 | 3217 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
0085ce49 RD |
3218 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3219 | __repr__ = _swig_repr | |
3220 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3221 | """ |
3222 | __init__(self) -> CURHandler | |
3223 | ||
3224 | A `wx.ImageHandler` for \*.cur cursor files. | |
3225 | """ | |
0085ce49 | 3226 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3227 | _core_.CURHandler_swigregister(CURHandler) |
d14a1e28 RD |
3228 | |
3229 | class ANIHandler(CURHandler): | |
27fb7603 | 3230 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
0085ce49 RD |
3231 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3232 | __repr__ = _swig_repr | |
3233 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3234 | """ |
3235 | __init__(self) -> ANIHandler | |
3236 | ||
3237 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3238 | """ | |
0085ce49 | 3239 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3240 | _core_.ANIHandler_swigregister(ANIHandler) |
d14a1e28 RD |
3241 | |
3242 | class PNGHandler(ImageHandler): | |
27fb7603 | 3243 | """A `wx.ImageHandler` for PNG image files.""" |
0085ce49 RD |
3244 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3245 | __repr__ = _swig_repr | |
3246 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3247 | """ |
3248 | __init__(self) -> PNGHandler | |
3249 | ||
3250 | A `wx.ImageHandler` for PNG image files. | |
3251 | """ | |
0085ce49 | 3252 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3253 | _core_.PNGHandler_swigregister(PNGHandler) |
d14a1e28 RD |
3254 | |
3255 | class GIFHandler(ImageHandler): | |
27fb7603 | 3256 | """A `wx.ImageHandler` for GIF image files.""" |
0085ce49 RD |
3257 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3258 | __repr__ = _swig_repr | |
3259 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3260 | """ |
3261 | __init__(self) -> GIFHandler | |
3262 | ||
3263 | A `wx.ImageHandler` for GIF image files. | |
3264 | """ | |
0085ce49 | 3265 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3266 | _core_.GIFHandler_swigregister(GIFHandler) |
d14a1e28 RD |
3267 | |
3268 | class PCXHandler(ImageHandler): | |
27fb7603 | 3269 | """A `wx.ImageHandler` for PCX imager files.""" |
0085ce49 RD |
3270 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3271 | __repr__ = _swig_repr | |
3272 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3273 | """ |
3274 | __init__(self) -> PCXHandler | |
3275 | ||
3276 | A `wx.ImageHandler` for PCX imager files. | |
3277 | """ | |
0085ce49 | 3278 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3279 | _core_.PCXHandler_swigregister(PCXHandler) |
d14a1e28 RD |
3280 | |
3281 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3282 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
0085ce49 RD |
3283 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3284 | __repr__ = _swig_repr | |
3285 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3286 | """ |
3287 | __init__(self) -> JPEGHandler | |
3288 | ||
3289 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3290 | """ | |
0085ce49 | 3291 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3292 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d14a1e28 RD |
3293 | |
3294 | class PNMHandler(ImageHandler): | |
27fb7603 | 3295 | """A `wx.ImageHandler` for PNM image files.""" |
0085ce49 RD |
3296 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3297 | __repr__ = _swig_repr | |
3298 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3299 | """ |
3300 | __init__(self) -> PNMHandler | |
3301 | ||
3302 | A `wx.ImageHandler` for PNM image files. | |
3303 | """ | |
0085ce49 | 3304 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3305 | _core_.PNMHandler_swigregister(PNMHandler) |
d14a1e28 RD |
3306 | |
3307 | class XPMHandler(ImageHandler): | |
27fb7603 | 3308 | """A `wx.ImageHandler` for XPM image.""" |
0085ce49 RD |
3309 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3310 | __repr__ = _swig_repr | |
3311 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3312 | """ |
3313 | __init__(self) -> XPMHandler | |
3314 | ||
3315 | A `wx.ImageHandler` for XPM image. | |
3316 | """ | |
0085ce49 | 3317 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3318 | _core_.XPMHandler_swigregister(XPMHandler) |
d14a1e28 RD |
3319 | |
3320 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3321 | """A `wx.ImageHandler` for TIFF image files.""" |
0085ce49 RD |
3322 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3323 | __repr__ = _swig_repr | |
3324 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3325 | """ |
3326 | __init__(self) -> TIFFHandler | |
3327 | ||
3328 | A `wx.ImageHandler` for TIFF image files. | |
3329 | """ | |
0085ce49 | 3330 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3331 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d14a1e28 | 3332 | |
c0de73ae RD |
3333 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3334 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3335 | class Quantize(object): | |
3336 | """Performs quantization, or colour reduction, on a wxImage.""" | |
0085ce49 RD |
3337 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3338 | def __init__(self): raise AttributeError, "No constructor defined" | |
3339 | __repr__ = _swig_repr | |
c0de73ae RD |
3340 | def Quantize(*args, **kwargs): |
3341 | """ | |
3342 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3343 | ||
3344 | Reduce the colours in the source image and put the result into the | |
3345 | destination image, setting the palette in the destination if | |
3346 | needed. Both images may be the same, to overwrite the source image. | |
3347 | """ | |
3348 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3349 | ||
3350 | Quantize = staticmethod(Quantize) | |
2131d850 | 3351 | _core_.Quantize_swigregister(Quantize) |
c0de73ae RD |
3352 | |
3353 | def Quantize_Quantize(*args, **kwargs): | |
0085ce49 | 3354 | """ |
c0de73ae RD |
3355 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
3356 | ||
3357 | Reduce the colours in the source image and put the result into the | |
3358 | destination image, setting the palette in the destination if | |
3359 | needed. Both images may be the same, to overwrite the source image. | |
3360 | """ | |
0085ce49 | 3361 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3362 | |
d14a1e28 RD |
3363 | #--------------------------------------------------------------------------- |
3364 | ||
3365 | class EvtHandler(Object): | |
093d3ff1 | 3366 | """Proxy of C++ EvtHandler class""" |
0085ce49 RD |
3367 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3368 | __repr__ = _swig_repr | |
3369 | def __init__(self, *args, **kwargs): | |
a95a7133 | 3370 | """__init__(self) -> EvtHandler""" |
0085ce49 | 3371 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
d49bdf34 RD |
3372 | self._setOORInfo(self) |
3373 | ||
e811c8ce | 3374 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3375 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3376 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3377 | |
3378 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3379 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3380 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3381 | |
3382 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3383 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3384 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3385 | |
3386 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3387 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3388 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3389 | |
3390 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3391 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3392 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3393 | |
3394 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3395 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3396 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3397 | |
3398 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3399 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3400 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3401 | |
3402 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3403 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3404 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3405 | |
3406 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3407 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3408 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3409 | |
3410 | def Connect(*args, **kwargs): | |
a95a7133 | 3411 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3412 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3413 | |
3414 | def Disconnect(*args, **kwargs): | |
2131d850 | 3415 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3416 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3417 | |
3418 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3419 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef RD |
3420 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3421 | args[0].thisown = 0 | |
3422 | return val | |
e811c8ce | 3423 | |
d14a1e28 RD |
3424 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3425 | """ | |
3426 | Bind an event to an event handler. | |
3427 | ||
db3e571a RD |
3428 | :param event: One of the EVT_* objects that specifies the |
3429 | type of event to bind, | |
d14a1e28 | 3430 | |
db3e571a RD |
3431 | :param handler: A callable object to be invoked when the |
3432 | event is delivered to self. Pass None to | |
3433 | disconnect an event handler. | |
d14a1e28 | 3434 | |
db3e571a RD |
3435 | :param source: Sometimes the event originates from a |
3436 | different window than self, but you still | |
3437 | want to catch it in self. (For example, a | |
3438 | button event delivered to a frame.) By | |
3439 | passing the source of the event, the event | |
3440 | handling system is able to differentiate | |
3441 | between the same event type from different | |
3442 | controls. | |
d14a1e28 | 3443 | |
db3e571a RD |
3444 | :param id: Used to spcify the event source by ID instead |
3445 | of instance. | |
3446 | ||
3447 | :param id2: Used when it is desirable to bind a handler | |
3448 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d14a1e28 RD |
3449 | """ |
3450 | if source is not None: | |
3451 | id = source.GetId() | |
3452 | event.Bind(self, id, id2, handler) | |
3453 | ||
66c033b4 RD |
3454 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3455 | """ | |
3456 | Disconencts the event handler binding for event from self. | |
3457 | Returns True if successful. | |
3458 | """ | |
3459 | if source is not None: | |
3460 | id = source.GetId() | |
3461 | return event.Unbind(self, id, id2) | |
d14a1e28 | 3462 | |
97ab0f6a RD |
3463 | EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`") |
3464 | NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`") | |
3465 | PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`") | |
2131d850 | 3466 | _core_.EvtHandler_swigregister(EvtHandler) |
d14a1e28 RD |
3467 | |
3468 | #--------------------------------------------------------------------------- | |
3469 | ||
3470 | class PyEventBinder(object): | |
3471 | """ | |
3472 | Instances of this class are used to bind specific events to event | |
3473 | handlers. | |
3474 | """ | |
3475 | def __init__(self, evtType, expectedIDs=0): | |
3476 | if expectedIDs not in [0, 1, 2]: | |
3477 | raise ValueError, "Invalid number of expectedIDs" | |
3478 | self.expectedIDs = expectedIDs | |
3479 | ||
3480 | if type(evtType) == list or type(evtType) == tuple: | |
3481 | self.evtType = evtType | |
3482 | else: | |
3483 | self.evtType = [evtType] | |
3484 | ||
3485 | ||
3486 | def Bind(self, target, id1, id2, function): | |
3487 | """Bind this set of event types to target.""" | |
3488 | for et in self.evtType: | |
3489 | target.Connect(id1, id2, et, function) | |
3490 | ||
66c033b4 RD |
3491 | |
3492 | def Unbind(self, target, id1, id2): | |
3493 | """Remove an event binding.""" | |
3494 | success = 0 | |
3495 | for et in self.evtType: | |
3496 | success += target.Disconnect(id1, id2, et) | |
3497 | return success != 0 | |
3498 | ||
d14a1e28 RD |
3499 | |
3500 | def __call__(self, *args): | |
3501 | """ | |
3502 | For backwards compatibility with the old EVT_* functions. | |
3503 | Should be called with either (window, func), (window, ID, | |
3504 | func) or (window, ID1, ID2, func) parameters depending on the | |
3505 | type of the event. | |
3506 | """ | |
3507 | assert len(args) == 2 + self.expectedIDs | |
3508 | id1 = wx.ID_ANY | |
3509 | id2 = wx.ID_ANY | |
3510 | target = args[0] | |
3511 | if self.expectedIDs == 0: | |
3512 | func = args[1] | |
3513 | elif self.expectedIDs == 1: | |
3514 | id1 = args[1] | |
3515 | func = args[2] | |
3516 | elif self.expectedIDs == 2: | |
3517 | id1 = args[1] | |
3518 | id2 = args[2] | |
3519 | func = args[3] | |
3520 | else: | |
3521 | raise ValueError, "Unexpected number of IDs" | |
3522 | ||
3523 | self.Bind(target, id1, id2, func) | |
3524 | ||
3525 | ||
3526 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3527 | def EVT_COMMAND(win, id, cmd, func): | |
3528 | win.Connect(id, -1, cmd, func) | |
3529 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3530 | win.Connect(id1, id2, cmd, func) | |
3531 | ||
3532 | ||
3533 | #--------------------------------------------------------------------------- | |
3534 | ||
3535 | #--------------------------------------------------------------------------- | |
3536 | ||
54f9ee45 RD |
3537 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3538 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3539 | |
0085ce49 | 3540 | def NewEventType(*args): |
2131d850 | 3541 | """NewEventType() -> EventType""" |
0085ce49 | 3542 | return _core_.NewEventType(*args) |
54f9ee45 RD |
3543 | wxEVT_NULL = _core_.wxEVT_NULL |
3544 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3545 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3546 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3547 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3548 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3549 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3550 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3551 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3552 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3553 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3554 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3555 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3556 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3557 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3558 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3559 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3560 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3561 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3562 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3563 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3564 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3565 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3566 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3567 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3568 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3569 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3570 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3571 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3572 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3573 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3574 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3575 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3576 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3577 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3578 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3579 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3580 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3581 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3582 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3583 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3584 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3585 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3586 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3587 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3588 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3589 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3590 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3591 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3592 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3593 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3594 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3595 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3596 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3597 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3598 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3599 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3600 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3601 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3602 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3603 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3604 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3605 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3606 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
54f9ee45 RD |
3607 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3608 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3609 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3610 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3611 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3612 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3613 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3614 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3615 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3616 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3617 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3618 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3619 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3620 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
54f9ee45 RD |
3621 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
3622 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3623 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3624 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3625 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3626 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3627 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
34e0a3bb | 3628 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST |
54f9ee45 RD |
3629 | wxEVT_PAINT = _core_.wxEVT_PAINT |
3630 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3631 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3632 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3633 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3634 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3635 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3636 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3637 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3638 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3639 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3640 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3641 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3642 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3643 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3644 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3645 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3646 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3647 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3648 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3649 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3650 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3651 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
2131d850 RD |
3652 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
3653 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
3654 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
54f9ee45 RD |
3655 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3656 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3657 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3658 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3659 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3660 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3661 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
3662 | # |
3663 | # Create some event binders | |
3664 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3665 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3666 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3667 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3668 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3669 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3670 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3671 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3672 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3673 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3674 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3675 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3676 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 3677 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d14a1e28 RD |
3678 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
3679 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3680 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3681 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3682 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3683 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3684 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3685 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3686 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3687 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 3688 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
3689 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3690 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3691 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3692 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3693 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3694 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3695 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3696 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3697 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3698 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3699 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3700 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3701 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3702 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3703 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3704 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
34e0a3bb | 3705 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) |
d14a1e28 RD |
3706 | |
3707 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3708 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3709 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3710 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3711 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3712 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3713 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3714 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3715 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3716 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3717 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3718 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3719 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3720 | ||
3721 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3722 | wxEVT_LEFT_UP, | |
3723 | wxEVT_MIDDLE_DOWN, | |
3724 | wxEVT_MIDDLE_UP, | |
3725 | wxEVT_RIGHT_DOWN, | |
3726 | wxEVT_RIGHT_UP, | |
3727 | wxEVT_MOTION, | |
3728 | wxEVT_LEFT_DCLICK, | |
3729 | wxEVT_MIDDLE_DCLICK, | |
3730 | wxEVT_RIGHT_DCLICK, | |
3731 | wxEVT_ENTER_WINDOW, | |
3732 | wxEVT_LEAVE_WINDOW, | |
3733 | wxEVT_MOUSEWHEEL | |
3734 | ]) | |
3735 | ||
3736 | ||
3737 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 3738 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d14a1e28 RD |
3739 | wxEVT_SCROLLWIN_BOTTOM, |
3740 | wxEVT_SCROLLWIN_LINEUP, | |
3741 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 3742 | wxEVT_SCROLLWIN_PAGEUP, |
d14a1e28 RD |
3743 | wxEVT_SCROLLWIN_PAGEDOWN, |
3744 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3745 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3746 | ]) | |
3747 | ||
3748 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3749 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3750 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3751 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3752 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3753 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3754 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3755 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3756 | ||
27fb7603 | 3757 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
3758 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3759 | wxEVT_SCROLL_BOTTOM, | |
3760 | wxEVT_SCROLL_LINEUP, | |
3761 | wxEVT_SCROLL_LINEDOWN, | |
3762 | wxEVT_SCROLL_PAGEUP, | |
3763 | wxEVT_SCROLL_PAGEDOWN, | |
3764 | wxEVT_SCROLL_THUMBTRACK, | |
3765 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3766 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3767 | ]) |
3768 | ||
3769 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3770 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3771 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3772 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3773 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3774 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3775 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3776 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3777 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3778 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 3779 | |
27fb7603 | 3780 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
3781 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3782 | wxEVT_SCROLL_BOTTOM, | |
3783 | wxEVT_SCROLL_LINEUP, | |
3784 | wxEVT_SCROLL_LINEDOWN, | |
3785 | wxEVT_SCROLL_PAGEUP, | |
3786 | wxEVT_SCROLL_PAGEDOWN, | |
3787 | wxEVT_SCROLL_THUMBTRACK, | |
d14a1e28 | 3788 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 3789 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3790 | ], 1) |
3791 | ||
3792 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3793 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3794 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3795 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3796 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3797 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3798 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3799 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3800 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3801 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d14a1e28 | 3802 | |
d14a1e28 RD |
3803 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
3804 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3805 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3806 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3807 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3808 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3809 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3810 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3811 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3812 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3813 | ||
3814 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3815 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3816 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3817 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3818 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3819 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3820 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3821 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3822 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3823 | ||
3824 | ||
3825 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3826 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3827 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3828 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3829 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3830 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3831 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3832 | ||
3833 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3834 | ||
3835 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3836 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3837 | ||
3838 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3839 | ||
2131d850 RD |
3840 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
3841 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
3842 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d14a1e28 RD |
3843 | |
3844 | ||
3845 | #--------------------------------------------------------------------------- | |
3846 | ||
3847 | class Event(Object): | |
27fb7603 RD |
3848 | """ |
3849 | An event is a structure holding information about an event passed to a | |
3850 | callback or member function. wx.Event is an abstract base class for | |
3851 | other event classes | |
3852 | """ | |
0085ce49 RD |
3853 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3854 | def __init__(self): raise AttributeError, "No constructor defined" | |
3855 | __repr__ = _swig_repr | |
3856 | __swig_destroy__ = _core_.delete_Event | |
3857 | __del__ = lambda self : None; | |
e811c8ce | 3858 | def SetEventType(*args, **kwargs): |
27fb7603 | 3859 | """ |
2131d850 | 3860 | SetEventType(self, EventType typ) |
27fb7603 RD |
3861 | |
3862 | Sets the specific type of the event. | |
3863 | """ | |
54f9ee45 | 3864 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
3865 | |
3866 | def GetEventType(*args, **kwargs): | |
27fb7603 | 3867 | """ |
2131d850 | 3868 | GetEventType(self) -> EventType |
27fb7603 RD |
3869 | |
3870 | Returns the identifier of the given event type, such as | |
3871 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3872 | """ | |
54f9ee45 | 3873 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
3874 | |
3875 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3876 | """ |
3877 | GetEventObject(self) -> Object | |
3878 | ||
3879 | Returns the object (usually a window) associated with the event, if | |
3880 | any. | |
3881 | """ | |
54f9ee45 | 3882 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
3883 | |
3884 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3885 | """ |
3886 | SetEventObject(self, Object obj) | |
3887 | ||
3888 | Sets the originating object, or in other words, obj is normally the | |
3889 | object that is sending the event. | |
3890 | """ | |
54f9ee45 | 3891 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
3892 | |
3893 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 3894 | """GetTimestamp(self) -> long""" |
54f9ee45 | 3895 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
3896 | |
3897 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 3898 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 3899 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
3900 | |
3901 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3902 | """ |
3903 | GetId(self) -> int | |
3904 | ||
3905 | Returns the identifier associated with this event, such as a button | |
3906 | command id. | |
3907 | """ | |
54f9ee45 | 3908 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
3909 | |
3910 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3911 | """ |
3912 | SetId(self, int Id) | |
3913 | ||
3914 | Set's the ID for the event. This is usually the ID of the window that | |
3915 | is sending the event, but it can also be a command id from a menu | |
3916 | item, etc. | |
3917 | """ | |
54f9ee45 | 3918 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
3919 | |
3920 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3921 | """ |
3922 | IsCommandEvent(self) -> bool | |
3923 | ||
3924 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3925 | it returns false. Note: Exists only for optimization purposes. | |
3926 | """ | |
54f9ee45 | 3927 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
3928 | |
3929 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3930 | """ |
3931 | Skip(self, bool skip=True) | |
3932 | ||
3933 | Called by an event handler, it controls whether additional event | |
3934 | handlers bound to this event will be called after the current event | |
3935 | handler returns. Skip(false) (the default setting) will prevent | |
3936 | additional event handlers from being called and control will be | |
3937 | returned to the sender of the event immediately after the current | |
3938 | handler has finished. Skip(True) will cause the event processing | |
3939 | system to continue searching for a handler function for this event. | |
3940 | ||
3941 | """ | |
54f9ee45 | 3942 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
3943 | |
3944 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3945 | """ |
3946 | GetSkipped(self) -> bool | |
3947 | ||
3948 | Returns true if the event handler should be skipped, false otherwise. | |
3949 | :see: `Skip` | |
3950 | """ | |
54f9ee45 | 3951 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
3952 | |
3953 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3954 | """ |
3955 | ShouldPropagate(self) -> bool | |
3956 | ||
3957 | Test if this event should be propagated to the parent window or not, | |
3958 | i.e. if the propagation level is currently greater than 0. | |
3959 | """ | |
54f9ee45 | 3960 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
3961 | |
3962 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3963 | """ |
3964 | StopPropagation(self) -> int | |
3965 | ||
3966 | Stop the event from propagating to its parent window. Returns the old | |
3967 | propagation level value which may be later passed to | |
3968 | `ResumePropagation` to allow propagating the event again. | |
3969 | """ | |
54f9ee45 | 3970 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
3971 | |
3972 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3973 | """ |
3974 | ResumePropagation(self, int propagationLevel) | |
3975 | ||
3976 | Resume the event propagation by restoring the propagation level. (For | |
3977 | example, you can use the value returned by an earlier call to | |
3978 | `StopPropagation`.) | |
3979 | ||
3980 | """ | |
54f9ee45 | 3981 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
3982 | |
3983 | def Clone(*args, **kwargs): | |
a95a7133 | 3984 | """Clone(self) -> Event""" |
54f9ee45 | 3985 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 3986 | |
97ab0f6a RD |
3987 | EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`") |
3988 | EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`") | |
3989 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
3990 | Skipped = property(GetSkipped,doc="See `GetSkipped`") | |
3991 | Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`") | |
2131d850 | 3992 | _core_.Event_swigregister(Event) |
d14a1e28 RD |
3993 | |
3994 | #--------------------------------------------------------------------------- | |
3995 | ||
3996 | class PropagationDisabler(object): | |
27fb7603 RD |
3997 | """ |
3998 | Helper class to temporarily change an event not to propagate. Simply | |
3999 | create an instance of this class and then whe it is destroyed the | |
4000 | propogation of the event will be restored. | |
4001 | """ | |
0085ce49 RD |
4002 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4003 | __repr__ = _swig_repr | |
4004 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4005 | """ |
4006 | __init__(self, Event event) -> PropagationDisabler | |
4007 | ||
4008 | Helper class to temporarily change an event not to propagate. Simply | |
4009 | create an instance of this class and then whe it is destroyed the | |
4010 | propogation of the event will be restored. | |
4011 | """ | |
0085ce49 RD |
4012 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
4013 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
4014 | __del__ = lambda self : None; | |
2131d850 | 4015 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d14a1e28 RD |
4016 | |
4017 | class PropagateOnce(object): | |
27fb7603 RD |
4018 | """ |
4019 | A helper class that will temporarily lower propagation level of an | |
4020 | event. Simply create an instance of this class and then whe it is | |
4021 | destroyed the propogation of the event will be restored. | |
4022 | """ | |
0085ce49 RD |
4023 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4024 | __repr__ = _swig_repr | |
4025 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4026 | """ |
4027 | __init__(self, Event event) -> PropagateOnce | |
4028 | ||
4029 | A helper class that will temporarily lower propagation level of an | |
4030 | event. Simply create an instance of this class and then whe it is | |
4031 | destroyed the propogation of the event will be restored. | |
4032 | """ | |
0085ce49 RD |
4033 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
4034 | __swig_destroy__ = _core_.delete_PropagateOnce | |
4035 | __del__ = lambda self : None; | |
2131d850 | 4036 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d14a1e28 RD |
4037 | |
4038 | #--------------------------------------------------------------------------- | |
4039 | ||
4040 | class CommandEvent(Event): | |
27fb7603 RD |
4041 | """ |
4042 | This event class contains information about command events, which | |
4043 | originate from a variety of simple controls, as well as menus and | |
4044 | toolbars. | |
4045 | """ | |
0085ce49 RD |
4046 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4047 | __repr__ = _swig_repr | |
4048 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4049 | """ |
2131d850 | 4050 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
4051 | |
4052 | This event class contains information about command events, which | |
4053 | originate from a variety of simple controls, as well as menus and | |
4054 | toolbars. | |
4055 | """ | |
0085ce49 | 4056 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
e811c8ce | 4057 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
4058 | """ |
4059 | GetSelection(self) -> int | |
4060 | ||
4061 | Returns item index for a listbox or choice selection event (not valid | |
4062 | for a deselection). | |
4063 | """ | |
54f9ee45 | 4064 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
4065 | |
4066 | def SetString(*args, **kwargs): | |
a95a7133 | 4067 | """SetString(self, String s)""" |
54f9ee45 | 4068 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
4069 | |
4070 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4071 | """ |
4072 | GetString(self) -> String | |
4073 | ||
4074 | Returns item string for a listbox or choice selection event (not valid | |
4075 | for a deselection). | |
4076 | """ | |
54f9ee45 | 4077 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
4078 | |
4079 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4080 | """ |
4081 | IsChecked(self) -> bool | |
4082 | ||
4083 | This method can be used with checkbox and menu events: for the | |
4084 | checkboxes, the method returns true for a selection event and false | |
4085 | for a deselection one. For the menu events, this method indicates if | |
4086 | the menu item just has become checked or unchecked (and thus only | |
4087 | makes sense for checkable menu items). | |
4088 | """ | |
54f9ee45 | 4089 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 4090 | |
242b7b46 | 4091 | Checked = IsChecked |
e811c8ce | 4092 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
4093 | """ |
4094 | IsSelection(self) -> bool | |
4095 | ||
4096 | For a listbox or similar event, returns true if it is a selection, | |
4097 | false if it is a deselection. | |
4098 | """ | |
54f9ee45 | 4099 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
4100 | |
4101 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 4102 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 4103 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
4104 | |
4105 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4106 | """ |
4107 | GetExtraLong(self) -> long | |
4108 | ||
5ba5649b RD |
4109 | Returns extra information dependant on the event objects type. If the |
4110 | event comes from a listbox selection, it is a boolean determining | |
4111 | whether the event was a selection (true) or a deselection (false). A | |
4112 | listbox deselection only occurs for multiple-selection boxes, and in | |
4113 | this case the index and string values are indeterminate and the | |
4114 | listbox must be examined by the application. | |
27fb7603 | 4115 | """ |
54f9ee45 | 4116 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
4117 | |
4118 | def SetInt(*args, **kwargs): | |
a95a7133 | 4119 | """SetInt(self, int i)""" |
54f9ee45 | 4120 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
4121 | |
4122 | def GetInt(*args, **kwargs): | |
27fb7603 | 4123 | """ |
01f6b6d3 | 4124 | GetInt(self) -> int |
27fb7603 | 4125 | |
5ba5649b RD |
4126 | Returns the integer identifier corresponding to a listbox, choice or |
4127 | radiobox selection (only if the event was a selection, not a | |
4128 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4129 | """ |
54f9ee45 | 4130 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce | 4131 | |
0085ce49 RD |
4132 | def GetClientData(*args, **kwargs): |
4133 | """ | |
4134 | GetClientData(self) -> PyObject | |
4135 | ||
4136 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4137 | """ | |
4138 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4139 | ||
4140 | def SetClientData(*args, **kwargs): | |
4141 | """ | |
4142 | SetClientData(self, PyObject clientData) | |
4143 | ||
4144 | Associate the given client data with the item at position n. | |
4145 | """ | |
4146 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4147 | ||
4148 | GetClientObject = GetClientData | |
4149 | SetClientObject = SetClientData | |
4150 | ||
e811c8ce | 4151 | def Clone(*args, **kwargs): |
a95a7133 | 4152 | """Clone(self) -> Event""" |
54f9ee45 | 4153 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4154 | |
2bf58437 RD |
4155 | ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`") |
4156 | ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`") | |
4157 | ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`") | |
4158 | Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`") | |
4159 | Selection = property(GetSelection,doc="See `GetSelection`") | |
4160 | String = property(GetString,SetString,doc="See `GetString` and `SetString`") | |
2131d850 | 4161 | _core_.CommandEvent_swigregister(CommandEvent) |
d14a1e28 RD |
4162 | |
4163 | #--------------------------------------------------------------------------- | |
4164 | ||
4165 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4166 | """ |
4167 | An instance of this class (or one of its derived classes) is sent from | |
4168 | a control when the control's state is being changed and the control | |
4169 | allows that change to be prevented from happening. The event handler | |
4170 | can call `Veto` or `Allow` to tell the control what to do. | |
4171 | """ | |
0085ce49 RD |
4172 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4173 | __repr__ = _swig_repr | |
4174 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4175 | """ |
2131d850 | 4176 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4177 | |
4178 | An instance of this class (or one of its derived classes) is sent from | |
4179 | a control when the control's state is being changed and the control | |
4180 | allows that change to be prevented from happening. The event handler | |
4181 | can call `Veto` or `Allow` to tell the control what to do. | |
4182 | """ | |
0085ce49 | 4183 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
e811c8ce | 4184 | def Veto(*args, **kwargs): |
27fb7603 RD |
4185 | """ |
4186 | Veto(self) | |
4187 | ||
4188 | Prevents the change announced by this event from happening. | |
4189 | ||
4190 | It is in general a good idea to notify the user about the reasons for | |
4191 | vetoing the change because otherwise the applications behaviour (which | |
4192 | just refuses to do what the user wants) might be quite surprising. | |
4193 | """ | |
54f9ee45 | 4194 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4195 | |
4196 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4197 | """ |
4198 | Allow(self) | |
4199 | ||
4200 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4201 | processed. For most events it is not necessary to call this method as | |
4202 | the events are allowed anyhow but some are forbidden by default (this | |
4203 | will be mentioned in the corresponding event description). | |
4204 | """ | |
54f9ee45 | 4205 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4206 | |
4207 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4208 | """ |
4209 | IsAllowed(self) -> bool | |
4210 | ||
4211 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4212 | false otherwise (if it was). | |
4213 | """ | |
54f9ee45 | 4214 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4215 | |
2131d850 | 4216 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d14a1e28 RD |
4217 | |
4218 | #--------------------------------------------------------------------------- | |
4219 | ||
4220 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4221 | """ |
4222 | A scroll event holds information about events sent from stand-alone | |
4223 | scrollbars and sliders. Note that scrolled windows do not send | |
4224 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4225 | instead. | |
4226 | """ | |
0085ce49 RD |
4227 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4228 | __repr__ = _swig_repr | |
4229 | def __init__(self, *args, **kwargs): | |
0df68c9f | 4230 | """ |
2131d850 | 4231 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4232 | int orient=0) -> ScrollEvent |
4233 | """ | |
0085ce49 | 4234 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
e811c8ce | 4235 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4236 | """ |
4237 | GetOrientation(self) -> int | |
4238 | ||
4239 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4240 | the scrollbar. | |
4241 | """ | |
54f9ee45 | 4242 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4243 | |
4244 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4245 | """ |
4246 | GetPosition(self) -> int | |
4247 | ||
4248 | Returns the position of the scrollbar. | |
4249 | """ | |
54f9ee45 | 4250 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4251 | |
4252 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4253 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4254 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4255 | |
4256 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4257 | """SetPosition(self, int pos)""" |
54f9ee45 | 4258 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4259 | |
33d6fd3b RD |
4260 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4261 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4262 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d14a1e28 RD |
4263 | |
4264 | #--------------------------------------------------------------------------- | |
4265 | ||
4266 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4267 | """ |
4268 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4269 | scrolling windows. | |
4270 | """ | |
0085ce49 RD |
4271 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4272 | __repr__ = _swig_repr | |
4273 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4274 | """ |
2131d850 | 4275 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4276 | |
4277 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4278 | scrolling windows. | |
4279 | """ | |
0085ce49 | 4280 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
e811c8ce | 4281 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4282 | """ |
4283 | GetOrientation(self) -> int | |
4284 | ||
4285 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4286 | the scrollbar. | |
4287 | """ | |
54f9ee45 | 4288 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4289 | |
4290 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4291 | """ |
4292 | GetPosition(self) -> int | |
4293 | ||
4294 | Returns the position of the scrollbar for the thumb track and release | |
4295 | events. Note that this field can't be used for the other events, you | |
4296 | need to query the window itself for the current position in that case. | |
4297 | """ | |
54f9ee45 | 4298 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4299 | |
4300 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4301 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4302 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4303 | |
4304 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4305 | """SetPosition(self, int pos)""" |
54f9ee45 | 4306 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4307 | |
33d6fd3b RD |
4308 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4309 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4310 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d14a1e28 RD |
4311 | |
4312 | #--------------------------------------------------------------------------- | |
4313 | ||
54f9ee45 RD |
4314 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4315 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4316 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4317 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4318 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4319 | class MouseEvent(Event): |
27fb7603 RD |
4320 | """ |
4321 | This event class contains information about the events generated by | |
4322 | the mouse: they include mouse buttons press and release events and | |
4323 | mouse move events. | |
4324 | ||
4325 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4326 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4327 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4328 | a middle button so a portable application should avoid relying on the | |
4329 | events from it. | |
4330 | ||
4331 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4332 | the former returns true when the event corresponds to the left mouse | |
4333 | button click while the latter returns true if the left mouse button is | |
4334 | currently being pressed. For example, when the user is dragging the | |
4335 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4336 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4337 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4338 | underlying GUI behaviour is (which is platform-dependent). The same | |
4339 | applies, of course, to other mouse buttons as well. | |
4340 | """ | |
0085ce49 RD |
4341 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4342 | __repr__ = _swig_repr | |
4343 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4344 | """ |
2131d850 | 4345 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4346 | |
4347 | Constructs a wx.MouseEvent. Valid event types are: | |
4348 | ||
4349 | * wxEVT_ENTER_WINDOW | |
4350 | * wxEVT_LEAVE_WINDOW | |
4351 | * wxEVT_LEFT_DOWN | |
4352 | * wxEVT_LEFT_UP | |
4353 | * wxEVT_LEFT_DCLICK | |
4354 | * wxEVT_MIDDLE_DOWN | |
4355 | * wxEVT_MIDDLE_UP | |
4356 | * wxEVT_MIDDLE_DCLICK | |
4357 | * wxEVT_RIGHT_DOWN | |
4358 | * wxEVT_RIGHT_UP | |
4359 | * wxEVT_RIGHT_DCLICK | |
4360 | * wxEVT_MOTION | |
4361 | * wxEVT_MOUSEWHEEL | |
4362 | """ | |
0085ce49 | 4363 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
e811c8ce | 4364 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4365 | """ |
4366 | IsButton(self) -> bool | |
4367 | ||
4368 | Returns true if the event was a mouse button event (not necessarily a | |
4369 | button down event - that may be tested using `ButtonDown`). | |
4370 | """ | |
54f9ee45 | 4371 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4372 | |
4373 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4374 | """ |
4375 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4376 | ||
5ba5649b RD |
4377 | If the argument is omitted, this returns true if the event was any |
4378 | mouse button down event. Otherwise the argument specifies which | |
4379 | button-down event shold be checked for (see `Button` for the possible | |
4380 | values). | |
27fb7603 | 4381 | """ |
54f9ee45 | 4382 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4383 | |
4384 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4385 | """ |
4386 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4387 | ||
4388 | If the argument is omitted, this returns true if the event was any | |
4389 | mouse double click event. Otherwise the argument specifies which | |
4390 | double click event to check for (see `Button` for the possible | |
4391 | values). | |
4392 | """ | |
54f9ee45 | 4393 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4394 | |
4395 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4396 | """ |
4397 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4398 | ||
4399 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4400 | mouse button up event. Otherwise the argument specifies which button |
4401 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4402 | """ |
54f9ee45 | 4403 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4404 | |
4405 | def Button(*args, **kwargs): | |
27fb7603 RD |
4406 | """ |
4407 | Button(self, int button) -> bool | |
4408 | ||
4409 | Returns true if the identified mouse button is changing state. Valid | |
4410 | values of button are: | |
4411 | ||
4412 | ==================== ===================================== | |
4413 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4414 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4415 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4416 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4417 | ==================== ===================================== | |
4418 | ||
4419 | """ | |
54f9ee45 | 4420 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4421 | |
4422 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4423 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4424 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4425 | |
4426 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4427 | """ |
4428 | GetButton(self) -> int | |
4429 | ||
4430 | Returns the mouse button which generated this event or | |
4431 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4432 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4433 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4434 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4435 | right buttons respectively. | |
4436 | """ | |
54f9ee45 | 4437 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4438 | |
4439 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4440 | """ |
4441 | ControlDown(self) -> bool | |
4442 | ||
4443 | Returns true if the control key was down at the time of the event. | |
4444 | """ | |
54f9ee45 | 4445 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4446 | |
4447 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4448 | """ |
4449 | MetaDown(self) -> bool | |
4450 | ||
4451 | Returns true if the Meta key was down at the time of the event. | |
4452 | """ | |
54f9ee45 | 4453 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4454 | |
4455 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4456 | """ |
4457 | AltDown(self) -> bool | |
4458 | ||
4459 | Returns true if the Alt key was down at the time of the event. | |
4460 | """ | |
54f9ee45 | 4461 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4462 | |
4463 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4464 | """ |
4465 | ShiftDown(self) -> bool | |
4466 | ||
4467 | Returns true if the Shift key was down at the time of the event. | |
4468 | """ | |
54f9ee45 | 4469 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4470 | |
412d302d RD |
4471 | def CmdDown(*args, **kwargs): |
4472 | """ | |
4473 | CmdDown(self) -> bool | |
4474 | ||
4475 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4476 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4477 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4478 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4479 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4480 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4481 | and Macs this is the same as `MetaDown`. | |
4482 | """ | |
4483 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4484 | ||
e811c8ce | 4485 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4486 | """ |
4487 | LeftDown(self) -> bool | |
4488 | ||
4489 | Returns true if the left mouse button state changed to down. | |
4490 | """ | |
54f9ee45 | 4491 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4492 | |
4493 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4494 | """ |
4495 | MiddleDown(self) -> bool | |
4496 | ||
4497 | Returns true if the middle mouse button state changed to down. | |
4498 | """ | |
54f9ee45 | 4499 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4500 | |
4501 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4502 | """ |
4503 | RightDown(self) -> bool | |
4504 | ||
4505 | Returns true if the right mouse button state changed to down. | |
4506 | """ | |
54f9ee45 | 4507 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4508 | |
4509 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4510 | """ |
4511 | LeftUp(self) -> bool | |
4512 | ||
4513 | Returns true if the left mouse button state changed to up. | |
4514 | """ | |
54f9ee45 | 4515 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4516 | |
4517 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4518 | """ |
4519 | MiddleUp(self) -> bool | |
4520 | ||
4521 | Returns true if the middle mouse button state changed to up. | |
4522 | """ | |
54f9ee45 | 4523 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4524 | |
4525 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4526 | """ |
4527 | RightUp(self) -> bool | |
4528 | ||
4529 | Returns true if the right mouse button state changed to up. | |
4530 | """ | |
54f9ee45 | 4531 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4532 | |
4533 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4534 | """ |
4535 | LeftDClick(self) -> bool | |
4536 | ||
4537 | Returns true if the event was a left button double click. | |
4538 | """ | |
54f9ee45 | 4539 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4540 | |
4541 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4542 | """ |
4543 | MiddleDClick(self) -> bool | |
4544 | ||
4545 | Returns true if the event was a middle button double click. | |
4546 | """ | |
54f9ee45 | 4547 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4548 | |
4549 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4550 | """ |
4551 | RightDClick(self) -> bool | |
4552 | ||
4553 | Returns true if the event was a right button double click. | |
4554 | """ | |
54f9ee45 | 4555 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4556 | |
4557 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4558 | """ |
4559 | LeftIsDown(self) -> bool | |
4560 | ||
4561 | Returns true if the left mouse button is currently down, independent | |
4562 | of the current event type. | |
4563 | ||
4564 | Please notice that it is not the same as LeftDown which returns true | |
4565 | if the left mouse button was just pressed. Rather, it describes the | |
4566 | state of the mouse button before the event happened. | |
4567 | ||
4568 | This event is usually used in the mouse event handlers which process | |
4569 | "move mouse" messages to determine whether the user is (still) | |
4570 | dragging the mouse. | |
4571 | """ | |
54f9ee45 | 4572 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4573 | |
4574 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4575 | """ |
4576 | MiddleIsDown(self) -> bool | |
4577 | ||
4578 | Returns true if the middle mouse button is currently down, independent | |
4579 | of the current event type. | |
4580 | """ | |
54f9ee45 | 4581 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
4582 | |
4583 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4584 | """ |
4585 | RightIsDown(self) -> bool | |
4586 | ||
4587 | Returns true if the right mouse button is currently down, independent | |
4588 | of the current event type. | |
4589 | """ | |
54f9ee45 | 4590 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
4591 | |
4592 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4593 | """ |
4594 | Dragging(self) -> bool | |
4595 | ||
4596 | Returns true if this was a dragging event (motion while a button is | |
4597 | depressed). | |
4598 | """ | |
54f9ee45 | 4599 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
4600 | |
4601 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4602 | """ |
4603 | Moving(self) -> bool | |
4604 | ||
4605 | Returns true if this was a motion event and no mouse buttons were | |
4606 | pressed. If any mouse button is held pressed, then this method returns | |
4607 | false and Dragging returns true. | |
4608 | """ | |
54f9ee45 | 4609 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
4610 | |
4611 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4612 | """ |
4613 | Entering(self) -> bool | |
4614 | ||
4615 | Returns true if the mouse was entering the window. | |
4616 | """ | |
54f9ee45 | 4617 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
4618 | |
4619 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4620 | """ |
4621 | Leaving(self) -> bool | |
4622 | ||
4623 | Returns true if the mouse was leaving the window. | |
4624 | """ | |
54f9ee45 | 4625 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
4626 | |
4627 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4628 | """ |
a95a7133 | 4629 | GetPosition(self) -> Point |
e811c8ce | 4630 | |
27fb7603 RD |
4631 | Returns the pixel position of the mouse in window coordinates when the |
4632 | event happened. | |
0df68c9f | 4633 | """ |
54f9ee45 | 4634 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4635 | |
4636 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4637 | """ |
4638 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4639 | |
27fb7603 RD |
4640 | Returns the pixel position of the mouse in window coordinates when the |
4641 | event happened. | |
0df68c9f | 4642 | """ |
54f9ee45 | 4643 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4644 | |
4645 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4646 | """ |
4647 | GetLogicalPosition(self, DC dc) -> Point | |
4648 | ||
4649 | Returns the logical mouse position in pixels (i.e. translated | |
4650 | according to the translation set for the DC, which usually indicates | |
4651 | that the window has been scrolled). | |
4652 | """ | |
54f9ee45 | 4653 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
4654 | |
4655 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4656 | """ |
4657 | GetX(self) -> int | |
4658 | ||
4659 | Returns X coordinate of the physical mouse event position. | |
4660 | """ | |
54f9ee45 | 4661 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4662 | |
4663 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4664 | """ |
4665 | GetY(self) -> int | |
4666 | ||
4667 | Returns Y coordinate of the physical mouse event position. | |
4668 | """ | |
54f9ee45 | 4669 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4670 | |
4671 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4672 | """ |
4673 | GetWheelRotation(self) -> int | |
4674 | ||
4675 | Get wheel rotation, positive or negative indicates direction of | |
4676 | rotation. Current devices all send an event when rotation is equal to | |
4677 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4678 | created in the future. Because of this you shouldn't assume that one | |
4679 | event is equal to 1 line or whatever, but you should be able to either | |
4680 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4681 | have been accumulated before scrolling. | |
4682 | """ | |
54f9ee45 | 4683 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
4684 | |
4685 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4686 | """ |
4687 | GetWheelDelta(self) -> int | |
4688 | ||
4689 | Get wheel delta, normally 120. This is the threshold for action to be | |
4690 | taken, and one such action (for example, scrolling one increment) | |
4691 | should occur for each delta. | |
4692 | """ | |
54f9ee45 | 4693 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce RD |
4694 | |
4695 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4696 | """ |
4697 | GetLinesPerAction(self) -> int | |
4698 | ||
4699 | Returns the configured number of lines (or whatever) to be scrolled | |
4700 | per wheel action. Defaults to three. | |
4701 | """ | |
54f9ee45 | 4702 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
4703 | |
4704 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4705 | """ |
4706 | IsPageScroll(self) -> bool | |
4707 | ||
4708 | Returns true if the system has been setup to do page scrolling with | |
4709 | the mouse wheel instead of line scrolling. | |
4710 | """ | |
54f9ee45 RD |
4711 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4712 | ||
4713 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4714 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4715 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4716 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4717 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4718 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4719 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4720 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4721 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4722 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4723 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4724 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
57332a5a RD |
4725 | Button = property(GetButton,doc="See `GetButton`") |
4726 | LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`") | |
4727 | LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`") | |
4728 | Position = property(GetPosition,doc="See `GetPosition`") | |
4729 | WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`") | |
4730 | WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`") | |
4731 | X = property(GetX,doc="See `GetX`") | |
4732 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 4733 | _core_.MouseEvent_swigregister(MouseEvent) |
d14a1e28 RD |
4734 | |
4735 | #--------------------------------------------------------------------------- | |
4736 | ||
4737 | class SetCursorEvent(Event): | |
5ba5649b RD |
4738 | """ |
4739 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4740 | as a result of mouse motion. This event gives the application the | |
4741 | chance to perform specific mouse cursor processing based on the | |
4742 | current position of the mouse within the window. Use the `SetCursor` | |
4743 | method to specify the cursor you want to be displayed. | |
4744 | """ | |
0085ce49 RD |
4745 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4746 | __repr__ = _swig_repr | |
4747 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4748 | """ |
4749 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4750 | ||
4751 | Construct a new `wx.SetCursorEvent`. | |
4752 | """ | |
0085ce49 | 4753 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
e811c8ce | 4754 | def GetX(*args, **kwargs): |
5ba5649b RD |
4755 | """ |
4756 | GetX(self) -> int | |
4757 | ||
4758 | Returns the X coordinate of the mouse in client coordinates. | |
4759 | """ | |
54f9ee45 | 4760 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4761 | |
4762 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4763 | """ |
4764 | GetY(self) -> int | |
4765 | ||
4766 | Returns the Y coordinate of the mouse in client coordinates. | |
4767 | """ | |
54f9ee45 | 4768 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4769 | |
4770 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4771 | """ |
4772 | SetCursor(self, Cursor cursor) | |
4773 | ||
4774 | Sets the cursor associated with this event. | |
4775 | """ | |
54f9ee45 | 4776 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
4777 | |
4778 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4779 | """ |
4780 | GetCursor(self) -> Cursor | |
4781 | ||
4782 | Returns a reference to the cursor specified by this event. | |
4783 | """ | |
54f9ee45 | 4784 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
4785 | |
4786 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4787 | """ |
4788 | HasCursor(self) -> bool | |
4789 | ||
4790 | Returns true if the cursor specified by this event is a valid cursor. | |
4791 | """ | |
54f9ee45 | 4792 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 4793 | |
33d6fd3b RD |
4794 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") |
4795 | X = property(GetX,doc="See `GetX`") | |
4796 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 4797 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d14a1e28 RD |
4798 | |
4799 | #--------------------------------------------------------------------------- | |
4800 | ||
4801 | class KeyEvent(Event): | |
5ba5649b RD |
4802 | """ |
4803 | This event class contains information about keypress and character | |
4804 | events. These events are only sent to the widget that currently has | |
4805 | the keyboard focus. | |
4806 | ||
4807 | Notice that there are three different kinds of keyboard events in | |
4808 | wxWidgets: key down and up events and char events. The difference | |
4809 | between the first two is clear - the first corresponds to a key press | |
4810 | and the second to a key release - otherwise they are identical. Just | |
4811 | note that if the key is maintained in a pressed state you will | |
4812 | typically get a lot of (automatically generated) down events but only | |
4813 | one up so it is wrong to assume that there is one up event | |
4814 | corresponding to each down one. | |
4815 | ||
4816 | Both key events provide untranslated key codes while the char event | |
4817 | carries the translated one. The untranslated code for alphanumeric | |
4818 | keys is always an upper case value. For the other keys it is one of | |
4819 | WXK_XXX values from the keycodes table. The translated key is, in | |
4820 | general, the character the user expects to appear as the result of the | |
4821 | key combination when typing the text into a text entry zone, for | |
4822 | example. | |
4823 | ||
4824 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4825 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4826 | down event key code is equal to ASCII A == 65. But the char event key | |
4827 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4828 | 'A' keys simultaneously , the key code in key down event will still be | |
4829 | just 'A' while the char event key code parameter will now be 'A' as | |
4830 | well. | |
4831 | ||
4832 | Although in this simple case it is clear that the correct key code | |
4833 | could be found in the key down event handler by checking the value | |
4834 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4835 | as for non alphanumeric keys or non-US keyboard layouts the | |
4836 | translation is keyboard-layout dependent and can only be done properly | |
4837 | by the system itself. | |
4838 | ||
4839 | Another kind of translation is done when the control key is pressed: | |
4840 | for example, for CTRL-A key press the key down event still carries the | |
4841 | same key code 'A' as usual but the char event will have key code of 1, | |
4842 | the ASCII value of this key combination. | |
4843 | ||
4844 | You may discover how the other keys on your system behave | |
4845 | interactively by running the KeyEvents sample in the wxPython demo and | |
4846 | pressing some keys while the blue box at the top has the keyboard | |
4847 | focus. | |
4848 | ||
4849 | **Note**: If a key down event is caught and the event handler does not | |
4850 | call event.Skip() then the coresponding char event will not | |
4851 | happen. This is by design and enables the programs that handle both | |
4852 | types of events to be a bit simpler. | |
4853 | ||
4854 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4855 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4856 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4857 | event in wxWidgets (unless it is used as an accelerator). | |
4858 | ||
4859 | **Tip**: be sure to call event.Skip() for events that you don't | |
4860 | process in key event function, otherwise menu shortcuts may cease to | |
4861 | work under Windows. | |
4862 | ||
4863 | """ | |
0085ce49 RD |
4864 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4865 | __repr__ = _swig_repr | |
4866 | def __init__(self, *args, **kwargs): | |
5ba5649b | 4867 | """ |
2131d850 | 4868 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
4869 | |
4870 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4871 | * | |
4872 | """ | |
0085ce49 | 4873 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
4874 | def GetModifiers(*args, **kwargs): |
4875 | """ | |
4876 | GetModifiers(self) -> int | |
4877 | ||
4878 | Returns a bitmask of the current modifier settings. Can be used to | |
4879 | check if the key event has exactly the given modifiers without having | |
4880 | to explicitly check that the other modifiers are not down. For | |
4881 | example:: | |
4882 | ||
4883 | if event.GetModifers() == wx.MOD_CONTROL: | |
4884 | DoSomething() | |
4885 | ||
4886 | """ | |
4887 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
4888 | ||
e811c8ce | 4889 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4890 | """ |
4891 | ControlDown(self) -> bool | |
4892 | ||
4893 | Returns ``True`` if the Control key was down at the time of the event. | |
4894 | """ | |
54f9ee45 | 4895 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4896 | |
4897 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4898 | """ |
4899 | MetaDown(self) -> bool | |
4900 | ||
4901 | Returns ``True`` if the Meta key was down at the time of the event. | |
4902 | """ | |
54f9ee45 | 4903 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4904 | |
4905 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4906 | """ |
4907 | AltDown(self) -> bool | |
4908 | ||
4909 | Returns ``True`` if the Alt key was down at the time of the event. | |
4910 | """ | |
54f9ee45 | 4911 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4912 | |
4913 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4914 | """ |
4915 | ShiftDown(self) -> bool | |
4916 | ||
4917 | Returns ``True`` if the Shift key was down at the time of the event. | |
4918 | """ | |
54f9ee45 | 4919 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4920 | |
412d302d RD |
4921 | def CmdDown(*args, **kwargs): |
4922 | """ | |
4923 | CmdDown(self) -> bool | |
4924 | ||
4925 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4926 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4927 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4928 | because Cmd key is used for the same thing under Mac as Ctrl |
4929 | elsewhere. The Ctrl still exists, it's just not used for this | |
4930 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4931 | and Macs this is the same as `MetaDown`. | |
4932 | """ | |
4933 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
4934 | ||
e811c8ce | 4935 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4936 | """ |
4937 | HasModifiers(self) -> bool | |
4938 | ||
4939 | Returns true if either CTRL or ALT keys was down at the time of the | |
4940 | key event. Note that this function does not take into account neither | |
4941 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4942 | it is common for NUMLOCK key to be configured as META under X but the | |
4943 | key presses even while NUMLOCK is on should be still processed | |
4944 | normally). | |
4945 | """ | |
54f9ee45 | 4946 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
4947 | |
4948 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4949 | """ |
4950 | GetKeyCode(self) -> int | |
4951 | ||
4952 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4953 | while non-ASCII events return values such as WXK_LEFT for the left | |
4954 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4955 | codes. | |
4956 | ||
4957 | Note that in Unicode build, the returned value is meaningful only if | |
4958 | the user entered a character that can be represented in current | |
4959 | locale's default charset. You can obtain the corresponding Unicode | |
4960 | character using `GetUnicodeKey`. | |
4961 | """ | |
54f9ee45 | 4962 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 4963 | |
19272049 | 4964 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4965 | """ |
4966 | GetUnicodeKey(self) -> int | |
4967 | ||
4968 | Returns the Unicode character corresponding to this key event. This | |
4969 | function is only meaningfule in a Unicode build of wxPython. | |
4970 | """ | |
19272049 | 4971 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 4972 | |
19272049 | 4973 | GetUniChar = GetUnicodeKey |
b850e7f3 RD |
4974 | def SetUnicodeKey(*args, **kwargs): |
4975 | """ | |
4976 | SetUnicodeKey(self, int uniChar) | |
4977 | ||
4978 | Set the Unicode value of the key event, but only if this is a Unicode | |
4979 | build of wxPython. | |
4980 | """ | |
4981 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
4982 | ||
e811c8ce | 4983 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4984 | """ |
4985 | GetRawKeyCode(self) -> unsigned int | |
4986 | ||
4987 | Returns the raw key code for this event. This is a platform-dependent | |
4988 | scan code which should only be used in advanced | |
4989 | applications. Currently the raw key codes are not supported by all | |
4990 | ports. | |
4991 | """ | |
54f9ee45 | 4992 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
4993 | |
4994 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
4995 | """ |
4996 | GetRawKeyFlags(self) -> unsigned int | |
4997 | ||
4998 | Returns the low level key flags for this event. The flags are | |
4999 | platform-dependent and should only be used in advanced applications. | |
5000 | Currently the raw key flags are not supported by all ports. | |
5001 | """ | |
54f9ee45 | 5002 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
5003 | |
5004 | def GetPosition(*args, **kwargs): | |
0df68c9f | 5005 | """ |
a95a7133 | 5006 | GetPosition(self) -> Point |
e811c8ce | 5007 | |
5ba5649b | 5008 | Find the position of the event, if applicable. |
0df68c9f | 5009 | """ |
54f9ee45 | 5010 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5011 | |
5012 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
5013 | """ |
5014 | GetPositionTuple() -> (x,y) | |
e811c8ce | 5015 | |
5ba5649b | 5016 | Find the position of the event, if applicable. |
0df68c9f | 5017 | """ |
54f9ee45 | 5018 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
5019 | |
5020 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5021 | """ |
5022 | GetX(self) -> int | |
5023 | ||
5024 | Returns the X position (in client coordinates) of the event, if | |
5025 | applicable. | |
5026 | """ | |
54f9ee45 | 5027 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5028 | |
5029 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5030 | """ |
5031 | GetY(self) -> int | |
5032 | ||
5033 | Returns the Y position (in client coordinates) of the event, if | |
5034 | applicable. | |
5035 | """ | |
54f9ee45 RD |
5036 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5037 | ||
5038 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5039 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5040 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5041 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5042 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5043 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5044 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5045 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5046 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5047 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
97ab0f6a RD |
5048 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") |
5049 | Modifiers = property(GetModifiers,doc="See `GetModifiers`") | |
5050 | Position = property(GetPosition,doc="See `GetPosition`") | |
5051 | RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`") | |
5052 | RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`") | |
5053 | UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`") | |
5054 | X = property(GetX,doc="See `GetX`") | |
5055 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 5056 | _core_.KeyEvent_swigregister(KeyEvent) |
d14a1e28 RD |
5057 | |
5058 | #--------------------------------------------------------------------------- | |
5059 | ||
5060 | class SizeEvent(Event): | |
5ba5649b RD |
5061 | """ |
5062 | A size event holds information about size change events. The EVT_SIZE | |
5063 | handler function will be called when the window it is bound to has | |
5064 | been resized. | |
5065 | ||
5066 | Note that the size passed is of the whole window: call | |
5067 | `wx.Window.GetClientSize` for the area which may be used by the | |
5068 | application. | |
5069 | ||
5070 | When a window is resized, usually only a small part of the window is | |
5071 | damaged and and that area is all that is in the update region for the | |
5072 | next paint event. However, if your drawing depends on the size of the | |
5073 | window, you may need to clear the DC explicitly and repaint the whole | |
5074 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5075 | invalidate the entire window. | |
5076 | ||
5077 | """ | |
0085ce49 RD |
5078 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5079 | __repr__ = _swig_repr | |
5080 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5081 | """ |
5082 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5083 | ||
5084 | Construct a new ``wx.SizeEvent``. | |
5085 | """ | |
0085ce49 | 5086 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
e811c8ce | 5087 | def GetSize(*args, **kwargs): |
5ba5649b RD |
5088 | """ |
5089 | GetSize(self) -> Size | |
5090 | ||
5091 | Returns the entire size of the window generating the size change | |
5092 | event. | |
5093 | """ | |
54f9ee45 | 5094 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
5095 | |
5096 | def GetRect(*args, **kwargs): | |
a95a7133 | 5097 | """GetRect(self) -> Rect""" |
54f9ee45 | 5098 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5099 | |
5100 | def SetRect(*args, **kwargs): | |
a95a7133 | 5101 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5102 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5103 | |
5104 | def SetSize(*args, **kwargs): | |
a95a7133 | 5105 | """SetSize(self, Size size)""" |
54f9ee45 | 5106 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 5107 | |
54f9ee45 RD |
5108 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5109 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
33d6fd3b RD |
5110 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") |
5111 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
2131d850 | 5112 | _core_.SizeEvent_swigregister(SizeEvent) |
d14a1e28 RD |
5113 | |
5114 | #--------------------------------------------------------------------------- | |
5115 | ||
5116 | class MoveEvent(Event): | |
5ba5649b RD |
5117 | """ |
5118 | This event object is sent for EVT_MOVE event bindings when a window is | |
5119 | moved to a new position. | |
5120 | """ | |
0085ce49 RD |
5121 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5122 | __repr__ = _swig_repr | |
5123 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5124 | """ |
5125 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5126 | ||
5127 | Constructor. | |
5128 | """ | |
0085ce49 | 5129 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
e811c8ce | 5130 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5131 | """ |
5132 | GetPosition(self) -> Point | |
5133 | ||
5134 | Returns the position of the window generating the move change event. | |
5135 | """ | |
54f9ee45 | 5136 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5137 | |
5138 | def GetRect(*args, **kwargs): | |
a95a7133 | 5139 | """GetRect(self) -> Rect""" |
54f9ee45 | 5140 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5141 | |
5142 | def SetRect(*args, **kwargs): | |
a95a7133 | 5143 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5144 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5145 | |
5146 | def SetPosition(*args, **kwargs): | |
a95a7133 | 5147 | """SetPosition(self, Point pos)""" |
54f9ee45 | 5148 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 5149 | |
7557b9b5 RD |
5150 | m_pos = property(GetPosition, SetPosition) |
5151 | m_rect = property(GetRect, SetRect) | |
5152 | ||
57332a5a RD |
5153 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
5154 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
2131d850 | 5155 | _core_.MoveEvent_swigregister(MoveEvent) |
d14a1e28 RD |
5156 | |
5157 | #--------------------------------------------------------------------------- | |
5158 | ||
5159 | class PaintEvent(Event): | |
5ba5649b RD |
5160 | """ |
5161 | A paint event is sent when a window's contents needs to be repainted. | |
5162 | Note that in an EVT_PAINT handler the application must *always* create | |
5163 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5164 | Windows assumes that the window has not been painted yet and will send | |
5165 | the event again, causing endless refreshes. | |
5166 | ||
5167 | You can optimize painting by retrieving the rectangles that have been | |
5168 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5169 | and only repainting these rectangles. The rectangles are in terms of | |
5170 | the client area, and are unscrolled, so you will need to do some | |
5171 | calculations using the current view position to obtain logical, | |
5172 | scrolled units. | |
5173 | ||
5174 | """ | |
0085ce49 RD |
5175 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5176 | __repr__ = _swig_repr | |
5177 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5178 | """__init__(self, int Id=0) -> PaintEvent""" |
0085ce49 | 5179 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5180 | _core_.PaintEvent_swigregister(PaintEvent) |
d14a1e28 RD |
5181 | |
5182 | class NcPaintEvent(Event): | |
093d3ff1 | 5183 | """Proxy of C++ NcPaintEvent class""" |
0085ce49 RD |
5184 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5185 | __repr__ = _swig_repr | |
5186 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5187 | """__init__(self, int winid=0) -> NcPaintEvent""" |
0085ce49 | 5188 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5189 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d14a1e28 RD |
5190 | |
5191 | #--------------------------------------------------------------------------- | |
5192 | ||
5193 | class EraseEvent(Event): | |
5ba5649b RD |
5194 | """ |
5195 | An erase event is sent whenever the background of a window needs to be | |
5196 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5197 | binder. On some platforms, such as GTK+, this event is simulated | |
5198 | (simply generated just before the paint event) and may cause flicker. | |
5199 | ||
5200 | To paint a custom background use the `GetDC` method and use the returned | |
5201 | device context if it is not ``None``, otherwise create a temporary | |
5202 | `wx.ClientDC` and draw on that. | |
5203 | ||
5204 | """ | |
0085ce49 RD |
5205 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5206 | __repr__ = _swig_repr | |
5207 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5208 | """ |
5209 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5210 | ||
5211 | Constructor | |
5212 | """ | |
0085ce49 | 5213 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
e811c8ce | 5214 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5215 | """ |
5216 | GetDC(self) -> DC | |
5217 | ||
5218 | Returns the device context the event handler should draw upon. If | |
5219 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5220 | that instead. | |
5221 | """ | |
54f9ee45 | 5222 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5223 | |
97ab0f6a | 5224 | DC = property(GetDC,doc="See `GetDC`") |
2131d850 | 5225 | _core_.EraseEvent_swigregister(EraseEvent) |
d14a1e28 RD |
5226 | |
5227 | #--------------------------------------------------------------------------- | |
5228 | ||
5229 | class FocusEvent(Event): | |
5ba5649b RD |
5230 | """ |
5231 | A focus event is sent when a window's focus changes. The window losing | |
5232 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5233 | gets an EVT_SET_FOCUS event. | |
5234 | ||
5235 | Notice that the set focus event happens both when the user gives focus | |
5236 | to the window (whether using the mouse or keyboard) and when it is | |
5237 | done from the program itself using `wx.Window.SetFocus`. | |
5238 | ||
5239 | """ | |
0085ce49 RD |
5240 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5241 | __repr__ = _swig_repr | |
5242 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5243 | """ |
2131d850 | 5244 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5245 | |
5246 | Constructor | |
5247 | """ | |
0085ce49 | 5248 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
e811c8ce | 5249 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5250 | """ |
5251 | GetWindow(self) -> Window | |
5252 | ||
5253 | Returns the other window associated with this event, that is the | |
5254 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5255 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5256 | ||
5257 | Warning: the window returned may be None! | |
5258 | """ | |
54f9ee45 | 5259 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5260 | |
5261 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5262 | """SetWindow(self, Window win)""" |
54f9ee45 | 5263 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5264 | |
97ab0f6a | 5265 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") |
2131d850 | 5266 | _core_.FocusEvent_swigregister(FocusEvent) |
d14a1e28 RD |
5267 | |
5268 | #--------------------------------------------------------------------------- | |
5269 | ||
5270 | class ChildFocusEvent(CommandEvent): | |
5ba5649b | 5271 | """ |
33d6fd3b RD |
5272 | A child focus event is sent to a (parent-)window when one of its child |
5273 | windows gains focus, so that the window could restore the focus back | |
5274 | to its corresponding child if it loses it now and regains later. | |
5275 | ||
5276 | Notice that child window is the direct child of the window receiving | |
5277 | the event, and so may not be the actual widget recieving focus if it | |
5278 | is further down the containment heirarchy. Use `wx.Window.FindFocus` | |
5279 | to get the widget that is actually receiving focus. | |
5ba5649b | 5280 | """ |
0085ce49 RD |
5281 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5282 | __repr__ = _swig_repr | |
5283 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5284 | """ |
5285 | __init__(self, Window win=None) -> ChildFocusEvent | |
5286 | ||
5287 | Constructor | |
5288 | """ | |
0085ce49 | 5289 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
e811c8ce | 5290 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5291 | """ |
5292 | GetWindow(self) -> Window | |
5293 | ||
33d6fd3b RD |
5294 | The window, or (grand)parent of the window which has just received the |
5295 | focus. | |
5ba5649b | 5296 | """ |
54f9ee45 | 5297 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5298 | |
2bf58437 | 5299 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 5300 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d14a1e28 RD |
5301 | |
5302 | #--------------------------------------------------------------------------- | |
5303 | ||
5304 | class ActivateEvent(Event): | |
5ba5649b RD |
5305 | """ |
5306 | An activate event is sent when a top-level window or the entire | |
5307 | application is being activated or deactivated. | |
5308 | ||
5309 | A top-level window (a dialog or frame) receives an activate event when | |
5310 | is being activated or deactivated. This is indicated visually by the | |
5311 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5312 | An application is activated or deactivated when one of its frames | |
5313 | becomes activated, or a frame becomes inactivate resulting in all | |
5314 | application frames being inactive. | |
5315 | ||
5316 | Please note that usually you should call event.Skip() in your handlers | |
5317 | for these events so the default handlers will still be called, as not | |
5318 | doing so can result in strange effects. | |
5319 | ||
5320 | """ | |
0085ce49 RD |
5321 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5322 | __repr__ = _swig_repr | |
5323 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5324 | """ |
2131d850 | 5325 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5326 | |
5327 | Constructor | |
5328 | """ | |
0085ce49 | 5329 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
e811c8ce | 5330 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5331 | """ |
5332 | GetActive(self) -> bool | |
5333 | ||
5334 | Returns true if the application or window is being activated, false | |
5335 | otherwise. | |
5336 | """ | |
54f9ee45 | 5337 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5338 | |
2bf58437 | 5339 | Active = property(GetActive,doc="See `GetActive`") |
2131d850 | 5340 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d14a1e28 RD |
5341 | |
5342 | #--------------------------------------------------------------------------- | |
5343 | ||
5344 | class InitDialogEvent(Event): | |
5ba5649b RD |
5345 | """ |
5346 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5347 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5348 | event can transfer data to the window, or anything else that should be | |
5349 | done before the user begins editing the form. The default handler | |
5350 | calls `wx.Window.TransferDataToWindow`. | |
5351 | """ | |
0085ce49 RD |
5352 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5353 | __repr__ = _swig_repr | |
5354 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5355 | """ |
5356 | __init__(self, int Id=0) -> InitDialogEvent | |
5357 | ||
5358 | Constructor | |
5359 | """ | |
0085ce49 | 5360 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5361 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d14a1e28 RD |
5362 | |
5363 | #--------------------------------------------------------------------------- | |
5364 | ||
5365 | class MenuEvent(Event): | |
5ba5649b RD |
5366 | """ |
5367 | This class is used for a variety of menu-related events. Note that | |
5368 | these do not include menu command events, which are handled by sending | |
5369 | `wx.CommandEvent` objects. | |
5370 | ||
5371 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5372 | text in the first field of the status bar. | |
5373 | """ | |
0085ce49 RD |
5374 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5375 | __repr__ = _swig_repr | |
5376 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5377 | """ |
2131d850 | 5378 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5379 | |
5380 | Constructor | |
5381 | """ | |
0085ce49 | 5382 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
e811c8ce | 5383 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5384 | """ |
5385 | GetMenuId(self) -> int | |
5386 | ||
5387 | Returns the menu identifier associated with the event. This method | |
5388 | should be only used with the HIGHLIGHT events. | |
5389 | """ | |
54f9ee45 | 5390 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5391 | |
5392 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5393 | """ |
5394 | IsPopup(self) -> bool | |
5395 | ||
5396 | Returns ``True`` if the menu which is being opened or closed is a | |
5397 | popup menu, ``False`` if it is a normal one. This method should only | |
5398 | be used with the OPEN and CLOSE events. | |
5399 | """ | |
54f9ee45 | 5400 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5401 | |
5402 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5403 | """ |
5404 | GetMenu(self) -> Menu | |
5405 | ||
5406 | Returns the menu which is being opened or closed. This method should | |
5407 | only be used with the OPEN and CLOSE events. | |
5408 | """ | |
54f9ee45 | 5409 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5410 | |
57332a5a RD |
5411 | Menu = property(GetMenu,doc="See `GetMenu`") |
5412 | MenuId = property(GetMenuId,doc="See `GetMenuId`") | |
2131d850 | 5413 | _core_.MenuEvent_swigregister(MenuEvent) |
d14a1e28 RD |
5414 | |
5415 | #--------------------------------------------------------------------------- | |
5416 | ||
5417 | class CloseEvent(Event): | |
5ba5649b RD |
5418 | """ |
5419 | This event class contains information about window and session close | |
5420 | events. | |
5421 | ||
5422 | The handler function for EVT_CLOSE is called when the user has tried | |
5423 | to close a a frame or dialog box using the window manager controls or | |
5424 | the system menu. It can also be invoked by the application itself | |
5425 | programmatically, for example by calling the `wx.Window.Close` | |
5426 | function. | |
5427 | ||
5428 | You should check whether the application is forcing the deletion of | |
5429 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5430 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5431 | it is up to you whether you respond by destroying the window or not. | |
5432 | For example you may wish to display a message dialog prompting to save | |
5433 | files or to cancel the close. | |
5434 | ||
5435 | If you don't destroy the window, you should call `Veto` to let the | |
5436 | calling code know that you did not destroy the window. This allows the | |
5437 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5438 | on whether the close instruction was honored or not. | |
5439 | """ | |
0085ce49 RD |
5440 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5441 | __repr__ = _swig_repr | |
5442 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5443 | """ |
2131d850 | 5444 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5445 | |
5446 | Constructor. | |
5447 | """ | |
0085ce49 | 5448 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
e811c8ce | 5449 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5450 | """ |
5451 | SetLoggingOff(self, bool logOff) | |
5452 | ||
5453 | Sets the 'logging off' flag. | |
5454 | """ | |
54f9ee45 | 5455 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5456 | |
5457 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5458 | """ |
5459 | GetLoggingOff(self) -> bool | |
5460 | ||
6c75a4cf RD |
5461 | Returns ``True`` if the user is logging off or ``False`` if the |
5462 | system is shutting down. This method can only be called for end | |
5463 | session and query end session events, it doesn't make sense for close | |
5464 | window event. | |
5ba5649b | 5465 | """ |
54f9ee45 | 5466 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5467 | |
5468 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5469 | """ |
5470 | Veto(self, bool veto=True) | |
5471 | ||
5472 | Call this from your event handler to veto a system shutdown or to | |
5473 | signal to the calling application that a window close did not happen. | |
5474 | ||
5475 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5476 | """ | |
54f9ee45 | 5477 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5478 | |
5ba5649b RD |
5479 | def GetVeto(*args, **kwargs): |
5480 | """GetVeto(self) -> bool""" | |
5481 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5482 | ||
e811c8ce | 5483 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5484 | """ |
5485 | SetCanVeto(self, bool canVeto) | |
5486 | ||
5487 | Sets the 'can veto' flag. | |
5488 | """ | |
54f9ee45 | 5489 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5490 | |
5491 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5492 | """ |
5493 | CanVeto(self) -> bool | |
e811c8ce | 5494 | |
5ba5649b RD |
5495 | Returns true if you can veto a system shutdown or a window close |
5496 | event. Vetoing a window close event is not possible if the calling | |
5497 | code wishes to force the application to exit, and so this function | |
5498 | must be called to check this. | |
5499 | """ | |
5500 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5501 | |
2bf58437 | 5502 | LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`") |
2131d850 | 5503 | _core_.CloseEvent_swigregister(CloseEvent) |
d14a1e28 RD |
5504 | |
5505 | #--------------------------------------------------------------------------- | |
5506 | ||
5507 | class ShowEvent(Event): | |
5ba5649b | 5508 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
0085ce49 RD |
5509 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5510 | __repr__ = _swig_repr | |
5511 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5512 | """ |
5513 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5514 | ||
5515 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5516 | """ | |
0085ce49 | 5517 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
e811c8ce | 5518 | def SetShow(*args, **kwargs): |
a95a7133 | 5519 | """SetShow(self, bool show)""" |
54f9ee45 | 5520 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5521 | |
5522 | def GetShow(*args, **kwargs): | |
a95a7133 | 5523 | """GetShow(self) -> bool""" |
54f9ee45 | 5524 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5525 | |
33d6fd3b | 5526 | Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`") |
2131d850 | 5527 | _core_.ShowEvent_swigregister(ShowEvent) |
d14a1e28 RD |
5528 | |
5529 | #--------------------------------------------------------------------------- | |
5530 | ||
5531 | class IconizeEvent(Event): | |
5ba5649b RD |
5532 | """ |
5533 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5534 | restored. | |
5535 | """ | |
0085ce49 RD |
5536 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5537 | __repr__ = _swig_repr | |
5538 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5539 | """ |
5540 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5541 | ||
5542 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5543 | restored. | |
5544 | """ | |
0085ce49 | 5545 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
e811c8ce | 5546 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5547 | """ |
5548 | Iconized(self) -> bool | |
5549 | ||
5550 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5551 | been restored. | |
5552 | """ | |
54f9ee45 | 5553 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5554 | |
2131d850 | 5555 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d14a1e28 RD |
5556 | |
5557 | #--------------------------------------------------------------------------- | |
5558 | ||
5559 | class MaximizeEvent(Event): | |
5ba5649b | 5560 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
0085ce49 RD |
5561 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5562 | __repr__ = _swig_repr | |
5563 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5564 | """ |
5565 | __init__(self, int id=0) -> MaximizeEvent | |
5566 | ||
5567 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5568 | """ | |
0085ce49 | 5569 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 5570 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d14a1e28 RD |
5571 | |
5572 | #--------------------------------------------------------------------------- | |
5573 | ||
5574 | class DropFilesEvent(Event): | |
5ba5649b RD |
5575 | """ |
5576 | This class is used for drop files events, that is, when files have | |
5577 | been dropped onto the window. This functionality is only available | |
5578 | under Windows. The window must have previously been enabled for | |
5579 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5580 | ||
5581 | Important note: this is a separate implementation to the more general | |
5582 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5583 | implementation uses the older, Windows message-based approach of | |
5584 | dropping files. | |
5585 | ||
5586 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5587 | events. | |
5588 | ||
5589 | """ | |
0085ce49 RD |
5590 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5591 | def __init__(self): raise AttributeError, "No constructor defined" | |
5592 | __repr__ = _swig_repr | |
e811c8ce | 5593 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5594 | """ |
5595 | GetPosition(self) -> Point | |
5596 | ||
5597 | Returns the position at which the files were dropped. | |
5598 | """ | |
54f9ee45 | 5599 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5600 | |
5601 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5602 | """ |
5603 | GetNumberOfFiles(self) -> int | |
5604 | ||
5605 | Returns the number of files dropped. | |
5606 | """ | |
54f9ee45 | 5607 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
5608 | |
5609 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5610 | """ |
5611 | GetFiles(self) -> PyObject | |
5612 | ||
5613 | Returns a list of the filenames that were dropped. | |
5614 | """ | |
54f9ee45 | 5615 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 5616 | |
2bf58437 RD |
5617 | Files = property(GetFiles,doc="See `GetFiles`") |
5618 | NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`") | |
5619 | Position = property(GetPosition,doc="See `GetPosition`") | |
2131d850 | 5620 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d14a1e28 RD |
5621 | |
5622 | #--------------------------------------------------------------------------- | |
5623 | ||
54f9ee45 RD |
5624 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5625 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 5626 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
5627 | """ |
5628 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5629 | wxWidgets to give an application the chance to update various user | |
5630 | interface elements. | |
5631 | ||
5632 | Without update UI events, an application has to work hard to | |
5633 | check/uncheck, enable/disable, and set the text for elements such as | |
5634 | menu items and toolbar buttons. The code for doing this has to be | |
5635 | mixed up with the code that is invoked when an action is invoked for a | |
5636 | menu item or button. | |
5637 | ||
5638 | With update UI events, you define an event handler to look at the | |
5639 | state of the application and change UI elements accordingly. wxWidgets | |
5640 | will call your handler functions in idle time, so you don't have to | |
5641 | worry where to call this code. In addition to being a clearer and more | |
5642 | declarative method, it also means you don't have to worry whether | |
5643 | you're updating a toolbar or menubar identifier. The same handler can | |
5644 | update a menu item and toolbar button, if the ID values are the same. | |
5645 | ||
5646 | Instead of directly manipulating the menu or button, you call | |
5647 | functions in the event object, such as `Check`. wxWidgets will | |
5648 | determine whether such a call has been made, and which UI element to | |
5649 | update. | |
5650 | ||
5651 | These events will work for popup menus as well as menubars. Just | |
5652 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5653 | any UI events for the window that owns the menu. | |
5654 | ||
5655 | If you find that the overhead of UI update processing is affecting | |
5656 | your application, you can do one or both of the following: | |
5657 | ||
5658 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5659 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5660 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5661 | receive update events. No other windows will receive update | |
5662 | events. | |
5663 | ||
5664 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5665 | value to set the delay between updates. You may need to call | |
5666 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5667 | a dialog is about to be shown, in case the user sees a slight | |
5668 | delay before windows are updated. | |
5669 | ||
5670 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5671 | handler for a window does not affect this because the events are sent | |
5672 | from an internal idle handler. | |
5673 | ||
5674 | wxWidgets tries to optimize update events on some platforms. On | |
5675 | Windows and GTK+, events for menubar items are only sent when the menu | |
5676 | is about to be shown, and not in idle time. | |
5677 | ||
5678 | """ | |
0085ce49 RD |
5679 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5680 | __repr__ = _swig_repr | |
5681 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5682 | """ |
5683 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5684 | ||
5685 | Constructor | |
5686 | """ | |
0085ce49 | 5687 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
e811c8ce | 5688 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5689 | """ |
5690 | GetChecked(self) -> bool | |
5691 | ||
5692 | Returns ``True`` if the UI element should be checked. | |
5693 | """ | |
54f9ee45 | 5694 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
5695 | |
5696 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5697 | """ |
5698 | GetEnabled(self) -> bool | |
5699 | ||
5700 | Returns ``True`` if the UI element should be enabled. | |
5701 | """ | |
54f9ee45 | 5702 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce | 5703 | |
b1fcee84 RD |
5704 | def GetShown(*args, **kwargs): |
5705 | """ | |
5706 | GetShown(self) -> bool | |
5707 | ||
5708 | Returns ``True`` if the UI element should be shown. | |
5709 | """ | |
5710 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
5711 | ||
e811c8ce | 5712 | def GetText(*args, **kwargs): |
5ba5649b RD |
5713 | """ |
5714 | GetText(self) -> String | |
5715 | ||
5716 | Returns the text that should be set for the UI element. | |
5717 | """ | |
54f9ee45 | 5718 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
5719 | |
5720 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5721 | """ |
5722 | GetSetText(self) -> bool | |
5723 | ||
5724 | Returns ``True`` if the application has called `SetText`. For | |
5725 | wxWidgets internal use only. | |
5726 | """ | |
54f9ee45 | 5727 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
5728 | |
5729 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5730 | """ |
5731 | GetSetChecked(self) -> bool | |
5732 | ||
5733 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5734 | internal use only. | |
5735 | """ | |
54f9ee45 | 5736 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
5737 | |
5738 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5739 | """ |
5740 | GetSetEnabled(self) -> bool | |
5741 | ||
5742 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5743 | internal use only. | |
5744 | """ | |
54f9ee45 | 5745 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce | 5746 | |
b1fcee84 RD |
5747 | def GetSetShown(*args, **kwargs): |
5748 | """ | |
5749 | GetSetShown(self) -> bool | |
5750 | ||
5751 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
5752 | internal use only. | |
5753 | """ | |
5754 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
5755 | ||
e811c8ce | 5756 | def Check(*args, **kwargs): |
5ba5649b RD |
5757 | """ |
5758 | Check(self, bool check) | |
5759 | ||
5760 | Check or uncheck the UI element. | |
5761 | """ | |
54f9ee45 | 5762 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
5763 | |
5764 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5765 | """ |
5766 | Enable(self, bool enable) | |
5767 | ||
5768 | Enable or disable the UI element. | |
5769 | """ | |
54f9ee45 | 5770 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce | 5771 | |
b1fcee84 RD |
5772 | def Show(*args, **kwargs): |
5773 | """ | |
5774 | Show(self, bool show) | |
5775 | ||
5776 | Show or hide the UI element. | |
5777 | """ | |
5778 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
5779 | ||
e811c8ce | 5780 | def SetText(*args, **kwargs): |
5ba5649b RD |
5781 | """ |
5782 | SetText(self, String text) | |
5783 | ||
5784 | Sets the text for this UI element. | |
5785 | """ | |
54f9ee45 | 5786 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
5787 | |
5788 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5789 | """ |
5790 | SetUpdateInterval(long updateInterval) | |
5791 | ||
5792 | Sets the interval between updates in milliseconds. Set to -1 to | |
5793 | disable updates, or to 0 to update as frequently as possible. The | |
5794 | default is 0. | |
5795 | ||
5796 | Use this to reduce the overhead of UI update events if your | |
5797 | application has a lot of windows. If you set the value to -1 or | |
5798 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5799 | at appropriate points in your application, such as when a dialog is | |
5800 | about to be shown. | |
5801 | """ | |
54f9ee45 | 5802 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5803 | |
5804 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5805 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5806 | """ |
5807 | GetUpdateInterval() -> long | |
5808 | ||
5809 | Returns the current interval between updates in milliseconds. -1 | |
5810 | disables updates, 0 updates as frequently as possible. | |
5811 | """ | |
54f9ee45 | 5812 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5813 | |
5814 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5815 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5816 | """ |
5817 | CanUpdate(Window win) -> bool | |
5818 | ||
5819 | Returns ``True`` if it is appropriate to update (send UI update events | |
5820 | to) this window. | |
5821 | ||
5822 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5823 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5824 | events were last sent in idle time, and the update interval, to | |
5825 | determine whether events should be sent to this window now. By default | |
5826 | this will always return true because the update mode is initially | |
5827 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5828 | events will be sent as often as possible. You can reduce the frequency | |
5829 | that events are sent by changing the mode and/or setting an update | |
5830 | interval. | |
5831 | ||
5832 | """ | |
54f9ee45 | 5833 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
5834 | |
5835 | CanUpdate = staticmethod(CanUpdate) | |
5836 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5837 | """ |
5838 | ResetUpdateTime() | |
5839 | ||
5840 | Used internally to reset the last-updated time to the current time. It | |
5841 | is assumed that update events are normally sent in idle time, so this | |
5842 | is called at the end of idle processing. | |
5843 | """ | |
54f9ee45 | 5844 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
5845 | |
5846 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5847 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5848 | """ |
5849 | SetMode(int mode) | |
5850 | ||
5851 | Specify how wxWidgets will send update events: to all windows, or only | |
5852 | to those which specify that they will process the events. | |
5853 | ||
5854 | The mode may be one of the following values: | |
5855 | ||
5856 | ============================= ========================================== | |
5857 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5858 | is the default setting. | |
5859 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5860 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5861 | style set. | |
5862 | ============================= ========================================== | |
5863 | ||
5864 | """ | |
54f9ee45 | 5865 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
5866 | |
5867 | SetMode = staticmethod(SetMode) | |
5868 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5869 | """ |
5870 | GetMode() -> int | |
5871 | ||
5872 | Returns a value specifying how wxWidgets will send update events: to | |
5873 | all windows, or only to those which specify that they will process the | |
5874 | events. | |
5875 | """ | |
54f9ee45 | 5876 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
5877 | |
5878 | GetMode = staticmethod(GetMode) | |
2131d850 | 5879 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d14a1e28 | 5880 | |
e811c8ce | 5881 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
0085ce49 | 5882 | """ |
5ba5649b RD |
5883 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
5884 | ||
5885 | Sets the interval between updates in milliseconds. Set to -1 to | |
5886 | disable updates, or to 0 to update as frequently as possible. The | |
5887 | default is 0. | |
5888 | ||
5889 | Use this to reduce the overhead of UI update events if your | |
5890 | application has a lot of windows. If you set the value to -1 or | |
5891 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5892 | at appropriate points in your application, such as when a dialog is | |
5893 | about to be shown. | |
5894 | """ | |
0085ce49 | 5895 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 5896 | |
0085ce49 RD |
5897 | def UpdateUIEvent_GetUpdateInterval(*args): |
5898 | """ | |
5ba5649b RD |
5899 | UpdateUIEvent_GetUpdateInterval() -> long |
5900 | ||
5901 | Returns the current interval between updates in milliseconds. -1 | |
5902 | disables updates, 0 updates as frequently as possible. | |
5903 | """ | |
0085ce49 | 5904 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d14a1e28 | 5905 | |
e811c8ce | 5906 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
0085ce49 | 5907 | """ |
5ba5649b RD |
5908 | UpdateUIEvent_CanUpdate(Window win) -> bool |
5909 | ||
5910 | Returns ``True`` if it is appropriate to update (send UI update events | |
5911 | to) this window. | |
5912 | ||
5913 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5914 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5915 | events were last sent in idle time, and the update interval, to | |
5916 | determine whether events should be sent to this window now. By default | |
5917 | this will always return true because the update mode is initially | |
5918 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5919 | events will be sent as often as possible. You can reduce the frequency | |
5920 | that events are sent by changing the mode and/or setting an update | |
5921 | interval. | |
5922 | ||
5923 | """ | |
0085ce49 | 5924 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 5925 | |
0085ce49 RD |
5926 | def UpdateUIEvent_ResetUpdateTime(*args): |
5927 | """ | |
5ba5649b RD |
5928 | UpdateUIEvent_ResetUpdateTime() |
5929 | ||
5930 | Used internally to reset the last-updated time to the current time. It | |
5931 | is assumed that update events are normally sent in idle time, so this | |
5932 | is called at the end of idle processing. | |
5933 | """ | |
0085ce49 | 5934 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d14a1e28 | 5935 | |
e811c8ce | 5936 | def UpdateUIEvent_SetMode(*args, **kwargs): |
0085ce49 | 5937 | """ |
5ba5649b RD |
5938 | UpdateUIEvent_SetMode(int mode) |
5939 | ||
5940 | Specify how wxWidgets will send update events: to all windows, or only | |
5941 | to those which specify that they will process the events. | |
5942 | ||
5943 | The mode may be one of the following values: | |
5944 | ||
5945 | ============================= ========================================== | |
5946 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5947 | is the default setting. | |
5948 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5949 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5950 | style set. | |
5951 | ============================= ========================================== | |
5952 | ||
5953 | """ | |
0085ce49 | 5954 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 5955 | |
0085ce49 RD |
5956 | def UpdateUIEvent_GetMode(*args): |
5957 | """ | |
5ba5649b RD |
5958 | UpdateUIEvent_GetMode() -> int |
5959 | ||
5960 | Returns a value specifying how wxWidgets will send update events: to | |
5961 | all windows, or only to those which specify that they will process the | |
5962 | events. | |
5963 | """ | |
0085ce49 | 5964 | return _core_.UpdateUIEvent_GetMode(*args) |
d14a1e28 RD |
5965 | |
5966 | #--------------------------------------------------------------------------- | |
5967 | ||
5968 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
5969 | """ |
5970 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
5971 | when the user changes the colour settings using the control | |
5972 | panel. This is only applicable under Windows. | |
5973 | ||
5974 | The default event handler for this event propagates the event to child | |
5975 | windows, since Windows only sends the events to top-level windows. If | |
5976 | intercepting this event for a top-level window, remember to call | |
5977 | `Skip` so the the base class handler will still be executed, or to | |
5978 | pass the event on to the window's children explicitly. | |
5979 | ||
5980 | """ | |
0085ce49 RD |
5981 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5982 | __repr__ = _swig_repr | |
5983 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5984 | """ |
5985 | __init__(self) -> SysColourChangedEvent | |
5986 | ||
5987 | Constructor | |
5988 | """ | |
0085ce49 | 5989 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 5990 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d14a1e28 RD |
5991 | |
5992 | #--------------------------------------------------------------------------- | |
5993 | ||
5994 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
5995 | """ |
5996 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
5997 | a window that loses its mouse capture. This is called even if | |
5998 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
5999 | this event allows an application to cater for unexpected capture | |
6000 | releases which might otherwise confuse mouse handling code. | |
6001 | ||
6002 | This event is implemented under Windows only. | |
6003 | """ | |
0085ce49 RD |
6004 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6005 | __repr__ = _swig_repr | |
6006 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6007 | """ |
6008 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6009 | ||
6010 | Constructor | |
6011 | """ | |
0085ce49 | 6012 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
e811c8ce | 6013 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
6014 | """ |
6015 | GetCapturedWindow(self) -> Window | |
6016 | ||
6017 | Returns the window that gained the capture, or ``None`` if it was a | |
6018 | non-wxWidgets window. | |
6019 | """ | |
54f9ee45 | 6020 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 6021 | |
57332a5a | 6022 | CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`") |
2131d850 | 6023 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d14a1e28 RD |
6024 | |
6025 | #--------------------------------------------------------------------------- | |
6026 | ||
34e0a3bb RD |
6027 | class MouseCaptureLostEvent(Event): |
6028 | """ | |
6029 | A mouse capture lost event is sent to a window that obtained mouse | |
6030 | capture, which was subsequently loss due to "external" event, for | |
6031 | example when a dialog box is shown or if another application captures | |
6032 | the mouse. | |
6033 | ||
6034 | If this happens, this event is sent to all windows that are on the | |
6035 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6036 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6037 | if the capture changes because of a call to CaptureMouse or | |
6038 | ReleaseMouse. | |
6039 | ||
6040 | This event is currently emitted under Windows only. | |
6041 | ||
6042 | """ | |
6043 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6044 | __repr__ = _swig_repr | |
6045 | def __init__(self, *args, **kwargs): | |
6046 | """ | |
6047 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
6048 | ||
6049 | A mouse capture lost event is sent to a window that obtained mouse | |
6050 | capture, which was subsequently loss due to "external" event, for | |
6051 | example when a dialog box is shown or if another application captures | |
6052 | the mouse. | |
6053 | ||
6054 | If this happens, this event is sent to all windows that are on the | |
6055 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6056 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6057 | if the capture changes because of a call to CaptureMouse or | |
6058 | ReleaseMouse. | |
6059 | ||
6060 | This event is currently emitted under Windows only. | |
6061 | ||
6062 | """ | |
6063 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
6064 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
6065 | ||
6066 | #--------------------------------------------------------------------------- | |
6067 | ||
d14a1e28 | 6068 | class DisplayChangedEvent(Event): |
5ba5649b RD |
6069 | """ |
6070 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6071 | resolution has changed. | |
6072 | ||
6073 | This event is implemented under Windows only. | |
6074 | """ | |
0085ce49 RD |
6075 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6076 | __repr__ = _swig_repr | |
6077 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6078 | """__init__(self) -> DisplayChangedEvent""" |
0085ce49 | 6079 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 6080 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d14a1e28 RD |
6081 | |
6082 | #--------------------------------------------------------------------------- | |
6083 | ||
6084 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
6085 | """ |
6086 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6087 | changed, thereby giving each window a chance to redo their own to | |
6088 | match. | |
6089 | ||
6090 | This event is implemented under Windows only. | |
6091 | """ | |
0085ce49 RD |
6092 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6093 | __repr__ = _swig_repr | |
6094 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6095 | """ |
6096 | __init__(self, int id=0) -> PaletteChangedEvent | |
6097 | ||
6098 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6099 | changed, thereby giving each window a chance to redo their own to | |
6100 | match. | |
6101 | ||
6102 | This event is implemented under Windows only. | |
6103 | """ | |
0085ce49 | 6104 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
e811c8ce | 6105 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 6106 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 6107 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
6108 | |
6109 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 6110 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 6111 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 6112 | |
33d6fd3b | 6113 | ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`") |
2131d850 | 6114 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d14a1e28 RD |
6115 | |
6116 | #--------------------------------------------------------------------------- | |
6117 | ||
6118 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6119 | """ |
6120 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6121 | focus and should re-do its palette. | |
6122 | ||
6123 | This event is implemented under Windows only. | |
6124 | """ | |
0085ce49 RD |
6125 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6126 | __repr__ = _swig_repr | |
6127 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6128 | """ |
6129 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6130 | ||
6131 | Constructor. | |
6132 | """ | |
0085ce49 | 6133 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
e811c8ce | 6134 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6135 | """ |
6136 | SetPaletteRealized(self, bool realized) | |
6137 | ||
6138 | App should set this if it changes the palette. | |
6139 | """ | |
54f9ee45 | 6140 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
6141 | |
6142 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 6143 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 6144 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 6145 | |
33d6fd3b | 6146 | PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`") |
2131d850 | 6147 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d14a1e28 RD |
6148 | |
6149 | #--------------------------------------------------------------------------- | |
6150 | ||
6151 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6152 | """ |
6153 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6154 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6155 | catch navigation events in applications as there are already | |
6156 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6157 | it useful to send navigation events in certain situations to change | |
6158 | the focus in certain ways, although it's probably easier to just call | |
6159 | `wx.Window.Navigate`. | |
6160 | """ | |
0085ce49 RD |
6161 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6162 | __repr__ = _swig_repr | |
6163 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6164 | """__init__(self) -> NavigationKeyEvent""" |
0085ce49 | 6165 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
e811c8ce | 6166 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6167 | """ |
6168 | GetDirection(self) -> bool | |
6169 | ||
6170 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6171 | """ | |
54f9ee45 | 6172 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
6173 | |
6174 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6175 | """ |
6176 | SetDirection(self, bool forward) | |
6177 | ||
6178 | Specify the direction that the navigation should take. Usually the | |
6179 | difference between using Tab and Shift-Tab. | |
6180 | """ | |
54f9ee45 | 6181 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
6182 | |
6183 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6184 | """ |
6185 | IsWindowChange(self) -> bool | |
6186 | ||
6187 | Returns ``True`` if window change is allowed. | |
6188 | """ | |
54f9ee45 | 6189 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
6190 | |
6191 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6192 | """ |
6193 | SetWindowChange(self, bool ischange) | |
6194 | ||
6195 | Specify if the navigation should be able to change parent windows. | |
6196 | For example, changing notebook pages, etc. This is usually implemented | |
6197 | by using Control-Tab. | |
6198 | """ | |
54f9ee45 | 6199 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 6200 | |
68350608 | 6201 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6202 | """ |
6203 | IsFromTab(self) -> bool | |
6204 | ||
6205 | Returns ``True`` if the navigation event is originated from the Tab | |
6206 | key. | |
6207 | """ | |
68350608 RD |
6208 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6209 | ||
6210 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6211 | """ |
6212 | SetFromTab(self, bool bIs) | |
6213 | ||
6214 | Set to true under MSW if the event was generated using the tab key. | |
6215 | This is required for proper navogation over radio buttons. | |
6216 | """ | |
68350608 RD |
6217 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6218 | ||
908b74cd | 6219 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6220 | """ |
6221 | SetFlags(self, long flags) | |
6222 | ||
6223 | Set the navigation flags to a combination of the following: | |
6224 | ||
6225 | * wx.NavigationKeyEvent.IsBackward | |
6226 | * wx.NavigationKeyEvent.IsForward | |
6227 | * wx.NavigationKeyEvent.WinChange | |
6228 | * wx.NavigationKeyEvent.FromTab | |
6229 | ||
6230 | """ | |
908b74cd RD |
6231 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6232 | ||
e811c8ce | 6233 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6234 | """ |
6235 | GetCurrentFocus(self) -> Window | |
6236 | ||
6237 | Returns the child window which currenty has the focus. May be | |
6238 | ``None``. | |
6239 | """ | |
54f9ee45 | 6240 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6241 | |
6242 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6243 | """ |
6244 | SetCurrentFocus(self, Window win) | |
6245 | ||
6246 | Set the window that has the focus. | |
6247 | """ | |
54f9ee45 | 6248 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6249 | |
b0f7404b | 6250 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6251 | IsForward = _core_.NavigationKeyEvent_IsForward |
6252 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6253 | FromTab = _core_.NavigationKeyEvent_FromTab |
57332a5a RD |
6254 | CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`") |
6255 | Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`") | |
2131d850 | 6256 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d14a1e28 RD |
6257 | |
6258 | #--------------------------------------------------------------------------- | |
6259 | ||
6260 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6261 | """ |
6262 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6263 | underlying GUI object) exists. | |
6264 | """ | |
0085ce49 RD |
6265 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6266 | __repr__ = _swig_repr | |
6267 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6268 | """ |
6269 | __init__(self, Window win=None) -> WindowCreateEvent | |
6270 | ||
6271 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6272 | underlying GUI object) exists. | |
6273 | """ | |
0085ce49 | 6274 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
e811c8ce | 6275 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6276 | """ |
6277 | GetWindow(self) -> Window | |
6278 | ||
6279 | Returns the window that this event refers to. | |
6280 | """ | |
54f9ee45 | 6281 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6282 | |
2131d850 | 6283 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d14a1e28 RD |
6284 | |
6285 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6286 | """ |
943e8dfd RD |
6287 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6288 | when the GUI window is destroyed. | |
6289 | ||
6290 | When a class derived from `wx.Window` is destroyed its destructor will | |
6291 | have already run by the time this event is sent. Therefore this event | |
6292 | will not usually be received at all by the window itself. Since it is | |
6293 | received after the destructor has run, an object should not try to | |
6294 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6295 | notification of the destruction of another window. | |
5ba5649b | 6296 | """ |
0085ce49 RD |
6297 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6298 | __repr__ = _swig_repr | |
6299 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6300 | """ |
6301 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6302 | ||
943e8dfd RD |
6303 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6304 | when the GUI window is destroyed. | |
6305 | ||
6306 | When a class derived from `wx.Window` is destroyed its destructor will | |
6307 | have already run by the time this event is sent. Therefore this event | |
6308 | will not usually be received at all by the window itself. Since it is | |
6309 | received after the destructor has run, an object should not try to | |
6310 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6311 | notification of the destruction of another window. | |
5ba5649b | 6312 | """ |
0085ce49 | 6313 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
e811c8ce | 6314 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6315 | """ |
6316 | GetWindow(self) -> Window | |
6317 | ||
6318 | Returns the window that this event refers to. | |
6319 | """ | |
54f9ee45 | 6320 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6321 | |
2131d850 | 6322 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d14a1e28 RD |
6323 | |
6324 | #--------------------------------------------------------------------------- | |
6325 | ||
6326 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6327 | """ |
6328 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6329 | give the application a chance to show a context (popup) menu. | |
6330 | """ | |
0085ce49 RD |
6331 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6332 | __repr__ = _swig_repr | |
6333 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6334 | """ |
2131d850 | 6335 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6336 | |
6337 | Constructor. | |
6338 | """ | |
0085ce49 | 6339 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
e811c8ce | 6340 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6341 | """ |
6342 | GetPosition(self) -> Point | |
6343 | ||
6344 | Returns the position (in screen coordinants) at which the menu should | |
6345 | be shown. | |
6346 | """ | |
54f9ee45 | 6347 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6348 | |
6349 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6350 | """ |
6351 | SetPosition(self, Point pos) | |
6352 | ||
6353 | Sets the position at which the menu should be shown. | |
6354 | """ | |
54f9ee45 | 6355 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6356 | |
2bf58437 | 6357 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
2131d850 | 6358 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d14a1e28 RD |
6359 | |
6360 | #--------------------------------------------------------------------------- | |
6361 | ||
54f9ee45 RD |
6362 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6363 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6364 | class IdleEvent(Event): |
5ba5649b RD |
6365 | """ |
6366 | This class is used for EVT_IDLE events, which are generated and sent | |
6367 | when the application *becomes* idle. In other words, the when the | |
6368 | event queue becomes empty then idle events are sent to all windows (by | |
6369 | default) and as long as none of them call `RequestMore` then there are | |
6370 | no more idle events until after the system event queue has some normal | |
6371 | events and then becomes empty again. | |
6372 | ||
6373 | By default, idle events are sent to all windows. If this is causing a | |
6374 | significant overhead in your application, you can call | |
6375 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6376 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6377 | which should receive idle events. Then idle events will only be sent | |
6378 | to those windows and not to any others. | |
6379 | """ | |
0085ce49 RD |
6380 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6381 | __repr__ = _swig_repr | |
6382 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6383 | """ |
6384 | __init__(self) -> IdleEvent | |
6385 | ||
6386 | Constructor | |
6387 | """ | |
0085ce49 | 6388 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
e811c8ce | 6389 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6390 | """ |
6391 | RequestMore(self, bool needMore=True) | |
6392 | ||
6393 | Tells wxWidgets that more processing is required. This function can be | |
6394 | called by an EVT_IDLE handler for a window to indicate that the | |
6395 | application should forward the EVT_IDLE event once more to the | |
6396 | application windows. If no window calls this function during its | |
6397 | EVT_IDLE handler, then the application will remain in a passive event | |
6398 | loop until a new event is posted to the application by the windowing | |
6399 | system. | |
6400 | """ | |
54f9ee45 | 6401 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6402 | |
6403 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6404 | """ |
6405 | MoreRequested(self) -> bool | |
6406 | ||
6407 | Returns ``True`` if the OnIdle function processing this event | |
6408 | requested more processing time. | |
6409 | """ | |
54f9ee45 | 6410 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6411 | |
6412 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6413 | """ |
6414 | SetMode(int mode) | |
6415 | ||
6416 | Static method for specifying how wxWidgets will send idle events: to | |
6417 | all windows, or only to those which specify that they will process the | |
6418 | events. | |
6419 | ||
6420 | The mode can be one of the following values: | |
6421 | ||
6422 | ========================= ======================================== | |
6423 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6424 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6425 | the wx.WS_EX_PROCESS_IDLE extra style | |
6426 | flag set. | |
6427 | ========================= ======================================== | |
6428 | ||
6429 | """ | |
54f9ee45 | 6430 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6431 | |
6432 | SetMode = staticmethod(SetMode) | |
6433 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6434 | """ |
6435 | GetMode() -> int | |
6436 | ||
6437 | Static method returning a value specifying how wxWidgets will send | |
6438 | idle events: to all windows, or only to those which specify that they | |
6439 | will process the events. | |
6440 | """ | |
54f9ee45 | 6441 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6442 | |
6443 | GetMode = staticmethod(GetMode) | |
6444 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6445 | """ |
6446 | CanSend(Window win) -> bool | |
6447 | ||
6448 | Returns ``True`` if it is appropriate to send idle events to this | |
6449 | window. | |
6450 | ||
6451 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6452 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6453 | events should be sent to this window now. By default this will always | |
6454 | return ``True`` because the update mode is initially | |
6455 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6456 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6457 | """ | |
54f9ee45 | 6458 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6459 | |
6460 | CanSend = staticmethod(CanSend) | |
2131d850 | 6461 | _core_.IdleEvent_swigregister(IdleEvent) |
d14a1e28 | 6462 | |
e811c8ce | 6463 | def IdleEvent_SetMode(*args, **kwargs): |
0085ce49 | 6464 | """ |
5ba5649b RD |
6465 | IdleEvent_SetMode(int mode) |
6466 | ||
6467 | Static method for specifying how wxWidgets will send idle events: to | |
6468 | all windows, or only to those which specify that they will process the | |
6469 | events. | |
6470 | ||
6471 | The mode can be one of the following values: | |
6472 | ||
6473 | ========================= ======================================== | |
6474 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6475 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6476 | the wx.WS_EX_PROCESS_IDLE extra style | |
6477 | flag set. | |
6478 | ========================= ======================================== | |
6479 | ||
6480 | """ | |
0085ce49 | 6481 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6482 | |
0085ce49 RD |
6483 | def IdleEvent_GetMode(*args): |
6484 | """ | |
5ba5649b RD |
6485 | IdleEvent_GetMode() -> int |
6486 | ||
6487 | Static method returning a value specifying how wxWidgets will send | |
6488 | idle events: to all windows, or only to those which specify that they | |
6489 | will process the events. | |
6490 | """ | |
0085ce49 | 6491 | return _core_.IdleEvent_GetMode(*args) |
d14a1e28 | 6492 | |
e811c8ce | 6493 | def IdleEvent_CanSend(*args, **kwargs): |
0085ce49 | 6494 | """ |
5ba5649b RD |
6495 | IdleEvent_CanSend(Window win) -> bool |
6496 | ||
6497 | Returns ``True`` if it is appropriate to send idle events to this | |
6498 | window. | |
6499 | ||
6500 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6501 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6502 | events should be sent to this window now. By default this will always | |
6503 | return ``True`` because the update mode is initially | |
6504 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6505 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6506 | """ | |
0085ce49 | 6507 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6508 | |
6509 | #--------------------------------------------------------------------------- | |
6510 | ||
2131d850 RD |
6511 | class ClipboardTextEvent(CommandEvent): |
6512 | """ | |
6513 | A Clipboard Text event is sent when a window intercepts a text | |
6514 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6515 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6516 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6517 | generated automatically for a Rich Edit text control. | |
6518 | """ | |
6519 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6520 | __repr__ = _swig_repr | |
6521 | def __init__(self, *args, **kwargs): | |
6522 | """ | |
6523 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6524 | ||
6525 | A Clipboard Text event is sent when a window intercepts a text | |
6526 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6527 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6528 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6529 | generated automatically for a Rich Edit text control. | |
6530 | """ | |
6531 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6532 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6533 | ||
6534 | #--------------------------------------------------------------------------- | |
6535 | ||
d14a1e28 | 6536 | class PyEvent(Event): |
5ba5649b RD |
6537 | """ |
6538 | wx.PyEvent can be used as a base class for implementing custom event | |
6539 | types in Python. You should derived from this class instead of | |
6540 | `wx.Event` because this class is Python-aware and is able to transport | |
6541 | its Python bits safely through the wxWidgets event system and have | |
6542 | them still be there when the event handler is invoked. | |
6543 | ||
6544 | :see: `wx.PyCommandEvent` | |
6545 | ||
6546 | """ | |
0085ce49 RD |
6547 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6548 | __repr__ = _swig_repr | |
6549 | def __init__(self, *args, **kwargs): | |
2131d850 | 6550 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
0085ce49 | 6551 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6552 | self._SetSelf(self) |
e811c8ce | 6553 | |
0085ce49 RD |
6554 | __swig_destroy__ = _core_.delete_PyEvent |
6555 | __del__ = lambda self : None; | |
5ba5649b RD |
6556 | def _SetSelf(*args, **kwargs): |
6557 | """_SetSelf(self, PyObject self)""" | |
6558 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6559 | |
5ba5649b RD |
6560 | def _GetSelf(*args, **kwargs): |
6561 | """_GetSelf(self) -> PyObject""" | |
6562 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6563 | |
2131d850 | 6564 | _core_.PyEvent_swigregister(PyEvent) |
d14a1e28 RD |
6565 | |
6566 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6567 | """ |
6568 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6569 | event types in Python, where the event shoudl travel up to parent | |
6570 | windows looking for a handler. You should derived from this class | |
6571 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6572 | able to transport its Python bits safely through the wxWidgets event | |
6573 | system and have them still be there when the event handler is invoked. | |
6574 | ||
6575 | :see: `wx.PyEvent` | |
6576 | ||
6577 | """ | |
0085ce49 RD |
6578 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6579 | __repr__ = _swig_repr | |
6580 | def __init__(self, *args, **kwargs): | |
2131d850 | 6581 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
0085ce49 | 6582 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 6583 | self._SetSelf(self) |
e811c8ce | 6584 | |
0085ce49 RD |
6585 | __swig_destroy__ = _core_.delete_PyCommandEvent |
6586 | __del__ = lambda self : None; | |
5ba5649b RD |
6587 | def _SetSelf(*args, **kwargs): |
6588 | """_SetSelf(self, PyObject self)""" | |
6589 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6590 | |
5ba5649b RD |
6591 | def _GetSelf(*args, **kwargs): |
6592 | """_GetSelf(self) -> PyObject""" | |
6593 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6594 | |
2131d850 | 6595 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d14a1e28 | 6596 | |
53aa7709 | 6597 | class DateEvent(CommandEvent): |
5ba5649b RD |
6598 | """ |
6599 | This event class holds information about a date change event and is | |
6600 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6601 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6602 | EVT_DATE_CHANGED. | |
6603 | """ | |
0085ce49 RD |
6604 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6605 | __repr__ = _swig_repr | |
6606 | def __init__(self, *args, **kwargs): | |
2131d850 | 6607 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
0085ce49 | 6608 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 6609 | def GetDate(*args, **kwargs): |
5ba5649b RD |
6610 | """ |
6611 | GetDate(self) -> DateTime | |
6612 | ||
6613 | Returns the date. | |
6614 | """ | |
53aa7709 RD |
6615 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6616 | ||
6617 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6618 | """ |
6619 | SetDate(self, DateTime date) | |
6620 | ||
6621 | Sets the date carried by the event, normally only used by the library | |
6622 | internally. | |
6623 | """ | |
53aa7709 RD |
6624 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6625 | ||
2bf58437 | 6626 | Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`") |
2131d850 | 6627 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 RD |
6628 | |
6629 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6630 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6631 | ||
d14a1e28 RD |
6632 | #--------------------------------------------------------------------------- |
6633 | ||
54f9ee45 RD |
6634 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6635 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6636 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6637 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6638 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6639 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 6640 | class PyApp(EvtHandler): |
66c033b4 RD |
6641 | """ |
6642 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6643 | `wx.App` class (or some other derived class) instead. | |
6644 | """ | |
0085ce49 RD |
6645 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6646 | __repr__ = _swig_repr | |
6647 | def __init__(self, *args, **kwargs): | |
98e665d3 | 6648 | """ |
a95a7133 | 6649 | __init__(self) -> PyApp |
98e665d3 RD |
6650 | |
6651 | Create a new application object, starting the bootstrap process. | |
6652 | """ | |
0085ce49 | 6653 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
70b7a5fe RD |
6654 | self._setCallbackInfo(self, PyApp, False) |
6655 | self._setOORInfo(self, False) | |
e811c8ce | 6656 | |
0085ce49 RD |
6657 | __swig_destroy__ = _core_.delete_PyApp |
6658 | __del__ = lambda self : None; | |
e811c8ce | 6659 | def _setCallbackInfo(*args, **kwargs): |
70b7a5fe | 6660 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
54f9ee45 | 6661 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
6662 | |
6663 | def GetAppName(*args, **kwargs): | |
0df68c9f | 6664 | """ |
a95a7133 | 6665 | GetAppName(self) -> String |
6c3b4aae | 6666 | |
0df68c9f RD |
6667 | Get the application name. |
6668 | """ | |
54f9ee45 | 6669 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
6670 | |
6671 | def SetAppName(*args, **kwargs): | |
0df68c9f | 6672 | """ |
a95a7133 | 6673 | SetAppName(self, String name) |
6c3b4aae | 6674 | |
66c033b4 RD |
6675 | Set the application name. This value may be used automatically by |
6676 | `wx.Config` and such. | |
0df68c9f | 6677 | """ |
54f9ee45 | 6678 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
6679 | |
6680 | def GetClassName(*args, **kwargs): | |
0df68c9f | 6681 | """ |
a95a7133 | 6682 | GetClassName(self) -> String |
e811c8ce | 6683 | |
0df68c9f RD |
6684 | Get the application's class name. |
6685 | """ | |
54f9ee45 | 6686 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
6687 | |
6688 | def SetClassName(*args, **kwargs): | |
0df68c9f | 6689 | """ |
a95a7133 | 6690 | SetClassName(self, String name) |
6c3b4aae | 6691 | |
66c033b4 RD |
6692 | Set the application's class name. This value may be used for |
6693 | X-resources if applicable for the platform | |
0df68c9f | 6694 | """ |
54f9ee45 | 6695 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
6696 | |
6697 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 6698 | """ |
a95a7133 | 6699 | GetVendorName(self) -> String |
6c3b4aae | 6700 | |
0df68c9f RD |
6701 | Get the application's vendor name. |
6702 | """ | |
54f9ee45 | 6703 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
6704 | |
6705 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 6706 | """ |
a95a7133 | 6707 | SetVendorName(self, String name) |
6c3b4aae | 6708 | |
66c033b4 RD |
6709 | Set the application's vendor name. This value may be used |
6710 | automatically by `wx.Config` and such. | |
0df68c9f | 6711 | """ |
54f9ee45 | 6712 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
6713 | |
6714 | def GetTraits(*args, **kwargs): | |
0df68c9f | 6715 | """ |
a95a7133 | 6716 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 6717 | |
66c033b4 RD |
6718 | Return (and create if necessary) the app traits object to which we |
6719 | delegate for everything which either should be configurable by the | |
6720 | user (then he can change the default behaviour simply by overriding | |
6721 | CreateTraits() and returning his own traits object) or which is | |
6722 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6723 | differences behind the common facade. | |
6724 | ||
6725 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 6726 | """ |
54f9ee45 | 6727 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
6728 | |
6729 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 6730 | """ |
a95a7133 | 6731 | ProcessPendingEvents(self) |
6c3b4aae | 6732 | |
66c033b4 RD |
6733 | Process all events in the Pending Events list -- it is necessary to |
6734 | call this function to process posted events. This normally happens | |
6735 | during each event loop iteration. | |
0df68c9f | 6736 | """ |
54f9ee45 | 6737 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
6738 | |
6739 | def Yield(*args, **kwargs): | |
0df68c9f | 6740 | """ |
a95a7133 | 6741 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6742 | |
66c033b4 RD |
6743 | Process all currently pending events right now, instead of waiting |
6744 | until return to the event loop. It is an error to call ``Yield`` | |
6745 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 6746 | |
66c033b4 | 6747 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
6748 | reentrancies (i.e. when called from an event handler it may |
6749 | result in calling the same event handler again), use with | |
6750 | extreme care or, better, don't use at all! | |
0df68c9f | 6751 | |
66c033b4 | 6752 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 6753 | |
0df68c9f | 6754 | """ |
54f9ee45 | 6755 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
6756 | |
6757 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 6758 | """ |
a95a7133 | 6759 | WakeUpIdle(self) |
6c3b4aae | 6760 | |
66c033b4 RD |
6761 | Make sure that idle events are sent again. |
6762 | :see: `wx.WakeUpIdle` | |
0df68c9f | 6763 | """ |
54f9ee45 | 6764 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 6765 | |
1fc3b23a RD |
6766 | def IsMainLoopRunning(*args, **kwargs): |
6767 | """ | |
6768 | IsMainLoopRunning() -> bool | |
6769 | ||
6770 | Returns True if we're running the main loop, i.e. if the events can | |
6771 | currently be dispatched. | |
6772 | """ | |
6773 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
6774 | ||
6775 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 6776 | def MainLoop(*args, **kwargs): |
0df68c9f | 6777 | """ |
a95a7133 | 6778 | MainLoop(self) -> int |
6c3b4aae | 6779 | |
66c033b4 RD |
6780 | Execute the main GUI loop, the function doesn't normally return until |
6781 | all top level windows have been closed and destroyed. | |
0df68c9f | 6782 | """ |
54f9ee45 | 6783 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
6784 | |
6785 | def Exit(*args, **kwargs): | |
0df68c9f | 6786 | """ |
a95a7133 | 6787 | Exit(self) |
6c3b4aae | 6788 | |
0df68c9f | 6789 | Exit the main loop thus terminating the application. |
66c033b4 | 6790 | :see: `wx.Exit` |
0df68c9f | 6791 | """ |
54f9ee45 | 6792 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce | 6793 | |
97ab0f6a RD |
6794 | def GetLayoutDirection(*args, **kwargs): |
6795 | """ | |
994453b8 | 6796 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
6797 | |
6798 | Return the layout direction for the current locale. | |
6799 | """ | |
6800 | return _core_.PyApp_GetLayoutDirection(*args, **kwargs) | |
6801 | ||
e811c8ce | 6802 | def ExitMainLoop(*args, **kwargs): |
0df68c9f | 6803 | """ |
a95a7133 | 6804 | ExitMainLoop(self) |
6c3b4aae | 6805 | |
66c033b4 RD |
6806 | Exit the main GUI loop during the next iteration of the main |
6807 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 6808 | """ |
54f9ee45 | 6809 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
6810 | |
6811 | def Pending(*args, **kwargs): | |
0df68c9f | 6812 | """ |
a95a7133 | 6813 | Pending(self) -> bool |
6c3b4aae | 6814 | |
0df68c9f RD |
6815 | Returns True if there are unprocessed events in the event queue. |
6816 | """ | |
54f9ee45 | 6817 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
6818 | |
6819 | def Dispatch(*args, **kwargs): | |
0df68c9f | 6820 | """ |
a95a7133 | 6821 | Dispatch(self) -> bool |
6c3b4aae | 6822 | |
0df68c9f RD |
6823 | Process the first event in the event queue (blocks until an event |
6824 | appears if there are none currently) | |
6825 | """ | |
54f9ee45 | 6826 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
6827 | |
6828 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 6829 | """ |
a95a7133 | 6830 | ProcessIdle(self) -> bool |
6c3b4aae | 6831 | |
66c033b4 RD |
6832 | Called from the MainLoop when the application becomes idle (there are |
6833 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6834 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 6835 | """ |
54f9ee45 | 6836 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
6837 | |
6838 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 6839 | """ |
a95a7133 | 6840 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 6841 | |
66c033b4 RD |
6842 | Send idle event to window and all subwindows. Returns True if more |
6843 | idle time is requested. | |
0df68c9f | 6844 | """ |
54f9ee45 | 6845 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
6846 | |
6847 | def IsActive(*args, **kwargs): | |
0df68c9f | 6848 | """ |
a95a7133 | 6849 | IsActive(self) -> bool |
6c3b4aae | 6850 | |
0df68c9f RD |
6851 | Return True if our app has focus. |
6852 | """ | |
54f9ee45 | 6853 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
6854 | |
6855 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 6856 | """ |
a95a7133 | 6857 | SetTopWindow(self, Window win) |
6c3b4aae | 6858 | |
66c033b4 | 6859 | Set the *main* top level window |
0df68c9f | 6860 | """ |
54f9ee45 | 6861 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
6862 | |
6863 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 6864 | """ |
a95a7133 | 6865 | GetTopWindow(self) -> Window |
6c3b4aae | 6866 | |
66c033b4 RD |
6867 | Return the *main* top level window (if it hadn't been set previously |
6868 | with SetTopWindow(), will return just some top level window and, if | |
6869 | there not any, will return None) | |
0df68c9f | 6870 | """ |
54f9ee45 | 6871 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
6872 | |
6873 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6874 | """ |
a95a7133 | 6875 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 6876 | |
66c033b4 RD |
6877 | Control the exit behaviour: by default, the program will exit the main |
6878 | loop (and so, usually, terminate) when the last top-level program | |
6879 | window is deleted. Beware that if you disable this behaviour (with | |
6880 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
6881 | explicitly from somewhere. | |
0df68c9f | 6882 | """ |
54f9ee45 | 6883 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6884 | |
6885 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6886 | """ |
a95a7133 | 6887 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 6888 | |
0df68c9f RD |
6889 | Get the current exit behaviour setting. |
6890 | """ | |
54f9ee45 | 6891 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6892 | |
6893 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6894 | """ |
a95a7133 | 6895 | SetUseBestVisual(self, bool flag) |
6c3b4aae | 6896 | |
66c033b4 RD |
6897 | Set whether the app should try to use the best available visual on |
6898 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 6899 | """ |
54f9ee45 | 6900 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6901 | |
6902 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6903 | """ |
a95a7133 | 6904 | GetUseBestVisual(self) -> bool |
6c3b4aae | 6905 | |
0df68c9f RD |
6906 | Get current UseBestVisual setting. |
6907 | """ | |
54f9ee45 | 6908 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6909 | |
6910 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 6911 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 6912 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
6913 | |
6914 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 6915 | """GetPrintMode(self) -> int""" |
54f9ee45 | 6916 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 6917 | |
e811c8ce | 6918 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 6919 | """ |
a95a7133 | 6920 | SetAssertMode(self, int mode) |
6c3b4aae | 6921 | |
41e2b43e | 6922 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 6923 | """ |
54f9ee45 | 6924 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 6925 | |
6c3b4aae | 6926 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 6927 | """ |
a95a7133 | 6928 | GetAssertMode(self) -> int |
6c3b4aae | 6929 | |
0df68c9f RD |
6930 | Get the current OnAssert behaviour setting. |
6931 | """ | |
54f9ee45 | 6932 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 6933 | |
e811c8ce | 6934 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 6935 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 6936 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6937 | |
6938 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
6939 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6940 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 6941 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6942 | |
6943 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
6944 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6945 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 6946 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6947 | |
6948 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
6949 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6950 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 6951 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6952 | |
6953 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
6954 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6955 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 6956 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6957 | |
6958 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
6959 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 6960 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 6961 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6962 | |
6963 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
6964 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6965 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 6966 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6967 | |
6968 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
6969 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6970 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 6971 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6972 | |
6973 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
6974 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6975 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 6976 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6977 | |
6978 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
6979 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6980 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 6981 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6982 | |
6983 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
6984 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 6985 | """ |
a95a7133 | 6986 | _BootstrapApp(self) |
6c3b4aae | 6987 | |
0df68c9f RD |
6988 | For internal use only |
6989 | """ | |
54f9ee45 | 6990 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
6991 | |
6992 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 6993 | """ |
66c033b4 | 6994 | GetComCtl32Version() -> int |
6c3b4aae | 6995 | |
66c033b4 RD |
6996 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6997 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 6998 | """ |
54f9ee45 | 6999 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
7000 | |
7001 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
33d6fd3b | 7002 | def IsDisplayAvailable(*args, **kwargs): |
fc46b7f3 | 7003 | """ |
33d6fd3b | 7004 | IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7005 | |
7006 | Tests if it is possible to create a GUI in the current environment. | |
7007 | This will mean different things on the different platforms. | |
7008 | ||
7009 | * On X Windows systems this function will return ``False`` if it is | |
7010 | not able to open a connection to the X display, which can happen | |
7011 | if $DISPLAY is not set, or is not set correctly. | |
7012 | ||
7013 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7014 | able to access the window manager, which can happen if logged in | |
7015 | remotely or if running from the normal version of python instead | |
7016 | of the framework version, (i.e., pythonw.) | |
7017 | ||
7018 | * On MS Windows... | |
7019 | ||
7020 | """ | |
33d6fd3b RD |
7021 | return _core_.PyApp_IsDisplayAvailable(*args, **kwargs) |
7022 | ||
7023 | IsDisplayAvailable = staticmethod(IsDisplayAvailable) | |
7024 | AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`") | |
7025 | AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`") | |
7026 | ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`") | |
7027 | ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`") | |
7028 | LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`") | |
7029 | PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`") | |
7030 | TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`") | |
7031 | Traits = property(GetTraits,doc="See `GetTraits`") | |
7032 | UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`") | |
7033 | VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`") | |
7034 | Active = property(IsActive) | |
2131d850 | 7035 | _core_.PyApp_swigregister(PyApp) |
d14a1e28 | 7036 | |
0085ce49 RD |
7037 | def PyApp_IsMainLoopRunning(*args): |
7038 | """ | |
1fc3b23a RD |
7039 | PyApp_IsMainLoopRunning() -> bool |
7040 | ||
7041 | Returns True if we're running the main loop, i.e. if the events can | |
7042 | currently be dispatched. | |
7043 | """ | |
0085ce49 | 7044 | return _core_.PyApp_IsMainLoopRunning(*args) |
1fc3b23a | 7045 | |
0085ce49 RD |
7046 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
7047 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7048 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d14a1e28 | 7049 | |
0085ce49 RD |
7050 | def PyApp_GetMacAboutMenuItemId(*args): |
7051 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7052 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d14a1e28 | 7053 | |
0085ce49 RD |
7054 | def PyApp_GetMacPreferencesMenuItemId(*args): |
7055 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7056 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d14a1e28 | 7057 | |
0085ce49 RD |
7058 | def PyApp_GetMacExitMenuItemId(*args): |
7059 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7060 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d14a1e28 | 7061 | |
0085ce49 RD |
7062 | def PyApp_GetMacHelpMenuTitleName(*args): |
7063 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7064 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d14a1e28 | 7065 | |
e811c8ce | 7066 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
0085ce49 RD |
7067 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
7068 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d14a1e28 | 7069 | |
e811c8ce | 7070 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
0085ce49 RD |
7071 | """PyApp_SetMacAboutMenuItemId(long val)""" |
7072 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d14a1e28 | 7073 | |
e811c8ce | 7074 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
0085ce49 RD |
7075 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
7076 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d14a1e28 | 7077 | |
e811c8ce | 7078 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
0085ce49 RD |
7079 | """PyApp_SetMacExitMenuItemId(long val)""" |
7080 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d14a1e28 | 7081 | |
e811c8ce | 7082 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
0085ce49 RD |
7083 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
7084 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d14a1e28 | 7085 | |
0085ce49 RD |
7086 | def PyApp_GetComCtl32Version(*args): |
7087 | """ | |
0df68c9f | 7088 | PyApp_GetComCtl32Version() -> int |
6c3b4aae | 7089 | |
66c033b4 RD |
7090 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7091 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7092 | """ |
0085ce49 | 7093 | return _core_.PyApp_GetComCtl32Version(*args) |
d14a1e28 | 7094 | |
33d6fd3b | 7095 | def PyApp_IsDisplayAvailable(*args): |
fc46b7f3 | 7096 | """ |
33d6fd3b | 7097 | PyApp_IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7098 | |
7099 | Tests if it is possible to create a GUI in the current environment. | |
7100 | This will mean different things on the different platforms. | |
7101 | ||
7102 | * On X Windows systems this function will return ``False`` if it is | |
7103 | not able to open a connection to the X display, which can happen | |
7104 | if $DISPLAY is not set, or is not set correctly. | |
7105 | ||
7106 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7107 | able to access the window manager, which can happen if logged in | |
7108 | remotely or if running from the normal version of python instead | |
7109 | of the framework version, (i.e., pythonw.) | |
7110 | ||
7111 | * On MS Windows... | |
7112 | ||
7113 | """ | |
33d6fd3b | 7114 | return _core_.PyApp_IsDisplayAvailable(*args) |
fc46b7f3 | 7115 | |
d14a1e28 RD |
7116 | #--------------------------------------------------------------------------- |
7117 | ||
7118 | ||
0085ce49 RD |
7119 | def Exit(*args): |
7120 | """ | |
0df68c9f | 7121 | Exit() |
6c3b4aae | 7122 | |
0df68c9f RD |
7123 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
7124 | """ | |
0085ce49 | 7125 | return _core_.Exit(*args) |
d14a1e28 | 7126 | |
0085ce49 RD |
7127 | def Yield(*args): |
7128 | """ | |
0df68c9f | 7129 | Yield() -> bool |
6c3b4aae | 7130 | |
0df68c9f RD |
7131 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
7132 | """ | |
0085ce49 | 7133 | return _core_.Yield(*args) |
d14a1e28 | 7134 | |
0085ce49 RD |
7135 | def YieldIfNeeded(*args): |
7136 | """ | |
0df68c9f | 7137 | YieldIfNeeded() -> bool |
6c3b4aae | 7138 | |
0df68c9f RD |
7139 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
7140 | """ | |
0085ce49 | 7141 | return _core_.YieldIfNeeded(*args) |
d14a1e28 | 7142 | |
e811c8ce | 7143 | def SafeYield(*args, **kwargs): |
0085ce49 | 7144 | """ |
0df68c9f | 7145 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 7146 | |
66c033b4 RD |
7147 | This function is similar to `wx.Yield`, except that it disables the |
7148 | user input to all program windows before calling `wx.Yield` and | |
7149 | re-enables it again afterwards. If ``win`` is not None, this window | |
7150 | will remain enabled, allowing the implementation of some limited user | |
7151 | interaction. | |
6c3b4aae | 7152 | |
66c033b4 | 7153 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 7154 | """ |
0085ce49 | 7155 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 7156 | |
0085ce49 RD |
7157 | def WakeUpIdle(*args): |
7158 | """ | |
0df68c9f | 7159 | WakeUpIdle() |
6c3b4aae | 7160 | |
66c033b4 RD |
7161 | Cause the message queue to become empty again, so idle events will be |
7162 | sent. | |
0df68c9f | 7163 | """ |
0085ce49 | 7164 | return _core_.WakeUpIdle(*args) |
d14a1e28 | 7165 | |
e811c8ce | 7166 | def PostEvent(*args, **kwargs): |
0085ce49 | 7167 | """ |
0df68c9f | 7168 | PostEvent(EvtHandler dest, Event event) |
6c3b4aae | 7169 | |
66c033b4 RD |
7170 | Send an event to a window or other wx.EvtHandler to be processed |
7171 | later. | |
0df68c9f | 7172 | """ |
0085ce49 | 7173 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 7174 | |
0085ce49 RD |
7175 | def App_CleanUp(*args): |
7176 | """ | |
0df68c9f | 7177 | App_CleanUp() |
6c3b4aae | 7178 | |
41e2b43e | 7179 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 7180 | Python shuts down. |
0df68c9f | 7181 | """ |
0085ce49 | 7182 | return _core_.App_CleanUp(*args) |
d14a1e28 | 7183 | |
0085ce49 RD |
7184 | def GetApp(*args): |
7185 | """ | |
0df68c9f | 7186 | GetApp() -> PyApp |
6c3b4aae | 7187 | |
196addbf | 7188 | Return a reference to the current wx.App object. |
0df68c9f | 7189 | """ |
0085ce49 | 7190 | return _core_.GetApp(*args) |
5cbf236d RD |
7191 | |
7192 | def SetDefaultPyEncoding(*args, **kwargs): | |
0085ce49 | 7193 | """ |
5cbf236d RD |
7194 | SetDefaultPyEncoding(string encoding) |
7195 | ||
7196 | Sets the encoding that wxPython will use when it needs to convert a | |
7197 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
7198 | |
7199 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7200 | but please be aware that the default encoding within the same locale | |
7201 | may be slightly different on different platforms. For example, please | |
7202 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7203 | between the common latin/roman encodings. | |
5cbf236d | 7204 | """ |
0085ce49 | 7205 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7206 | |
0085ce49 RD |
7207 | def GetDefaultPyEncoding(*args): |
7208 | """ | |
5cbf236d RD |
7209 | GetDefaultPyEncoding() -> string |
7210 | ||
7211 | Gets the current encoding that wxPython will use when it needs to | |
7212 | convert a Python string or unicode object to or from a wxString. | |
7213 | """ | |
0085ce49 | 7214 | return _core_.GetDefaultPyEncoding(*args) |
d14a1e28 RD |
7215 | #---------------------------------------------------------------------- |
7216 | ||
7217 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
7218 | """ |
7219 | A class that can be used for redirecting Python's stdout and | |
7220 | stderr streams. It will do nothing until something is wrriten to | |
7221 | the stream at which point it will create a Frame with a text area | |
7222 | and write the text there. | |
7223 | """ | |
d14a1e28 RD |
7224 | def __init__(self, title = "wxPython: stdout/stderr"): |
7225 | self.frame = None | |
7226 | self.title = title | |
412d302d RD |
7227 | self.pos = wx.DefaultPosition |
7228 | self.size = (450, 300) | |
d14a1e28 RD |
7229 | self.parent = None |
7230 | ||
7231 | def SetParent(self, parent): | |
6c3b4aae | 7232 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
7233 | self.parent = parent |
7234 | ||
6c3b4aae RD |
7235 | |
7236 | def CreateOutputWindow(self, st): | |
412d302d RD |
7237 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7238 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 7239 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7240 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 7241 | self.text.AppendText(st) |
6c3b4aae | 7242 | self.frame.Show(True) |
2131d850 | 7243 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
6c3b4aae | 7244 | |
d14a1e28 | 7245 | |
7409c0c6 RD |
7246 | def OnCloseWindow(self, event): |
7247 | if self.frame is not None: | |
7248 | self.frame.Destroy() | |
7249 | self.frame = None | |
7250 | self.text = None | |
7251 | ||
7252 | ||
d14a1e28 | 7253 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
7254 | def write(self, text): |
7255 | """ | |
7256 | Create the output window if needed and write the string to it. | |
7257 | If not called in the context of the gui thread then uses | |
7258 | CallAfter to do the work there. | |
7259 | """ | |
7260 | if self.frame is None: | |
7261 | if not wx.Thread_IsMain(): | |
7262 | wx.CallAfter(self.CreateOutputWindow, text) | |
7263 | else: | |
7264 | self.CreateOutputWindow(text) | |
7265 | else: | |
7266 | if not wx.Thread_IsMain(): | |
7267 | wx.CallAfter(self.text.AppendText, text) | |
7268 | else: | |
7269 | self.text.AppendText(text) | |
7270 | ||
d14a1e28 RD |
7271 | |
7272 | def close(self): | |
6c3b4aae RD |
7273 | if self.frame is not None: |
7274 | wx.CallAfter(self.frame.Close) | |
7275 | ||
d14a1e28 | 7276 | |
19272049 RD |
7277 | def flush(self): |
7278 | pass | |
7279 | ||
7280 | ||
d14a1e28 RD |
7281 | |
7282 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
7283 | |
7284 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
fc46b7f3 | 7285 | |
d14a1e28 | 7286 | class App(wx.PyApp): |
6c3b4aae | 7287 | """ |
66c033b4 RD |
7288 | The ``wx.App`` class represents the application and is used to: |
7289 | ||
7290 | * bootstrap the wxPython system and initialize the underlying | |
7291 | gui toolkit | |
7292 | * set and get application-wide properties | |
7293 | * implement the windowing system main message or event loop, | |
7294 | and to dispatch events to window instances | |
7295 | * etc. | |
7296 | ||
7297 | Every application must have a ``wx.App`` instance, and all | |
7298 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
7299 | ``wx.App`` object has been created in order to ensure that the gui |
7300 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7301 | |
7302 | Normally you would derive from this class and implement an | |
7303 | ``OnInit`` method that creates a frame and then calls | |
7304 | ``self.SetTopWindow(frame)``. | |
7305 | ||
03e37cd5 | 7306 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7307 | directly. |
6c3b4aae | 7308 | """ |
66c033b4 | 7309 | |
d14a1e28 RD |
7310 | outputWindowClass = PyOnDemandOutputWindow |
7311 | ||
03e37cd5 RD |
7312 | def __init__(self, redirect=_defRedirect, filename=None, |
7313 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7314 | """ |
7315 | Construct a ``wx.App`` object. | |
7316 | ||
03e37cd5 RD |
7317 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7318 | redirected? Defaults to True on Windows and Mac, False | |
7319 | otherwise. If `filename` is None then output will be | |
7320 | redirected to a window that pops up as needed. (You can | |
7321 | control what kind of window is created for the output by | |
7322 | resetting the class variable ``outputWindowClass`` to a | |
7323 | class of your choosing.) | |
66c033b4 | 7324 | |
03e37cd5 RD |
7325 | :param filename: The name of a file to redirect output to, if |
7326 | redirect is True. | |
66c033b4 RD |
7327 | |
7328 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7329 | available visual provided by the system (only relevant on |
7330 | systems that have more than one visual.) This parameter | |
7331 | must be used instead of calling `SetUseBestVisual` later | |
7332 | on because it must be set before the underlying GUI | |
7333 | toolkit is initialized. | |
7334 | ||
7335 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7336 | app to terminate upon a Ctrl-C in the console like other | |
7337 | GUI apps will. | |
66c033b4 RD |
7338 | |
7339 | :note: You should override OnInit to do applicaition | |
7340 | initialization to ensure that the system, toolkit and | |
7341 | wxWidgets are fully initialized. | |
7342 | """ | |
fc46b7f3 | 7343 | |
d14a1e28 RD |
7344 | wx.PyApp.__init__(self) |
7345 | ||
fc46b7f3 | 7346 | # make sure we can create a GUI |
33d6fd3b | 7347 | if not self.IsDisplayAvailable(): |
fc46b7f3 RD |
7348 | |
7349 | if wx.Platform == "__WXMAC__": | |
7350 | msg = """This program needs access to the screen. | |
7351 | Please run with 'pythonw', not 'python', and only when you are logged | |
7352 | in on the main display of your Mac.""" | |
7353 | ||
7354 | elif wx.Platform == "__WXGTK__": | |
7355 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
d14a1e28 | 7356 | |
fc46b7f3 RD |
7357 | else: |
7358 | msg = "Unable to create GUI" | |
7359 | # TODO: more description is needed for wxMSW... | |
7360 | ||
7361 | raise SystemExit(msg) | |
7362 | ||
d14a1e28 RD |
7363 | # This has to be done before OnInit |
7364 | self.SetUseBestVisual(useBestVisual) | |
7365 | ||
7366 | # Set the default handler for SIGINT. This fixes a problem | |
7367 | # where if Ctrl-C is pressed in the console that started this | |
7368 | # app then it will not appear to do anything, (not even send | |
7369 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7370 | # setting the default handler then the app will exit, as | |
7371 | # expected (depending on platform.) | |
03e37cd5 RD |
7372 | if clearSigInt: |
7373 | try: | |
7374 | import signal | |
7375 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7376 | except: | |
7377 | pass | |
d14a1e28 RD |
7378 | |
7379 | # Save and redirect the stdio to a window? | |
7380 | self.stdioWin = None | |
7381 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7382 | if redirect: | |
7383 | self.RedirectStdio(filename) | |
7384 | ||
8fb0e70a RD |
7385 | # Use Python's install prefix as the default |
7386 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7387 | ||
d14a1e28 RD |
7388 | # This finishes the initialization of wxWindows and then calls |
7389 | # the OnInit that should be present in the derived class | |
7390 | self._BootstrapApp() | |
7391 | ||
7392 | ||
01f6b6d3 RD |
7393 | def OnPreInit(self): |
7394 | """ | |
7395 | Things that must be done after _BootstrapApp has done its | |
7396 | thing, but would be nice if they were already done by the time | |
7397 | that OnInit is called. | |
7398 | """ | |
7399 | wx.StockGDI._initStockObjects() | |
7400 | ||
7401 | ||
02b455f2 RD |
7402 | def __del__(self, destroy=wx.PyApp.__del__): |
7403 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7404 | destroy(self) | |
d14a1e28 | 7405 | |
70b7a5fe RD |
7406 | def Destroy(self): |
7407 | wx.PyApp.Destroy(self) | |
7408 | self.thisown = 0 | |
d14a1e28 RD |
7409 | |
7410 | def SetTopWindow(self, frame): | |
1e0c8722 | 7411 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7412 | if self.stdioWin: |
7413 | self.stdioWin.SetParent(frame) | |
7414 | wx.PyApp.SetTopWindow(self, frame) | |
7415 | ||
7416 | ||
7417 | def MainLoop(self): | |
1e0c8722 | 7418 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7419 | wx.PyApp.MainLoop(self) |
7420 | self.RestoreStdio() | |
7421 | ||
7422 | ||
7409c0c6 | 7423 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7424 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7425 | if filename: |
7426 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7427 | else: | |
7428 | self.stdioWin = self.outputWindowClass() | |
7429 | _sys.stdout = _sys.stderr = self.stdioWin | |
7430 | ||
7431 | ||
7432 | def RestoreStdio(self): | |
02b455f2 RD |
7433 | try: |
7434 | _sys.stdout, _sys.stderr = self.saveStdio | |
7435 | except: | |
7436 | pass | |
d14a1e28 RD |
7437 | |
7438 | ||
412d302d RD |
7439 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7440 | """ | |
7441 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7442 | the stdio has been redirected. This should be called before |
7443 | any output would cause the output window to be created. | |
412d302d RD |
7444 | """ |
7445 | if self.stdioWin: | |
7446 | if title is not None: | |
7447 | self.stdioWin.title = title | |
7448 | if pos is not None: | |
7449 | self.stdioWin.pos = pos | |
7450 | if size is not None: | |
7451 | self.stdioWin.size = size | |
7452 | ||
7453 | ||
7454 | ||
d14a1e28 | 7455 | |
66c033b4 | 7456 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7457 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7458 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7459 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7460 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7461 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7462 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7463 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7464 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7465 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7466 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7467 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7468 | |
7469 | #---------------------------------------------------------------------------- | |
7470 | ||
7471 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7472 | """ |
7473 | A simple application class. You can just create one of these and | |
7474 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7475 | about OnInit. For example:: |
7476 | ||
7477 | app = wx.PySimpleApp() | |
7478 | frame = wx.Frame(None, title='Hello World') | |
7479 | frame.Show() | |
7480 | app.MainLoop() | |
7481 | ||
7482 | :see: `wx.App` | |
7483 | """ | |
6c3b4aae | 7484 | |
03e37cd5 RD |
7485 | def __init__(self, redirect=False, filename=None, |
7486 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7487 | """ |
7488 | :see: `wx.App.__init__` | |
7489 | """ | |
03e37cd5 | 7490 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7491 | |
d14a1e28 | 7492 | def OnInit(self): |
d14a1e28 RD |
7493 | return True |
7494 | ||
7495 | ||
66c033b4 | 7496 | |
6c3b4aae | 7497 | # Is anybody using this one? |
d14a1e28 RD |
7498 | class PyWidgetTester(wx.App): |
7499 | def __init__(self, size = (250, 100)): | |
7500 | self.size = size | |
7501 | wx.App.__init__(self, 0) | |
7502 | ||
7503 | def OnInit(self): | |
196addbf | 7504 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7505 | self.SetTopWindow(self.frame) |
7506 | return True | |
7507 | ||
66c033b4 RD |
7508 | def SetWidget(self, widgetClass, *args, **kwargs): |
7509 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7510 | self.frame.Show(True) |
7511 | ||
7512 | #---------------------------------------------------------------------------- | |
7513 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7514 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7515 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7516 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7517 | |
7518 | class __wxPyCleanup: | |
7519 | def __init__(self): | |
54f9ee45 | 7520 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7521 | def __del__(self): |
7522 | self.cleanup() | |
7523 | ||
7524 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7525 | ||
7526 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7527 | ## import atexit |
7528 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7529 | |
7530 | ||
7531 | #---------------------------------------------------------------------------- | |
7532 | ||
7533 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7534 | |
7535 | class EventLoop(object): | |
093d3ff1 | 7536 | """Proxy of C++ EventLoop class""" |
0085ce49 RD |
7537 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7538 | __repr__ = _swig_repr | |
7539 | def __init__(self, *args, **kwargs): | |
2ef75293 | 7540 | """__init__(self) -> EventLoop""" |
0085ce49 RD |
7541 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
7542 | __swig_destroy__ = _core_.delete_EventLoop | |
7543 | __del__ = lambda self : None; | |
2ef75293 RD |
7544 | def Run(*args, **kwargs): |
7545 | """Run(self) -> int""" | |
7546 | return _core_.EventLoop_Run(*args, **kwargs) | |
7547 | ||
7548 | def Exit(*args, **kwargs): | |
7549 | """Exit(self, int rc=0)""" | |
7550 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7551 | ||
7552 | def Pending(*args, **kwargs): | |
7553 | """Pending(self) -> bool""" | |
7554 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7555 | ||
7556 | def Dispatch(*args, **kwargs): | |
7557 | """Dispatch(self) -> bool""" | |
7558 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7559 | ||
7560 | def IsRunning(*args, **kwargs): | |
7561 | """IsRunning(self) -> bool""" | |
7562 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7563 | ||
7564 | def GetActive(*args, **kwargs): | |
7565 | """GetActive() -> EventLoop""" | |
7566 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7567 | ||
7568 | GetActive = staticmethod(GetActive) | |
7569 | def SetActive(*args, **kwargs): | |
7570 | """SetActive(EventLoop loop)""" | |
7571 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7572 | ||
7573 | SetActive = staticmethod(SetActive) | |
2131d850 | 7574 | _core_.EventLoop_swigregister(EventLoop) |
2ef75293 | 7575 | |
0085ce49 RD |
7576 | def EventLoop_GetActive(*args): |
7577 | """EventLoop_GetActive() -> EventLoop""" | |
7578 | return _core_.EventLoop_GetActive(*args) | |
2ef75293 RD |
7579 | |
7580 | def EventLoop_SetActive(*args, **kwargs): | |
0085ce49 RD |
7581 | """EventLoop_SetActive(EventLoop loop)""" |
7582 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
2ef75293 | 7583 | |
091f5bed RD |
7584 | class EventLoopActivator(object): |
7585 | """Proxy of C++ EventLoopActivator class""" | |
0085ce49 RD |
7586 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7587 | __repr__ = _swig_repr | |
7588 | def __init__(self, *args, **kwargs): | |
091f5bed | 7589 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
0085ce49 RD |
7590 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
7591 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7592 | __del__ = lambda self : None; | |
2131d850 | 7593 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
091f5bed | 7594 | |
2ef75293 | 7595 | #--------------------------------------------------------------------------- |
d14a1e28 | 7596 | |
eec1c382 RD |
7597 | ACCEL_ALT = _core_.ACCEL_ALT |
7598 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
7599 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
7600 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
7601 | ACCEL_CMD = _core_.ACCEL_CMD | |
1e0c8722 | 7602 | class AcceleratorEntry(object): |
66c033b4 RD |
7603 | """ |
7604 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7605 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7606 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 7607 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
7608 | |
7609 | :see: `wx.AcceleratorTable` | |
7610 | """ | |
0085ce49 RD |
7611 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7612 | __repr__ = _swig_repr | |
7613 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
7614 | """ |
7615 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7616 | ||
7617 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 7618 | """ |
0085ce49 RD |
7619 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
7620 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
7621 | __del__ = lambda self : None; | |
1e0c8722 | 7622 | def Set(*args, **kwargs): |
66c033b4 RD |
7623 | """ |
7624 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 7625 | |
66c033b4 RD |
7626 | (Re)set the attributes of a wx.AcceleratorEntry. |
7627 | :see `__init__` | |
7628 | """ | |
7629 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 | 7630 | |
97ab0f6a RD |
7631 | def Create(*args, **kwargs): |
7632 | """ | |
7633 | Create(String str) -> AcceleratorEntry | |
7634 | ||
7635 | Create accelerator corresponding to the specified string, or None if | |
7636 | it coulnd't be parsed. | |
7637 | """ | |
7638 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
7639 | ||
7640 | Create = staticmethod(Create) | |
1e0c8722 | 7641 | def GetFlags(*args, **kwargs): |
66c033b4 RD |
7642 | """ |
7643 | GetFlags(self) -> int | |
7644 | ||
7645 | Get the AcceleratorEntry's flags. | |
7646 | """ | |
54f9ee45 | 7647 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
7648 | |
7649 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
7650 | """ |
7651 | GetKeyCode(self) -> int | |
7652 | ||
7653 | Get the AcceleratorEntry's keycode. | |
7654 | """ | |
54f9ee45 | 7655 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
7656 | |
7657 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
7658 | """ |
7659 | GetCommand(self) -> int | |
7660 | ||
7661 | Get the AcceleratorEntry's command ID. | |
7662 | """ | |
54f9ee45 | 7663 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 | 7664 | |
97ab0f6a RD |
7665 | def IsOk(*args, **kwargs): |
7666 | """IsOk(self) -> bool""" | |
7667 | return _core_.AcceleratorEntry_IsOk(*args, **kwargs) | |
7668 | ||
7669 | def ToString(*args, **kwargs): | |
7670 | """ | |
7671 | ToString(self) -> String | |
7672 | ||
7673 | Returns a string representation for the this accelerator. The string | |
7674 | is formatted using the <flags>-<keycode> format where <flags> maybe a | |
7675 | hyphen-separed list of "shift|alt|ctrl" | |
7676 | ||
7677 | """ | |
7678 | return _core_.AcceleratorEntry_ToString(*args, **kwargs) | |
7679 | ||
7680 | def FromString(*args, **kwargs): | |
7681 | """ | |
7682 | FromString(self, String str) -> bool | |
7683 | ||
7684 | Returns true if the given string correctly initialized this object. | |
7685 | """ | |
7686 | return _core_.AcceleratorEntry_FromString(*args, **kwargs) | |
7687 | ||
2bf58437 RD |
7688 | Command = property(GetCommand,doc="See `GetCommand`") |
7689 | Flags = property(GetFlags,doc="See `GetFlags`") | |
7690 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
2131d850 | 7691 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
1e0c8722 | 7692 | |
97ab0f6a RD |
7693 | def AcceleratorEntry_Create(*args, **kwargs): |
7694 | """ | |
7695 | AcceleratorEntry_Create(String str) -> AcceleratorEntry | |
7696 | ||
7697 | Create accelerator corresponding to the specified string, or None if | |
7698 | it coulnd't be parsed. | |
7699 | """ | |
7700 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
7701 | ||
1e0c8722 | 7702 | class AcceleratorTable(Object): |
66c033b4 RD |
7703 | """ |
7704 | An accelerator table allows the application to specify a table of | |
7705 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7706 | button commands are supported; on GTK, only menu commands are | |
7707 | supported. | |
66c033b4 | 7708 | """ |
0085ce49 RD |
7709 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7710 | __repr__ = _swig_repr | |
7711 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
7712 | """ |
7713 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 7714 | |
66c033b4 RD |
7715 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7716 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7717 | ||
7718 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 7719 | """ |
0085ce49 RD |
7720 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
7721 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
7722 | __del__ = lambda self : None; | |
1e0c8722 | 7723 | def Ok(*args, **kwargs): |
a95a7133 | 7724 | """Ok(self) -> bool""" |
54f9ee45 | 7725 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
1e0c8722 | 7726 | |
2131d850 | 7727 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
1e0c8722 RD |
7728 | |
7729 | ||
7730 | def GetAccelFromString(*args, **kwargs): | |
0085ce49 RD |
7731 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
7732 | return _core_.GetAccelFromString(*args, **kwargs) | |
1e0c8722 RD |
7733 | #--------------------------------------------------------------------------- |
7734 | ||
74a57fcd RD |
7735 | class VisualAttributes(object): |
7736 | """struct containing all the visual attributes of a control""" | |
0085ce49 RD |
7737 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7738 | __repr__ = _swig_repr | |
7739 | def __init__(self, *args, **kwargs): | |
74a57fcd | 7740 | """ |
a95a7133 | 7741 | __init__(self) -> VisualAttributes |
74a57fcd RD |
7742 | |
7743 | struct containing all the visual attributes of a control | |
7744 | """ | |
0085ce49 RD |
7745 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
7746 | __swig_destroy__ = _core_.delete_VisualAttributes | |
7747 | __del__ = lambda self : None; | |
54f9ee45 RD |
7748 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7749 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7750 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
2131d850 | 7751 | _core_.VisualAttributes_swigregister(VisualAttributes) |
74a57fcd RD |
7752 | NullAcceleratorTable = cvar.NullAcceleratorTable |
7753 | PanelNameStr = cvar.PanelNameStr | |
7754 | ||
54f9ee45 RD |
7755 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7756 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7757 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7758 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7759 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 7760 | class Window(EvtHandler): |
15afbcd0 RD |
7761 | """ |
7762 | wx.Window is the base class for all windows and represents any visible | |
7763 | object on the screen. All controls, top level windows and so on are | |
7764 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7765 | appear on screen themselves. | |
7766 | ||
7767 | """ | |
0085ce49 RD |
7768 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7769 | __repr__ = _swig_repr | |
7770 | def __init__(self, *args, **kwargs): | |
0df68c9f | 7771 | """ |
a95a7133 | 7772 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7773 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
7774 | |
7775 | Construct and show a generic Window. | |
0df68c9f | 7776 | """ |
0085ce49 | 7777 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d14a1e28 | 7778 | self._setOORInfo(self) |
d14a1e28 | 7779 | |
e811c8ce | 7780 | def Create(*args, **kwargs): |
0df68c9f | 7781 | """ |
a95a7133 | 7782 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7783 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
7784 | |
7785 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 7786 | """ |
54f9ee45 | 7787 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 7788 | |
e811c8ce | 7789 | def Close(*args, **kwargs): |
15afbcd0 | 7790 | """ |
a95a7133 | 7791 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
7792 | |
7793 | This function simply generates a EVT_CLOSE event whose handler usually | |
7794 | tries to close the window. It doesn't close the window itself, | |
7795 | however. If force is False (the default) then the window's close | |
7796 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 7797 | """ |
54f9ee45 | 7798 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 7799 | |
e811c8ce | 7800 | def Destroy(*args, **kwargs): |
0df68c9f | 7801 | """ |
a95a7133 | 7802 | Destroy(self) -> bool |
d14a1e28 | 7803 | |
15afbcd0 RD |
7804 | Destroys the window safely. Frames and dialogs are not destroyed |
7805 | immediately when this function is called -- they are added to a list | |
7806 | of windows to be deleted on idle time, when all the window's events | |
7807 | have been processed. This prevents problems with events being sent to | |
7808 | non-existent windows. | |
7809 | ||
7810 | Returns True if the window has either been successfully deleted, or it | |
7811 | has been added to the list of windows pending real deletion. | |
0df68c9f | 7812 | """ |
7e08d4ef RD |
7813 | val = _core_.Window_Destroy(*args, **kwargs) |
7814 | args[0].thisown = 0 | |
7815 | return val | |
d14a1e28 | 7816 | |
e811c8ce | 7817 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 7818 | """ |
a95a7133 | 7819 | DestroyChildren(self) -> bool |
15afbcd0 | 7820 | |
41e2b43e RD |
7821 | Destroys all children of a window. Called automatically by the |
7822 | destructor. | |
15afbcd0 | 7823 | """ |
54f9ee45 | 7824 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 7825 | |
e811c8ce | 7826 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 7827 | """ |
a95a7133 | 7828 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
7829 | |
7830 | Is the window in the process of being deleted? | |
7831 | """ | |
54f9ee45 | 7832 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 7833 | |
e811c8ce | 7834 | def SetLabel(*args, **kwargs): |
15afbcd0 | 7835 | """ |
a95a7133 | 7836 | SetLabel(self, String label) |
15afbcd0 RD |
7837 | |
7838 | Set the text which the window shows in its label if applicable. | |
7839 | """ | |
54f9ee45 | 7840 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 7841 | |
e811c8ce | 7842 | def GetLabel(*args, **kwargs): |
15afbcd0 | 7843 | """ |
a95a7133 | 7844 | GetLabel(self) -> String |
15afbcd0 | 7845 | |
41e2b43e RD |
7846 | Generic way of getting a label from any window, for identification |
7847 | purposes. The interpretation of this function differs from class to | |
7848 | class. For frames and dialogs, the value returned is the title. For | |
7849 | buttons or static text controls, it is the button text. This function | |
7850 | can be useful for meta-programs such as testing tools or special-needs | |
7851 | access programs)which need to identify windows by name. | |
15afbcd0 | 7852 | """ |
54f9ee45 | 7853 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 7854 | |
e811c8ce | 7855 | def SetName(*args, **kwargs): |
15afbcd0 | 7856 | """ |
a95a7133 | 7857 | SetName(self, String name) |
15afbcd0 | 7858 | |
41e2b43e RD |
7859 | Sets the window's name. The window name is used for ressource setting |
7860 | in X, it is not the same as the window title/label | |
15afbcd0 | 7861 | """ |
54f9ee45 | 7862 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 7863 | |
e811c8ce | 7864 | def GetName(*args, **kwargs): |
15afbcd0 | 7865 | """ |
a95a7133 | 7866 | GetName(self) -> String |
15afbcd0 | 7867 | |
41e2b43e RD |
7868 | Returns the windows name. This name is not guaranteed to be unique; |
7869 | it is up to the programmer to supply an appropriate name in the window | |
7870 | constructor or via wx.Window.SetName. | |
15afbcd0 | 7871 | """ |
54f9ee45 | 7872 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 7873 | |
4276dc52 RD |
7874 | def SetWindowVariant(*args, **kwargs): |
7875 | """ | |
a95a7133 | 7876 | SetWindowVariant(self, int variant) |
4276dc52 | 7877 | |
41e2b43e RD |
7878 | Sets the variant of the window/font size to use for this window, if |
7879 | the platform supports variants, for example, wxMac. | |
4276dc52 | 7880 | """ |
54f9ee45 | 7881 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
7882 | |
7883 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 7884 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 7885 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 7886 | |
e811c8ce | 7887 | def SetId(*args, **kwargs): |
15afbcd0 | 7888 | """ |
a95a7133 | 7889 | SetId(self, int winid) |
15afbcd0 RD |
7890 | |
7891 | Sets the identifier of the window. Each window has an integer | |
7892 | identifier. If the application has not provided one, an identifier | |
7893 | will be generated. Normally, the identifier should be provided on | |
7894 | creation and should not be modified subsequently. | |
7895 | """ | |
54f9ee45 | 7896 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 7897 | |
e811c8ce | 7898 | def GetId(*args, **kwargs): |
15afbcd0 | 7899 | """ |
a95a7133 | 7900 | GetId(self) -> int |
15afbcd0 RD |
7901 | |
7902 | Returns the identifier of the window. Each window has an integer | |
7903 | identifier. If the application has not provided one (or the default Id | |
7904 | -1 is used) then an unique identifier with a negative value will be | |
7905 | generated. | |
7906 | """ | |
54f9ee45 | 7907 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 7908 | |
e811c8ce | 7909 | def NewControlId(*args, **kwargs): |
15afbcd0 | 7910 | """ |
66c033b4 | 7911 | NewControlId() -> int |
15afbcd0 RD |
7912 | |
7913 | Generate a control id for the controls which were not given one. | |
7914 | """ | |
54f9ee45 | 7915 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 7916 | |
e811c8ce RD |
7917 | NewControlId = staticmethod(NewControlId) |
7918 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 7919 | """ |
66c033b4 | 7920 | NextControlId(int winid) -> int |
15afbcd0 RD |
7921 | |
7922 | Get the id of the control following the one with the given | |
41e2b43e | 7923 | autogenerated) id |
15afbcd0 | 7924 | """ |
54f9ee45 | 7925 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 7926 | |
e811c8ce RD |
7927 | NextControlId = staticmethod(NextControlId) |
7928 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 7929 | """ |
66c033b4 | 7930 | PrevControlId(int winid) -> int |
15afbcd0 RD |
7931 | |
7932 | Get the id of the control preceding the one with the given | |
41e2b43e | 7933 | autogenerated) id |
15afbcd0 | 7934 | """ |
54f9ee45 | 7935 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 7936 | |
e811c8ce | 7937 | PrevControlId = staticmethod(PrevControlId) |
97ab0f6a RD |
7938 | def GetLayoutDirection(*args, **kwargs): |
7939 | """ | |
994453b8 | 7940 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
7941 | |
7942 | Get the layout direction (LTR or RTL) for this window. Returns | |
7943 | ``wx.Layout_Default`` if layout direction is not supported. | |
7944 | """ | |
7945 | return _core_.Window_GetLayoutDirection(*args, **kwargs) | |
7946 | ||
7947 | def SetLayoutDirection(*args, **kwargs): | |
7948 | """ | |
994453b8 | 7949 | SetLayoutDirection(self, int dir) |
97ab0f6a RD |
7950 | |
7951 | Set the layout direction (LTR or RTL) for this window. | |
7952 | """ | |
7953 | return _core_.Window_SetLayoutDirection(*args, **kwargs) | |
7954 | ||
7955 | def AdjustForLayoutDirection(*args, **kwargs): | |
7956 | """ | |
7957 | AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int | |
7958 | ||
7959 | Mirror coordinates for RTL layout if this window uses it and if the | |
7960 | mirroring is not done automatically like Win32. | |
7961 | """ | |
7962 | return _core_.Window_AdjustForLayoutDirection(*args, **kwargs) | |
7963 | ||
e811c8ce | 7964 | def SetSize(*args, **kwargs): |
15afbcd0 | 7965 | """ |
a95a7133 | 7966 | SetSize(self, Size size) |
15afbcd0 RD |
7967 | |
7968 | Sets the size of the window in pixels. | |
7969 | """ | |
54f9ee45 | 7970 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 7971 | |
e811c8ce | 7972 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 7973 | """ |
a95a7133 | 7974 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7975 | |
7976 | Sets the position and size of the window in pixels. The sizeFlags | |
7977 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
7978 | equal to -1. |
7979 | ||
7980 | ======================== ====================================== | |
7981 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
7982 | default should be used. | |
7983 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
7984 | -1 values are supplied. | |
7985 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
7986 | interpreted as real dimensions, not | |
7987 | default values. | |
7988 | ======================== ====================================== | |
7989 | ||
15afbcd0 | 7990 | """ |
54f9ee45 | 7991 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 7992 | |
e811c8ce | 7993 | def SetRect(*args, **kwargs): |
15afbcd0 | 7994 | """ |
a95a7133 | 7995 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7996 | |
7997 | Sets the position and size of the window in pixels using a wx.Rect. | |
7998 | """ | |
54f9ee45 | 7999 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 8000 | |
e811c8ce | 8001 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 8002 | """ |
a95a7133 | 8003 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
8004 | |
8005 | Sets the size of the window in pixels. | |
8006 | """ | |
54f9ee45 | 8007 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 8008 | |
e811c8ce | 8009 | def Move(*args, **kwargs): |
15afbcd0 | 8010 | """ |
a95a7133 | 8011 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8012 | |
8013 | Moves the window to the given position. | |
8014 | """ | |
54f9ee45 | 8015 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 8016 | |
e811c8ce RD |
8017 | SetPosition = Move |
8018 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 8019 | """ |
a95a7133 | 8020 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8021 | |
8022 | Moves the window to the given position. | |
8023 | """ | |
54f9ee45 | 8024 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 8025 | |
f8167d6e RD |
8026 | def SetBestFittingSize(*args, **kwargs): |
8027 | """ | |
8028 | SetBestFittingSize(self, Size size=DefaultSize) | |
8029 | ||
8030 | A 'Smart' SetSize that will fill in default size components with the | |
8031 | window's *best size* values. Also set's the minsize for use with sizers. | |
8032 | """ | |
8033 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
8034 | ||
e811c8ce | 8035 | def Raise(*args, **kwargs): |
15afbcd0 | 8036 | """ |
a95a7133 | 8037 | Raise(self) |
15afbcd0 | 8038 | |
943e8dfd RD |
8039 | Raises the window to the top of the window hierarchy. In current |
8040 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 8041 | """ |
54f9ee45 | 8042 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
8043 | |
8044 | def Lower(*args, **kwargs): | |
15afbcd0 | 8045 | """ |
a95a7133 | 8046 | Lower(self) |
15afbcd0 | 8047 | |
943e8dfd RD |
8048 | Lowers the window to the bottom of the window hierarchy. In current |
8049 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 8050 | """ |
54f9ee45 | 8051 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
8052 | |
8053 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 8054 | """ |
a95a7133 | 8055 | SetClientSize(self, Size size) |
15afbcd0 RD |
8056 | |
8057 | This sets the size of the window client area in pixels. Using this | |
8058 | function to size a window tends to be more device-independent than | |
8059 | wx.Window.SetSize, since the application need not worry about what | |
8060 | dimensions the border or title bar have when trying to fit the window | |
8061 | around panel items, for example. | |
8062 | """ | |
54f9ee45 | 8063 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
8064 | |
8065 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 8066 | """ |
a95a7133 | 8067 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
8068 | |
8069 | This sets the size of the window client area in pixels. Using this | |
8070 | function to size a window tends to be more device-independent than | |
8071 | wx.Window.SetSize, since the application need not worry about what | |
8072 | dimensions the border or title bar have when trying to fit the window | |
8073 | around panel items, for example. | |
8074 | """ | |
54f9ee45 | 8075 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
8076 | |
8077 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 8078 | """ |
a95a7133 | 8079 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
8080 | |
8081 | This sets the size of the window client area in pixels. Using this | |
8082 | function to size a window tends to be more device-independent than | |
8083 | wx.Window.SetSize, since the application need not worry about what | |
8084 | dimensions the border or title bar have when trying to fit the window | |
8085 | around panel items, for example. | |
8086 | """ | |
54f9ee45 | 8087 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
8088 | |
8089 | def GetPosition(*args, **kwargs): | |
0df68c9f | 8090 | """ |
a95a7133 | 8091 | GetPosition(self) -> Point |
e811c8ce | 8092 | |
75219dcb RD |
8093 | Get the window's position. Notice that the position is in client |
8094 | coordinates for child windows and screen coordinates for the top level | |
8095 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8096 | kinds of windows. | |
0df68c9f | 8097 | """ |
54f9ee45 | 8098 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
8099 | |
8100 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
8101 | """ |
8102 | GetPositionTuple() -> (x,y) | |
e811c8ce | 8103 | |
75219dcb RD |
8104 | Get the window's position. Notice that the position is in client |
8105 | coordinates for child windows and screen coordinates for the top level | |
8106 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8107 | kinds of windows. | |
0df68c9f | 8108 | """ |
54f9ee45 | 8109 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce | 8110 | |
75219dcb RD |
8111 | def GetScreenPosition(*args, **kwargs): |
8112 | """ | |
8113 | GetScreenPosition(self) -> Point | |
8114 | ||
8115 | Get the position of the window in screen coordinantes. | |
8116 | """ | |
8117 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
8118 | ||
8119 | def GetScreenPositionTuple(*args, **kwargs): | |
8120 | """ | |
8121 | GetScreenPositionTuple() -> (x,y) | |
8122 | ||
8123 | Get the position of the window in screen coordinantes. | |
8124 | """ | |
8125 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
8126 | ||
8127 | def GetScreenRect(*args, **kwargs): | |
8128 | """ | |
8129 | GetScreenRect(self) -> Rect | |
8130 | ||
8131 | Returns the size and position of the window in screen coordinantes as | |
8132 | a `wx.Rect` object. | |
8133 | """ | |
8134 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
8135 | ||
e811c8ce | 8136 | def GetSize(*args, **kwargs): |
0df68c9f | 8137 | """ |
a95a7133 | 8138 | GetSize(self) -> Size |
e811c8ce | 8139 | |
0df68c9f RD |
8140 | Get the window size. |
8141 | """ | |
54f9ee45 | 8142 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
8143 | |
8144 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8145 | """ |
8146 | GetSizeTuple() -> (width, height) | |
e811c8ce | 8147 | |
0df68c9f RD |
8148 | Get the window size. |
8149 | """ | |
54f9ee45 | 8150 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
8151 | |
8152 | def GetRect(*args, **kwargs): | |
15afbcd0 | 8153 | """ |
a95a7133 | 8154 | GetRect(self) -> Rect |
15afbcd0 | 8155 | |
75219dcb | 8156 | Returns the size and position of the window as a `wx.Rect` object. |
15afbcd0 | 8157 | """ |
54f9ee45 | 8158 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
8159 | |
8160 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 8161 | """ |
a95a7133 | 8162 | GetClientSize(self) -> Size |
e811c8ce | 8163 | |
15afbcd0 RD |
8164 | This gets the size of the window's 'client area' in pixels. The client |
8165 | area is the area which may be drawn on by the programmer, excluding | |
8166 | title bar, border, scrollbars, etc. | |
0df68c9f | 8167 | """ |
54f9ee45 | 8168 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
8169 | |
8170 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8171 | """ |
8172 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 8173 | |
15afbcd0 RD |
8174 | This gets the size of the window's 'client area' in pixels. The client |
8175 | area is the area which may be drawn on by the programmer, excluding | |
8176 | title bar, border, scrollbars, etc. | |
0df68c9f | 8177 | """ |
54f9ee45 | 8178 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
8179 | |
8180 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 8181 | """ |
a95a7133 | 8182 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
8183 | |
8184 | Get the origin of the client area of the window relative to the | |
8185 | window's top left corner (the client area may be shifted because of | |
8186 | the borders, scrollbars, other decorations...) | |
8187 | """ | |
54f9ee45 | 8188 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
8189 | |
8190 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 8191 | """ |
a95a7133 | 8192 | GetClientRect(self) -> Rect |
15afbcd0 | 8193 | |
61863841 | 8194 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 8195 | """ |
54f9ee45 | 8196 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
8197 | |
8198 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 8199 | """ |
a95a7133 | 8200 | GetBestSize(self) -> Size |
e811c8ce | 8201 | |
248ed943 | 8202 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8203 | window, if applicable. For example, for a static text control, it will |
8204 | be the minimal size such that the control label is not truncated. For | |
8205 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8206 | this function will be the same as the size the window would have had | |
8207 | after calling Fit. | |
0df68c9f | 8208 | """ |
54f9ee45 | 8209 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
8210 | |
8211 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8212 | """ |
8213 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 8214 | |
248ed943 | 8215 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8216 | window, if applicable. For example, for a static text control, it will |
8217 | be the minimal size such that the control label is not truncated. For | |
8218 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8219 | this function will be the same as the size the window would have had | |
8220 | after calling Fit. | |
0df68c9f | 8221 | """ |
54f9ee45 | 8222 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 8223 | |
dfbb5885 RD |
8224 | def InvalidateBestSize(*args, **kwargs): |
8225 | """ | |
8226 | InvalidateBestSize(self) | |
8227 | ||
8228 | Reset the cached best size value so it will be recalculated the next | |
8229 | time it is needed. | |
8230 | """ | |
8231 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8232 | ||
e2813725 RD |
8233 | def CacheBestSize(*args, **kwargs): |
8234 | """ | |
8235 | CacheBestSize(self, Size size) | |
8236 | ||
8237 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8238 | some properties of the window change.) | |
8239 | """ | |
8240 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8241 | ||
dfbb5885 RD |
8242 | def GetBestFittingSize(*args, **kwargs): |
8243 | """ | |
8244 | GetBestFittingSize(self) -> Size | |
8245 | ||
8246 | This function will merge the window's best size into the window's | |
8247 | minimum size, giving priority to the min size components, and returns | |
8248 | the results. | |
8249 | ||
8250 | """ | |
8251 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
8252 | ||
e811c8ce | 8253 | def GetAdjustedBestSize(*args, **kwargs): |
15afbcd0 | 8254 | """ |
a95a7133 | 8255 | GetAdjustedBestSize(self) -> Size |
15afbcd0 RD |
8256 | |
8257 | This method is similar to GetBestSize, except in one | |
8258 | thing. GetBestSize should return the minimum untruncated size of the | |
8259 | window, while this method will return the largest of BestSize and any | |
8260 | user specified minimum size. ie. it is the minimum size the window | |
8261 | should currently be drawn at, not the minimal size it can possibly | |
8262 | tolerate. | |
8263 | """ | |
54f9ee45 | 8264 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
e811c8ce RD |
8265 | |
8266 | def Center(*args, **kwargs): | |
15afbcd0 | 8267 | """ |
a95a7133 | 8268 | Center(self, int direction=BOTH) |
15afbcd0 RD |
8269 | |
8270 | Centers the window. The parameter specifies the direction for | |
8271 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8272 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8273 | on the entire screen and not on its parent window. If it is a | |
8274 | top-level window and has no parent then it will always be centered | |
8275 | relative to the screen. | |
8276 | """ | |
54f9ee45 | 8277 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
8278 | |
8279 | Centre = Center | |
e811c8ce | 8280 | def CenterOnParent(*args, **kwargs): |
15afbcd0 | 8281 | """ |
a95a7133 | 8282 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
8283 | |
8284 | Center with respect to the the parent window | |
8285 | """ | |
54f9ee45 | 8286 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
8287 | |
8288 | CentreOnParent = CenterOnParent | |
8289 | def Fit(*args, **kwargs): | |
15afbcd0 | 8290 | """ |
a95a7133 | 8291 | Fit(self) |
15afbcd0 RD |
8292 | |
8293 | Sizes the window so that it fits around its subwindows. This function | |
8294 | won't do anything if there are no subwindows and will only really work | |
8295 | correctly if sizers are used for the subwindows layout. Also, if the | |
8296 | window has exactly one subwindow it is better (faster and the result | |
8297 | is more precise as Fit adds some margin to account for fuzziness of | |
8298 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8299 | instead of calling Fit. | |
8300 | """ | |
54f9ee45 | 8301 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
8302 | |
8303 | def FitInside(*args, **kwargs): | |
15afbcd0 | 8304 | """ |
a95a7133 | 8305 | FitInside(self) |
15afbcd0 RD |
8306 | |
8307 | Similar to Fit, but sizes the interior (virtual) size of a | |
8308 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8309 | sizing changes that do not trigger a size event, and/or scrolled | |
8310 | windows without an interior sizer. This function similarly won't do | |
8311 | anything if there are no subwindows. | |
8312 | """ | |
54f9ee45 | 8313 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 8314 | |
f16ab95d | 8315 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 8316 | """ |
a95a7133 | 8317 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 8318 | int incH=-1) |
15afbcd0 RD |
8319 | |
8320 | Allows specification of minimum and maximum window sizes, and window | |
8321 | size increments. If a pair of values is not set (or set to -1), the | |
8322 | default values will be used. If this function is called, the user | |
908b74cd RD |
8323 | will not be able to size the window outside the given bounds (if it is |
8324 | a top-level window.) Sizers will also inspect the minimum window size | |
8325 | and will use that value if set when calculating layout. | |
8326 | ||
8327 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 8328 | """ |
f16ab95d | 8329 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 8330 | |
f16ab95d RD |
8331 | def SetSizeHintsSz(*args, **kwargs): |
8332 | """ | |
8333 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8334 | ||
8335 | Allows specification of minimum and maximum window sizes, and window | |
8336 | size increments. If a pair of values is not set (or set to -1), the | |
8337 | default values will be used. If this function is called, the user | |
8338 | will not be able to size the window outside the given bounds (if it is | |
8339 | a top-level window.) Sizers will also inspect the minimum window size | |
8340 | and will use that value if set when calculating layout. | |
8341 | ||
8342 | The resizing increments are only significant under Motif or Xt. | |
8343 | """ | |
8344 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8345 | ||
8346 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 8347 | """ |
908b74cd | 8348 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
8349 | |
8350 | Allows specification of minimum and maximum virtual window sizes. If a | |
8351 | pair of values is not set (or set to -1), the default values will be | |
8352 | used. If this function is called, the user will not be able to size | |
8353 | the virtual area of the window outside the given bounds. | |
8354 | """ | |
f16ab95d RD |
8355 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8356 | ||
8357 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8358 | """ | |
8359 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8360 | ||
8361 | Allows specification of minimum and maximum virtual window sizes. If a | |
8362 | pair of values is not set (or set to -1), the default values will be | |
8363 | used. If this function is called, the user will not be able to size | |
8364 | the virtual area of the window outside the given bounds. | |
8365 | """ | |
8366 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 8367 | |
908b74cd RD |
8368 | def GetMaxSize(*args, **kwargs): |
8369 | """GetMaxSize(self) -> Size""" | |
8370 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8371 | ||
8372 | def GetMinSize(*args, **kwargs): | |
8373 | """GetMinSize(self) -> Size""" | |
8374 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8375 | ||
8376 | def SetMinSize(*args, **kwargs): | |
8377 | """ | |
8378 | SetMinSize(self, Size minSize) | |
8379 | ||
8380 | A more convenient method than `SetSizeHints` for setting just the | |
8381 | min size. | |
8382 | """ | |
8383 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8384 | ||
8385 | def SetMaxSize(*args, **kwargs): | |
8386 | """ | |
8387 | SetMaxSize(self, Size maxSize) | |
8388 | ||
8389 | A more convenient method than `SetSizeHints` for setting just the | |
8390 | max size. | |
8391 | """ | |
8392 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8393 | ||
e811c8ce | 8394 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8395 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8396 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8397 | |
8398 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8399 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8400 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8401 | |
8402 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8403 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8404 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8405 | |
8406 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8407 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8408 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8409 | |
e811c8ce | 8410 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8411 | """ |
a95a7133 | 8412 | SetVirtualSize(self, Size size) |
e811c8ce | 8413 | |
15afbcd0 RD |
8414 | Set the the virtual size of a window in pixels. For most windows this |
8415 | is just the client area of the window, but for some like scrolled | |
8416 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8417 | """ |
54f9ee45 | 8418 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8419 | |
8420 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8421 | """ |
a95a7133 | 8422 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8423 | |
15afbcd0 RD |
8424 | Set the the virtual size of a window in pixels. For most windows this |
8425 | is just the client area of the window, but for some like scrolled | |
8426 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8427 | """ |
54f9ee45 | 8428 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8429 | |
8430 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8431 | """ |
a95a7133 | 8432 | GetVirtualSize(self) -> Size |
e811c8ce | 8433 | |
15afbcd0 RD |
8434 | Get the the virtual size of the window in pixels. For most windows |
8435 | this is just the client area of the window, but for some like scrolled | |
8436 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8437 | """ |
54f9ee45 | 8438 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8439 | |
8440 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8441 | """ |
8442 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8443 | |
15afbcd0 RD |
8444 | Get the the virtual size of the window in pixels. For most windows |
8445 | this is just the client area of the window, but for some like scrolled | |
8446 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8447 | """ |
54f9ee45 | 8448 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce RD |
8449 | |
8450 | def GetBestVirtualSize(*args, **kwargs): | |
15afbcd0 | 8451 | """ |
a95a7133 | 8452 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8453 | |
8454 | Return the largest of ClientSize and BestSize (as determined by a | |
8455 | sizer, interior children, or other means) | |
8456 | """ | |
54f9ee45 | 8457 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8458 | |
8459 | def Show(*args, **kwargs): | |
15afbcd0 | 8460 | """ |
a95a7133 | 8461 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8462 | |
8463 | Shows or hides the window. You may need to call Raise for a top level | |
8464 | window if you want to bring it to top, although this is not needed if | |
8465 | Show is called immediately after the frame creation. Returns True if | |
8466 | the window has been shown or hidden or False if nothing was done | |
8467 | because it already was in the requested state. | |
8468 | """ | |
54f9ee45 | 8469 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8470 | |
8471 | def Hide(*args, **kwargs): | |
15afbcd0 | 8472 | """ |
a95a7133 | 8473 | Hide(self) -> bool |
15afbcd0 RD |
8474 | |
8475 | Equivalent to calling Show(False). | |
8476 | """ | |
54f9ee45 | 8477 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8478 | |
8479 | def Enable(*args, **kwargs): | |
15afbcd0 | 8480 | """ |
a95a7133 | 8481 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8482 | |
8483 | Enable or disable the window for user input. Note that when a parent | |
8484 | window is disabled, all of its children are disabled as well and they | |
8485 | are reenabled again when the parent is. Returns true if the window | |
8486 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8487 | window had already been in the specified state. | |
8488 | """ | |
54f9ee45 | 8489 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8490 | |
8491 | def Disable(*args, **kwargs): | |
15afbcd0 | 8492 | """ |
a95a7133 | 8493 | Disable(self) -> bool |
15afbcd0 RD |
8494 | |
8495 | Disables the window, same as Enable(false). | |
8496 | """ | |
54f9ee45 | 8497 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8498 | |
8499 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8500 | """ |
a95a7133 | 8501 | IsShown(self) -> bool |
15afbcd0 RD |
8502 | |
8503 | Returns true if the window is shown, false if it has been hidden. | |
8504 | """ | |
54f9ee45 | 8505 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8506 | |
8507 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8508 | """ |
a95a7133 | 8509 | IsEnabled(self) -> bool |
15afbcd0 RD |
8510 | |
8511 | Returns true if the window is enabled for input, false otherwise. | |
8512 | """ | |
54f9ee45 | 8513 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce | 8514 | |
33d6fd3b RD |
8515 | def IsShownOnScreen(*args, **kwargs): |
8516 | """ | |
8517 | IsShownOnScreen(self) -> bool | |
8518 | ||
8519 | Returns ``True`` if the window is physically visible on the screen, | |
8520 | i.e. it is shown and all its parents up to the toplevel window are | |
8521 | shown as well. | |
8522 | """ | |
8523 | return _core_.Window_IsShownOnScreen(*args, **kwargs) | |
8524 | ||
e811c8ce | 8525 | def SetWindowStyleFlag(*args, **kwargs): |
15afbcd0 | 8526 | """ |
a95a7133 | 8527 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 8528 | |
41e2b43e RD |
8529 | Sets the style of the window. Please note that some styles cannot be |
8530 | changed after the window creation and that Refresh() might need to be | |
8531 | called after changing the others for the change to take place | |
8532 | immediately. | |
15afbcd0 | 8533 | """ |
54f9ee45 | 8534 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
8535 | |
8536 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8537 | """ |
a95a7133 | 8538 | GetWindowStyleFlag(self) -> long |
e811c8ce | 8539 | |
15afbcd0 RD |
8540 | Gets the window style that was passed to the constructor or Create |
8541 | method. | |
8542 | """ | |
54f9ee45 | 8543 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 8544 | |
15afbcd0 | 8545 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 8546 | def HasFlag(*args, **kwargs): |
15afbcd0 | 8547 | """ |
a95a7133 | 8548 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
8549 | |
8550 | Test if the given style is set for this window. | |
8551 | """ | |
54f9ee45 | 8552 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
8553 | |
8554 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 8555 | """ |
a95a7133 | 8556 | IsRetained(self) -> bool |
15afbcd0 RD |
8557 | |
8558 | Returns true if the window is retained, false otherwise. Retained | |
8559 | windows are only available on X platforms. | |
8560 | """ | |
54f9ee45 | 8561 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce RD |
8562 | |
8563 | def SetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8564 | """ |
a95a7133 | 8565 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
8566 | |
8567 | Sets the extra style bits for the window. Extra styles are the less | |
8568 | often used style bits which can't be set with the constructor or with | |
8569 | SetWindowStyleFlag() | |
8570 | """ | |
54f9ee45 | 8571 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8572 | |
8573 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8574 | """ |
a95a7133 | 8575 | GetExtraStyle(self) -> long |
15afbcd0 RD |
8576 | |
8577 | Returns the extra style bits for the window. | |
8578 | """ | |
54f9ee45 | 8579 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8580 | |
8581 | def MakeModal(*args, **kwargs): | |
15afbcd0 | 8582 | """ |
a95a7133 | 8583 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
8584 | |
8585 | Disables all other windows in the application so that the user can | |
8586 | only interact with this window. Passing False will reverse this | |
8587 | effect. | |
8588 | """ | |
54f9ee45 | 8589 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
8590 | |
8591 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8592 | """ |
a95a7133 | 8593 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
8594 | |
8595 | This function tells a window if it should use the system's "theme" | |
8596 | code to draw the windows' background instead if its own background | |
8597 | drawing code. This will only have an effect on platforms that support | |
8598 | the notion of themes in user defined windows. One such platform is | |
8599 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8600 | user's selected theme. | |
8601 | ||
8602 | Dialogs, notebook pages and the status bar have this flag set to true | |
8603 | by default so that the default look and feel is simulated best. | |
8604 | """ | |
54f9ee45 | 8605 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8606 | |
8607 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8608 | """ |
a95a7133 | 8609 | GetThemeEnabled(self) -> bool |
e811c8ce | 8610 | |
15afbcd0 RD |
8611 | Return the themeEnabled flag. |
8612 | """ | |
54f9ee45 | 8613 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8614 | |
8615 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 8616 | """ |
a95a7133 | 8617 | SetFocus(self) |
15afbcd0 RD |
8618 | |
8619 | Set's the focus to this window, allowing it to receive keyboard input. | |
8620 | """ | |
54f9ee45 | 8621 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
8622 | |
8623 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 8624 | """ |
a95a7133 | 8625 | SetFocusFromKbd(self) |
15afbcd0 RD |
8626 | |
8627 | Set focus to this window as the result of a keyboard action. Normally | |
8628 | only called internally. | |
8629 | """ | |
54f9ee45 | 8630 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
8631 | |
8632 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 8633 | """ |
66c033b4 | 8634 | FindFocus() -> Window |
15afbcd0 RD |
8635 | |
8636 | Returns the window or control that currently has the keyboard focus, | |
8637 | or None. | |
8638 | """ | |
54f9ee45 | 8639 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
8640 | |
8641 | FindFocus = staticmethod(FindFocus) | |
8642 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 8643 | """ |
a95a7133 | 8644 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
8645 | |
8646 | Can this window have focus? | |
8647 | """ | |
54f9ee45 | 8648 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce RD |
8649 | |
8650 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
15afbcd0 | 8651 | """ |
a95a7133 | 8652 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
8653 | |
8654 | Can this window be given focus by keyboard navigation? if not, the | |
8655 | only way to give it focus (provided it accepts it at all) is to click | |
8656 | it. | |
8657 | """ | |
54f9ee45 | 8658 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce | 8659 | |
908b74cd RD |
8660 | def Navigate(*args, **kwargs): |
8661 | """ | |
8662 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8663 | ||
fd2dc343 RD |
8664 | Does keyboard navigation from this window to another, by sending a |
8665 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8666 | """ |
8667 | return _core_.Window_Navigate(*args, **kwargs) | |
8668 | ||
7f98d120 RD |
8669 | def MoveAfterInTabOrder(*args, **kwargs): |
8670 | """ | |
8671 | MoveAfterInTabOrder(self, Window win) | |
8672 | ||
8673 | Moves this window in the tab navigation order after the specified | |
8674 | sibling window. This means that when the user presses the TAB key on | |
8675 | that other window, the focus switches to this window. | |
8676 | ||
8677 | The default tab order is the same as creation order. This function | |
8678 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8679 | windows. | |
8680 | ||
8681 | """ | |
8682 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8683 | ||
8684 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8685 | """ | |
8686 | MoveBeforeInTabOrder(self, Window win) | |
8687 | ||
8688 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8689 | before win instead of putting it right after it. | |
8690 | """ | |
8691 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8692 | ||
e811c8ce | 8693 | def GetChildren(*args, **kwargs): |
15afbcd0 | 8694 | """ |
a95a7133 | 8695 | GetChildren(self) -> PyObject |
15afbcd0 RD |
8696 | |
8697 | Returns a list of the window's children. NOTE: Currently this is a | |
8698 | copy of the child window list maintained by the window, so the return | |
8699 | value of this function is only valid as long as the window's children | |
8700 | do not change. | |
8701 | """ | |
54f9ee45 | 8702 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
8703 | |
8704 | def GetParent(*args, **kwargs): | |
15afbcd0 | 8705 | """ |
a95a7133 | 8706 | GetParent(self) -> Window |
15afbcd0 RD |
8707 | |
8708 | Returns the parent window of this window, or None if there isn't one. | |
8709 | """ | |
54f9ee45 | 8710 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
8711 | |
8712 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 8713 | """ |
a95a7133 | 8714 | GetGrandParent(self) -> Window |
15afbcd0 | 8715 | |
41e2b43e RD |
8716 | Returns the parent of the parent of this window, or None if there |
8717 | isn't one. | |
15afbcd0 | 8718 | """ |
54f9ee45 | 8719 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce RD |
8720 | |
8721 | def IsTopLevel(*args, **kwargs): | |
15afbcd0 | 8722 | """ |
a95a7133 | 8723 | IsTopLevel(self) -> bool |
15afbcd0 RD |
8724 | |
8725 | Returns true if the given window is a top-level one. Currently all | |
8726 | frames and dialogs are always considered to be top-level windows (even | |
8727 | if they have a parent window). | |
8728 | """ | |
54f9ee45 | 8729 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
8730 | |
8731 | def Reparent(*args, **kwargs): | |
15afbcd0 | 8732 | """ |
a95a7133 | 8733 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
8734 | |
8735 | Reparents the window, i.e the window will be removed from its current | |
8736 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8737 | re-inserted into another. Available on Windows and GTK. Returns True | |
8738 | if the parent was changed, False otherwise (error or newParent == | |
8739 | oldParent) | |
8740 | """ | |
54f9ee45 | 8741 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
8742 | |
8743 | def AddChild(*args, **kwargs): | |
15afbcd0 | 8744 | """ |
a95a7133 | 8745 | AddChild(self, Window child) |
15afbcd0 RD |
8746 | |
8747 | Adds a child window. This is called automatically by window creation | |
8748 | functions so should not be required by the application programmer. | |
8749 | """ | |
54f9ee45 | 8750 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
8751 | |
8752 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 8753 | """ |
a95a7133 | 8754 | RemoveChild(self, Window child) |
15afbcd0 RD |
8755 | |
8756 | Removes a child window. This is called automatically by window | |
8757 | deletion functions so should not be required by the application | |
8758 | programmer. | |
8759 | """ | |
54f9ee45 | 8760 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce | 8761 | |
704eda0c RD |
8762 | def SetDoubleBuffered(*args, **kwargs): |
8763 | """ | |
8764 | SetDoubleBuffered(self, bool on) | |
8765 | ||
8766 | Currently wxGTK2 only. | |
8767 | """ | |
8768 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
8769 | ||
e811c8ce | 8770 | def FindWindowById(*args, **kwargs): |
15afbcd0 | 8771 | """ |
a95a7133 | 8772 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
8773 | |
8774 | Find a chld of this window by window ID | |
8775 | """ | |
54f9ee45 | 8776 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
8777 | |
8778 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 8779 | """ |
a95a7133 | 8780 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
8781 | |
8782 | Find a child of this window by name | |
8783 | """ | |
54f9ee45 | 8784 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
8785 | |
8786 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 8787 | """ |
a95a7133 | 8788 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
8789 | |
8790 | Returns the event handler for this window. By default, the window is | |
8791 | its own event handler. | |
8792 | """ | |
54f9ee45 | 8793 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
8794 | |
8795 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 8796 | """ |
a95a7133 | 8797 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8798 | |
8799 | Sets the event handler for this window. An event handler is an object | |
d49bdf34 RD |
8800 | that is capable of processing the events sent to a window. (In other |
8801 | words, is able to dispatch the events to handler function.) By | |
8802 | default, the window is its own event handler, but an application may | |
8803 | wish to substitute another, for example to allow central | |
8804 | implementation of event-handling for a variety of different window | |
8805 | classes. | |
15afbcd0 | 8806 | |
41e2b43e | 8807 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 | 8808 | up a chain of event handlers, where an event not handled by one event |
d49bdf34 | 8809 | handler is handed off to the next one in the chain. |
15afbcd0 | 8810 | """ |
54f9ee45 | 8811 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
8812 | |
8813 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 8814 | """ |
a95a7133 | 8815 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8816 | |
8817 | Pushes this event handler onto the event handler stack for the window. | |
8818 | An event handler is an object that is capable of processing the events | |
d49bdf34 RD |
8819 | sent to a window. (In other words, is able to dispatch the events to |
8820 | handler function.) By default, the window is its own event handler, | |
8821 | but an application may wish to substitute another, for example to | |
8822 | allow central implementation of event-handling for a variety of | |
8823 | different window classes. | |
15afbcd0 RD |
8824 | |
8825 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8826 | event handlers, where an event not handled by one event handler is | |
d49bdf34 RD |
8827 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` |
8828 | to remove the event handler. Ownership of the handler is *not* given | |
8829 | to the window, so you should be sure to pop the handler before the | |
8830 | window is destroyed and either let PopEventHandler destroy it, or call | |
8831 | its Destroy method yourself. | |
15afbcd0 | 8832 | """ |
54f9ee45 | 8833 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
8834 | |
8835 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 8836 | """ |
a95a7133 | 8837 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
8838 | |
8839 | Removes and returns the top-most event handler on the event handler | |
8840 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
d49bdf34 | 8841 | destroyed after it is popped, and ``None`` will be returned instead. |
15afbcd0 | 8842 | """ |
54f9ee45 | 8843 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
8844 | |
8845 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 8846 | """ |
a95a7133 | 8847 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 8848 | |
41e2b43e | 8849 | Find the given handler in the event handler chain and remove (but not |
d49bdf34 | 8850 | delete) it from the event handler chain, returns True if it was found |
41e2b43e RD |
8851 | and False otherwise (this also results in an assert failure so this |
8852 | function should only be called when the handler is supposed to be | |
8853 | there.) | |
15afbcd0 | 8854 | """ |
54f9ee45 | 8855 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
8856 | |
8857 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 8858 | """ |
a95a7133 | 8859 | SetValidator(self, Validator validator) |
15afbcd0 RD |
8860 | |
8861 | Deletes the current validator (if any) and sets the window validator, | |
8862 | having called wx.Validator.Clone to create a new validator of this | |
8863 | type. | |
8864 | """ | |
54f9ee45 | 8865 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
8866 | |
8867 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 8868 | """ |
a95a7133 | 8869 | GetValidator(self) -> Validator |
15afbcd0 RD |
8870 | |
8871 | Returns a pointer to the current validator for the window, or None if | |
8872 | there is none. | |
8873 | """ | |
54f9ee45 | 8874 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 8875 | |
74a57fcd RD |
8876 | def Validate(*args, **kwargs): |
8877 | """ | |
a95a7133 | 8878 | Validate(self) -> bool |
74a57fcd RD |
8879 | |
8880 | Validates the current values of the child controls using their | |
41e2b43e RD |
8881 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8882 | style flag set, the method will also call Validate() of all child | |
8883 | windows. Returns false if any of the validations failed. | |
74a57fcd | 8884 | """ |
54f9ee45 | 8885 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
8886 | |
8887 | def TransferDataToWindow(*args, **kwargs): | |
8888 | """ | |
a95a7133 | 8889 | TransferDataToWindow(self) -> bool |
74a57fcd | 8890 | |
41e2b43e RD |
8891 | Transfers values to child controls from data areas specified by their |
8892 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8893 | style flag set, the method will also call TransferDataToWindow() of | |
8894 | all child windows. | |
74a57fcd | 8895 | """ |
54f9ee45 | 8896 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
8897 | |
8898 | def TransferDataFromWindow(*args, **kwargs): | |
8899 | """ | |
a95a7133 | 8900 | TransferDataFromWindow(self) -> bool |
74a57fcd | 8901 | |
41e2b43e RD |
8902 | Transfers values from child controls to data areas specified by their |
8903 | validators. Returns false if a transfer failed. If the window has | |
8904 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8905 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 8906 | """ |
54f9ee45 | 8907 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
8908 | |
8909 | def InitDialog(*args, **kwargs): | |
8910 | """ | |
a95a7133 | 8911 | InitDialog(self) |
74a57fcd | 8912 | |
41e2b43e RD |
8913 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8914 | to the dialog via validators. | |
74a57fcd | 8915 | """ |
54f9ee45 | 8916 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 8917 | |
e811c8ce | 8918 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 8919 | """ |
a95a7133 | 8920 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
8921 | |
8922 | Sets the accelerator table for this window. | |
8923 | """ | |
54f9ee45 | 8924 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8925 | |
8926 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 8927 | """ |
a95a7133 | 8928 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
8929 | |
8930 | Gets the accelerator table for this window. | |
8931 | """ | |
54f9ee45 | 8932 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8933 | |
8934 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 8935 | """ |
a95a7133 | 8936 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
8937 | |
8938 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8939 | registered here, this window will receive a hotkey event. It will | |
8940 | receive the event even if the application is in the background and | |
8941 | does not have the input focus because the user is working with some | |
8942 | other application. To bind an event handler function to this hotkey | |
8943 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8944 | hotkey was registered successfully. | |
8945 | """ | |
54f9ee45 | 8946 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
8947 | |
8948 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 8949 | """ |
a95a7133 | 8950 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
8951 | |
8952 | Unregisters a system wide hotkey. | |
8953 | """ | |
54f9ee45 | 8954 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
8955 | |
8956 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 8957 | """ |
a95a7133 | 8958 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
8959 | |
8960 | Converts a point or size from dialog units to pixels. Dialog units | |
8961 | are used for maintaining a dialog's proportions even if the font | |
8962 | changes. For the x dimension, the dialog units are multiplied by the | |
8963 | average character width and then divided by 4. For the y dimension, | |
8964 | the dialog units are multiplied by the average character height and | |
8965 | then divided by 8. | |
8966 | """ | |
54f9ee45 | 8967 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
8968 | |
8969 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 8970 | """ |
a95a7133 | 8971 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
8972 | |
8973 | Converts a point or size from dialog units to pixels. Dialog units | |
8974 | are used for maintaining a dialog's proportions even if the font | |
8975 | changes. For the x dimension, the dialog units are multiplied by the | |
8976 | average character width and then divided by 4. For the y dimension, | |
8977 | the dialog units are multiplied by the average character height and | |
8978 | then divided by 8. | |
8979 | """ | |
54f9ee45 | 8980 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
8981 | |
8982 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 8983 | """ |
a95a7133 | 8984 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
8985 | |
8986 | Converts a point or size from dialog units to pixels. Dialog units | |
8987 | are used for maintaining a dialog's proportions even if the font | |
8988 | changes. For the x dimension, the dialog units are multiplied by the | |
8989 | average character width and then divided by 4. For the y dimension, | |
8990 | the dialog units are multiplied by the average character height and | |
8991 | then divided by 8. | |
8992 | """ | |
54f9ee45 | 8993 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
8994 | |
8995 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 8996 | """ |
a95a7133 | 8997 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
8998 | |
8999 | Converts a point or size from dialog units to pixels. Dialog units | |
9000 | are used for maintaining a dialog's proportions even if the font | |
9001 | changes. For the x dimension, the dialog units are multiplied by the | |
9002 | average character width and then divided by 4. For the y dimension, | |
9003 | the dialog units are multiplied by the average character height and | |
9004 | then divided by 8. | |
9005 | """ | |
54f9ee45 | 9006 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
9007 | |
9008 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 9009 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 9010 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
9011 | |
9012 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 9013 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 9014 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
9015 | |
9016 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 9017 | """ |
a95a7133 | 9018 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
9019 | |
9020 | Moves the pointer to the given position on the window. | |
9021 | ||
9022 | NOTE: This function is not supported under Mac because Apple Human | |
9023 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9024 | """ | |
54f9ee45 | 9025 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
9026 | |
9027 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 9028 | """ |
a95a7133 | 9029 | CaptureMouse(self) |
15afbcd0 RD |
9030 | |
9031 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9032 | release the capture. | |
9033 | ||
9034 | Note that wxWindows maintains the stack of windows having captured the | |
9035 | mouse and when the mouse is released the capture returns to the window | |
9036 | which had had captured it previously and it is only really released if | |
9037 | there were no previous window. In particular, this means that you must | |
34e0a3bb RD |
9038 | release the mouse as many times as you capture it, unless the window |
9039 | receives the `wx.MouseCaptureLostEvent` event. | |
9040 | ||
9041 | Any application which captures the mouse in the beginning of some | |
9042 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
9043 | operation when it receives the event. The event handler must not | |
9044 | recapture mouse. | |
15afbcd0 | 9045 | """ |
54f9ee45 | 9046 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
9047 | |
9048 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 9049 | """ |
a95a7133 | 9050 | ReleaseMouse(self) |
15afbcd0 RD |
9051 | |
9052 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9053 | """ | |
54f9ee45 | 9054 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
9055 | |
9056 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 9057 | """ |
66c033b4 | 9058 | GetCapture() -> Window |
15afbcd0 RD |
9059 | |
9060 | Returns the window which currently captures the mouse or None | |
9061 | """ | |
54f9ee45 | 9062 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
9063 | |
9064 | GetCapture = staticmethod(GetCapture) | |
9065 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 9066 | """ |
a95a7133 | 9067 | HasCapture(self) -> bool |
15afbcd0 RD |
9068 | |
9069 | Returns true if this window has the current mouse capture. | |
9070 | """ | |
54f9ee45 | 9071 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
9072 | |
9073 | def Refresh(*args, **kwargs): | |
15afbcd0 | 9074 | """ |
a95a7133 | 9075 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
9076 | |
9077 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9078 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9079 | to the window. | |
9080 | """ | |
54f9ee45 | 9081 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
9082 | |
9083 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 9084 | """ |
fef4c27a | 9085 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
9086 | |
9087 | Redraws the contents of the given rectangle: the area inside it will | |
9088 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9089 | """ | |
54f9ee45 | 9090 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
9091 | |
9092 | def Update(*args, **kwargs): | |
15afbcd0 | 9093 | """ |
a95a7133 | 9094 | Update(self) |
15afbcd0 RD |
9095 | |
9096 | Calling this method immediately repaints the invalidated area of the | |
9097 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9098 | this would usually only happen when the flow of control returns to the | |
9099 | event loop.) Notice that this function doesn't refresh the window and | |
9100 | does nothing if the window has been already repainted. Use Refresh | |
9101 | first if you want to immediately redraw the window (or some portion of | |
9102 | it) unconditionally. | |
9103 | """ | |
54f9ee45 | 9104 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
9105 | |
9106 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 9107 | """ |
a95a7133 | 9108 | ClearBackground(self) |
15afbcd0 RD |
9109 | |
9110 | Clears the window by filling it with the current background | |
9111 | colour. Does not cause an erase background event to be generated. | |
9112 | """ | |
54f9ee45 | 9113 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
9114 | |
9115 | def Freeze(*args, **kwargs): | |
15afbcd0 | 9116 | """ |
a95a7133 | 9117 | Freeze(self) |
15afbcd0 | 9118 | |
41e2b43e RD |
9119 | Freezes the window or, in other words, prevents any updates from |
9120 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9121 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9122 | nested, with the actual Thaw being delayed until all the nesting has | |
9123 | been undone. | |
15afbcd0 RD |
9124 | |
9125 | This method is useful for visual appearance optimization (for example, | |
9126 | it is a good idea to use it before inserting large amount of text into | |
9127 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9128 | for all controls so it is mostly just a hint to wxWindows and not a | |
9129 | mandatory directive. | |
9130 | """ | |
54f9ee45 | 9131 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce | 9132 | |
33d6fd3b RD |
9133 | def IsFrozen(*args, **kwargs): |
9134 | """ | |
9135 | IsFrozen(self) -> bool | |
9136 | ||
9137 | Returns ``True`` if the window has been frozen and not thawed yet. | |
9138 | ||
9139 | :see: `Freeze` and `Thaw` | |
9140 | """ | |
9141 | return _core_.Window_IsFrozen(*args, **kwargs) | |
9142 | ||
e811c8ce | 9143 | def Thaw(*args, **kwargs): |
15afbcd0 | 9144 | """ |
a95a7133 | 9145 | Thaw(self) |
15afbcd0 | 9146 | |
4276dc52 | 9147 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
9148 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9149 | times that Freeze was before the window will be updated. | |
15afbcd0 | 9150 | """ |
54f9ee45 | 9151 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
9152 | |
9153 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 9154 | """ |
a95a7133 | 9155 | PrepareDC(self, DC dc) |
15afbcd0 RD |
9156 | |
9157 | Call this function to prepare the device context for drawing a | |
9158 | scrolled image. It sets the device origin according to the current | |
9159 | scroll position. | |
9160 | """ | |
54f9ee45 | 9161 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce RD |
9162 | |
9163 | def GetUpdateRegion(*args, **kwargs): | |
15afbcd0 | 9164 | """ |
a95a7133 | 9165 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
9166 | |
9167 | Returns the region specifying which parts of the window have been | |
9168 | damaged. Should only be called within an EVT_PAINT handler. | |
9169 | """ | |
54f9ee45 | 9170 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
9171 | |
9172 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 9173 | """ |
a95a7133 | 9174 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
9175 | |
9176 | Get the update rectangle region bounding box in client coords. | |
9177 | """ | |
54f9ee45 | 9178 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
9179 | |
9180 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 9181 | """ |
a95a7133 | 9182 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
9183 | |
9184 | Returns true if the given point or rectangle area has been exposed | |
9185 | since the last repaint. Call this in an paint event handler to | |
9186 | optimize redrawing by only redrawing those areas, which have been | |
9187 | exposed. | |
9188 | """ | |
54f9ee45 | 9189 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
9190 | |
9191 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 9192 | """ |
a95a7133 | 9193 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
9194 | |
9195 | Returns true if the given point or rectangle area has been exposed | |
9196 | since the last repaint. Call this in an paint event handler to | |
9197 | optimize redrawing by only redrawing those areas, which have been | |
9198 | exposed. | |
9199 | """ | |
54f9ee45 | 9200 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 9201 | |
4276dc52 | 9202 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 9203 | """ |
a95a7133 | 9204 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
9205 | |
9206 | Returns true if the given point or rectangle area has been exposed | |
9207 | since the last repaint. Call this in an paint event handler to | |
9208 | optimize redrawing by only redrawing those areas, which have been | |
9209 | exposed. | |
9210 | """ | |
54f9ee45 | 9211 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 9212 | |
74a57fcd RD |
9213 | def GetDefaultAttributes(*args, **kwargs): |
9214 | """ | |
a95a7133 | 9215 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 9216 | |
41e2b43e RD |
9217 | Get the default attributes for an instance of this class. This is |
9218 | useful if you want to use the same font or colour in your own control | |
9219 | as in a standard control -- which is a much better idea than hard | |
9220 | coding specific colours or fonts which might look completely out of | |
db3e571a | 9221 | place on the user's system, especially if it uses themes. |
74a57fcd | 9222 | """ |
54f9ee45 | 9223 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9224 | |
9225 | def GetClassDefaultAttributes(*args, **kwargs): | |
9226 | """ | |
66c033b4 | 9227 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 9228 | |
41e2b43e RD |
9229 | Get the default attributes for this class. This is useful if you want |
9230 | to use the same font or colour in your own control as in a standard | |
9231 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9232 | colours or fonts which might look completely out of place on the |
9233 | user's system, especially if it uses themes. | |
74a57fcd RD |
9234 | |
9235 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9236 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9237 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9238 | this. | |
74a57fcd | 9239 | """ |
54f9ee45 | 9240 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9241 | |
9242 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 9243 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9244 | """ |
a95a7133 | 9245 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9246 | |
9247 | Sets the background colour of the window. Returns True if the colour | |
9248 | was changed. The background colour is usually painted by the default | |
9249 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9250 | automatically under GTK. Using `wx.NullColour` will reset the window |
9251 | to the default background colour. | |
15afbcd0 | 9252 | |
db3e571a | 9253 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9254 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
9255 | calling this function. |
9256 | ||
f8167d6e RD |
9257 | Using this function will disable attempts to use themes for this |
9258 | window, if the system supports them. Use with care since usually the | |
9259 | themes represent the appearance chosen by the user to be used for all | |
9260 | applications on the system. | |
15afbcd0 | 9261 | """ |
54f9ee45 | 9262 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 9263 | |
412d302d RD |
9264 | def SetOwnBackgroundColour(*args, **kwargs): |
9265 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9266 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 9267 | |
e811c8ce | 9268 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 9269 | """ |
a95a7133 | 9270 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9271 | |
9272 | Sets the foreground colour of the window. Returns True is the colour | |
9273 | was changed. The interpretation of foreground colour is dependent on | |
9274 | the window class; it may be the text colour or other colour, or it may | |
9275 | not be used at all. | |
9276 | """ | |
54f9ee45 | 9277 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 9278 | |
fa47d7a7 VS |
9279 | def SetOwnForegroundColour(*args, **kwargs): |
9280 | """SetOwnForegroundColour(self, Colour colour)""" | |
9281 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 9282 | |
e811c8ce | 9283 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9284 | """ |
a95a7133 | 9285 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
9286 | |
9287 | Returns the background colour of the window. | |
9288 | """ | |
54f9ee45 | 9289 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
9290 | |
9291 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 9292 | """ |
a95a7133 | 9293 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
9294 | |
9295 | Returns the foreground colour of the window. The interpretation of | |
9296 | foreground colour is dependent on the window class; it may be the text | |
9297 | colour or other colour, or it may not be used at all. | |
9298 | """ | |
54f9ee45 | 9299 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 9300 | |
562ecc31 RD |
9301 | def InheritsBackgroundColour(*args, **kwargs): |
9302 | """InheritsBackgroundColour(self) -> bool""" | |
9303 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9304 | ||
9305 | def UseBgCol(*args, **kwargs): | |
9306 | """UseBgCol(self) -> bool""" | |
9307 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9308 | ||
7bc1e663 RD |
9309 | def SetBackgroundStyle(*args, **kwargs): |
9310 | """ | |
9311 | SetBackgroundStyle(self, int style) -> bool | |
9312 | ||
9313 | Returns the background style of the window. The background style | |
9314 | indicates how the background of the window is drawn. | |
9315 | ||
9316 | ====================== ======================================== | |
9317 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9318 | be determined by the system | |
9319 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9320 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9321 | application. | |
9322 | ====================== ======================================== | |
9323 | ||
9324 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9325 | a custom background, such as a tiled bitmap. Currently the style has | |
9326 | no effect on other platforms. | |
9327 | ||
9328 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9329 | """ | |
9330 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9331 | ||
9332 | def GetBackgroundStyle(*args, **kwargs): | |
9333 | """ | |
9334 | GetBackgroundStyle(self) -> int | |
9335 | ||
9336 | Returns the background style of the window. | |
9337 | ||
9338 | :see: `SetBackgroundStyle` | |
9339 | """ | |
9340 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9341 | ||
51b83b37 RD |
9342 | def HasTransparentBackground(*args, **kwargs): |
9343 | """ | |
9344 | HasTransparentBackground(self) -> bool | |
9345 | ||
9346 | Returns True if this window's background is transparent (as, for | |
9347 | example, for `wx.StaticText`) and should show the parent window's | |
9348 | background. | |
9349 | ||
9350 | This method is mostly used internally by the library itself and you | |
9351 | normally shouldn't have to call it. You may, however, have to override | |
9352 | it in your custom control classes to ensure that background is painted | |
9353 | correctly. | |
9354 | """ | |
9355 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9356 | ||
e811c8ce | 9357 | def SetCursor(*args, **kwargs): |
15afbcd0 | 9358 | """ |
a95a7133 | 9359 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
9360 | |
9361 | Sets the window's cursor. Notice that the window cursor also sets it | |
9362 | for the children of the window implicitly. | |
9363 | ||
9364 | The cursor may be wx.NullCursor in which case the window cursor will | |
9365 | be reset back to default. | |
9366 | """ | |
54f9ee45 | 9367 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
9368 | |
9369 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 9370 | """ |
a95a7133 | 9371 | GetCursor(self) -> Cursor |
15afbcd0 RD |
9372 | |
9373 | Return the cursor associated with this window. | |
9374 | """ | |
54f9ee45 | 9375 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
9376 | |
9377 | def SetFont(*args, **kwargs): | |
15afbcd0 | 9378 | """ |
a95a7133 | 9379 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
9380 | |
9381 | Sets the font for this window. | |
9382 | """ | |
54f9ee45 | 9383 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 9384 | |
fa47d7a7 VS |
9385 | def SetOwnFont(*args, **kwargs): |
9386 | """SetOwnFont(self, Font font)""" | |
9387 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9388 | |
e811c8ce | 9389 | def GetFont(*args, **kwargs): |
15afbcd0 | 9390 | """ |
a95a7133 | 9391 | GetFont(self) -> Font |
15afbcd0 | 9392 | |
4276dc52 | 9393 | Returns the default font used for this window. |
15afbcd0 | 9394 | """ |
54f9ee45 | 9395 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9396 | |
9397 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9398 | """ |
a95a7133 | 9399 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9400 | |
9401 | Sets the caret associated with the window. | |
9402 | """ | |
54f9ee45 | 9403 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9404 | |
9405 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9406 | """ |
a95a7133 | 9407 | GetCaret(self) -> Caret |
15afbcd0 RD |
9408 | |
9409 | Returns the caret associated with the window. | |
9410 | """ | |
54f9ee45 | 9411 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9412 | |
9413 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9414 | """ |
a95a7133 | 9415 | GetCharHeight(self) -> int |
15afbcd0 RD |
9416 | |
9417 | Get the (average) character size for the current font. | |
9418 | """ | |
54f9ee45 | 9419 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9420 | |
9421 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9422 | """ |
a95a7133 | 9423 | GetCharWidth(self) -> int |
15afbcd0 RD |
9424 | |
9425 | Get the (average) character size for the current font. | |
9426 | """ | |
54f9ee45 | 9427 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9428 | |
9429 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9430 | """ |
9431 | GetTextExtent(String string) -> (width, height) | |
9432 | ||
9433 | Get the width and height of the text using the current font. | |
9434 | """ | |
54f9ee45 | 9435 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9436 | |
9437 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9438 | """ |
196addbf | 9439 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9440 | (width, height, descent, externalLeading) |
e811c8ce | 9441 | |
15afbcd0 RD |
9442 | Get the width, height, decent and leading of the text using the |
9443 | current or specified font. | |
0df68c9f | 9444 | """ |
54f9ee45 | 9445 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
9446 | |
9447 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
9448 | """ |
9449 | ClientToScreenXY(int x, int y) -> (x,y) | |
9450 | ||
9451 | Converts to screen coordinates from coordinates relative to this window. | |
9452 | """ | |
54f9ee45 | 9453 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
9454 | |
9455 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
9456 | """ |
9457 | ScreenToClientXY(int x, int y) -> (x,y) | |
9458 | ||
9459 | Converts from screen to client window coordinates. | |
9460 | """ | |
54f9ee45 | 9461 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
9462 | |
9463 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 9464 | """ |
a95a7133 | 9465 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
9466 | |
9467 | Converts to screen coordinates from coordinates relative to this window. | |
9468 | """ | |
54f9ee45 | 9469 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
9470 | |
9471 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 9472 | """ |
a95a7133 | 9473 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
9474 | |
9475 | Converts from screen to client window coordinates. | |
9476 | """ | |
54f9ee45 | 9477 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
9478 | |
9479 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 9480 | """ |
a95a7133 | 9481 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
9482 | |
9483 | Test where the given (in client coords) point lies | |
9484 | """ | |
54f9ee45 | 9485 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
9486 | |
9487 | def HitTest(*args, **kwargs): | |
15afbcd0 | 9488 | """ |
a95a7133 | 9489 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
9490 | |
9491 | Test where the given (in client coords) point lies | |
9492 | """ | |
54f9ee45 | 9493 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 9494 | |
15afbcd0 RD |
9495 | def GetBorder(*args): |
9496 | """ | |
a95a7133 RD |
9497 | GetBorder(self, long flags) -> int |
9498 | GetBorder(self) -> int | |
e811c8ce | 9499 | |
15afbcd0 RD |
9500 | Get border for the flags of this window |
9501 | """ | |
54f9ee45 | 9502 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
9503 | |
9504 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 9505 | """ |
a95a7133 | 9506 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
9507 | |
9508 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9509 | implementation depends on the window; for example a wx.ToolBar will | |
9510 | send an update UI event for each toolbar button, and a wx.Frame will | |
9511 | send an update UI event for each menubar menu item. You can call this | |
9512 | function from your application to ensure that your UI is up-to-date at | |
9513 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9514 | concerned). This may be necessary if you have called | |
5ba5649b | 9515 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
9516 | limit the overhead that wxWindows incurs by sending update UI events |
9517 | in idle time. | |
15afbcd0 | 9518 | """ |
54f9ee45 | 9519 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
9520 | |
9521 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 9522 | """ |
b0503257 | 9523 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 9524 | |
b0503257 RD |
9525 | Pops up the given menu at the specified coordinates, relative to this window, |
9526 | and returns control when the user has dismissed the menu. If a menu item is | |
9527 | selected, the corresponding menu event is generated and will be processed as | |
9528 | usual. If the default position is given then the current position of the | |
9529 | mouse cursor will be used. | |
15afbcd0 | 9530 | """ |
54f9ee45 | 9531 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 9532 | |
15afbcd0 RD |
9533 | def PopupMenu(*args, **kwargs): |
9534 | """ | |
b0503257 | 9535 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 9536 | |
b0503257 RD |
9537 | Pops up the given menu at the specified coordinates, relative to this window, |
9538 | and returns control when the user has dismissed the menu. If a menu item is | |
9539 | selected, the corresponding menu event is generated and will be processed as | |
9540 | usual. If the default position is given then the current position of the | |
9541 | mouse cursor will be used. | |
15afbcd0 | 9542 | """ |
54f9ee45 | 9543 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 | 9544 | |
10044bf1 RD |
9545 | def HasMultiplePages(*args, **kwargs): |
9546 | """HasMultiplePages(self) -> bool""" | |
9547 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
9548 | ||
15afbcd0 RD |
9549 | def GetHandle(*args, **kwargs): |
9550 | """ | |
a95a7133 | 9551 | GetHandle(self) -> long |
15afbcd0 RD |
9552 | |
9553 | Returns the platform-specific handle (as a long integer) of the | |
9554 | physical window. Currently on wxMac it returns the handle of the | |
9555 | toplevel parent of the window. | |
9556 | """ | |
54f9ee45 | 9557 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 9558 | |
7e63a440 RD |
9559 | def AssociateHandle(*args, **kwargs): |
9560 | """ | |
9561 | AssociateHandle(self, long handle) | |
9562 | ||
9563 | Associate the window with a new native handle | |
9564 | """ | |
9565 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9566 | ||
9567 | def DissociateHandle(*args, **kwargs): | |
9568 | """ | |
9569 | DissociateHandle(self) | |
9570 | ||
9571 | Dissociate the current native handle from the window | |
9572 | """ | |
9573 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9574 | ||
15afbcd0 RD |
9575 | def HasScrollbar(*args, **kwargs): |
9576 | """ | |
a95a7133 | 9577 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
9578 | |
9579 | Does the window have the scrollbar for this orientation? | |
9580 | """ | |
54f9ee45 | 9581 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
9582 | |
9583 | def SetScrollbar(*args, **kwargs): | |
9584 | """ | |
41e2b43e | 9585 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
9586 | bool refresh=True) |
9587 | ||
9588 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 9589 | """ |
54f9ee45 | 9590 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
9591 | |
9592 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 9593 | """ |
a95a7133 | 9594 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
9595 | |
9596 | Sets the position of one of the built-in scrollbars. | |
9597 | """ | |
54f9ee45 | 9598 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
9599 | |
9600 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 9601 | """ |
a95a7133 | 9602 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
9603 | |
9604 | Returns the built-in scrollbar position. | |
9605 | """ | |
54f9ee45 | 9606 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
9607 | |
9608 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 9609 | """ |
a95a7133 | 9610 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
9611 | |
9612 | Returns the built-in scrollbar thumb size. | |
9613 | """ | |
54f9ee45 | 9614 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
9615 | |
9616 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 9617 | """ |
a95a7133 | 9618 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
9619 | |
9620 | Returns the built-in scrollbar range. | |
9621 | """ | |
54f9ee45 | 9622 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
9623 | |
9624 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 9625 | """ |
a95a7133 | 9626 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
9627 | |
9628 | Physically scrolls the pixels in the window and move child windows | |
9629 | accordingly. Use this function to optimise your scrolling | |
9630 | implementations, to minimise the area that must be redrawn. Note that | |
9631 | it is rarely required to call this function from a user program. | |
15afbcd0 | 9632 | """ |
54f9ee45 | 9633 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
9634 | |
9635 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 9636 | """ |
a95a7133 | 9637 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
9638 | |
9639 | If the platform and window class supports it, scrolls the window by | |
9640 | the given number of lines down, if lines is positive, or up if lines | |
9641 | is negative. Returns True if the window was scrolled, False if it was | |
9642 | already on top/bottom and nothing was done. | |
9643 | """ | |
54f9ee45 | 9644 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
9645 | |
9646 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 9647 | """ |
a95a7133 | 9648 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 9649 | |
41e2b43e | 9650 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
9651 | the given number of pages down, if pages is positive, or up if pages |
9652 | is negative. Returns True if the window was scrolled, False if it was | |
9653 | already on top/bottom and nothing was done. | |
9654 | """ | |
54f9ee45 | 9655 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
9656 | |
9657 | def LineUp(*args, **kwargs): | |
15afbcd0 | 9658 | """ |
a95a7133 | 9659 | LineUp(self) -> bool |
15afbcd0 RD |
9660 | |
9661 | This is just a wrapper for ScrollLines(-1). | |
9662 | """ | |
54f9ee45 | 9663 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
9664 | |
9665 | def LineDown(*args, **kwargs): | |
15afbcd0 | 9666 | """ |
a95a7133 | 9667 | LineDown(self) -> bool |
15afbcd0 RD |
9668 | |
9669 | This is just a wrapper for ScrollLines(1). | |
9670 | """ | |
54f9ee45 | 9671 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
9672 | |
9673 | def PageUp(*args, **kwargs): | |
15afbcd0 | 9674 | """ |
a95a7133 | 9675 | PageUp(self) -> bool |
15afbcd0 RD |
9676 | |
9677 | This is just a wrapper for ScrollPages(-1). | |
9678 | """ | |
54f9ee45 | 9679 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
9680 | |
9681 | def PageDown(*args, **kwargs): | |
15afbcd0 | 9682 | """ |
a95a7133 | 9683 | PageDown(self) -> bool |
15afbcd0 RD |
9684 | |
9685 | This is just a wrapper for ScrollPages(1). | |
9686 | """ | |
54f9ee45 | 9687 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
9688 | |
9689 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 9690 | """ |
a95a7133 | 9691 | SetHelpText(self, String text) |
15afbcd0 RD |
9692 | |
9693 | Sets the help text to be used as context-sensitive help for this | |
9694 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9695 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9696 | """ |
54f9ee45 | 9697 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
9698 | |
9699 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 9700 | """ |
a95a7133 | 9701 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
9702 | |
9703 | Associate this help text with all windows with the same id as this | |
9704 | one. | |
9705 | """ | |
54f9ee45 | 9706 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce | 9707 | |
b850e7f3 RD |
9708 | def GetHelpTextAtPoint(*args, **kwargs): |
9709 | """ | |
9710 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
9711 | ||
9712 | Get the help string associated with the given position in this window. | |
9713 | ||
9714 | Notice that pt may be invalid if event origin is keyboard or unknown | |
9715 | and this method should return the global window help text then | |
9716 | ||
9717 | """ | |
9718 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
9719 | ||
e811c8ce | 9720 | def GetHelpText(*args, **kwargs): |
15afbcd0 | 9721 | """ |
a95a7133 | 9722 | GetHelpText(self) -> String |
15afbcd0 RD |
9723 | |
9724 | Gets the help text to be used as context-sensitive help for this | |
9725 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9726 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9727 | """ |
54f9ee45 | 9728 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
9729 | |
9730 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 9731 | """ |
a95a7133 | 9732 | SetToolTipString(self, String tip) |
15afbcd0 RD |
9733 | |
9734 | Attach a tooltip to the window. | |
9735 | """ | |
54f9ee45 | 9736 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
9737 | |
9738 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 9739 | """ |
a95a7133 | 9740 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
9741 | |
9742 | Attach a tooltip to the window. | |
9743 | """ | |
54f9ee45 | 9744 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
9745 | |
9746 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 9747 | """ |
a95a7133 | 9748 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
9749 | |
9750 | get the associated tooltip or None if none | |
9751 | """ | |
54f9ee45 | 9752 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
9753 | |
9754 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 9755 | """ |
a95a7133 | 9756 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
9757 | |
9758 | Associates a drop target with this window. If the window already has | |
9759 | a drop target, it is deleted. | |
9760 | """ | |
54f9ee45 | 9761 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
9762 | |
9763 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 9764 | """ |
a95a7133 | 9765 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
9766 | |
9767 | Returns the associated drop target, which may be None. | |
9768 | """ | |
54f9ee45 | 9769 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 9770 | |
5ba5649b RD |
9771 | def DragAcceptFiles(*args, **kwargs): |
9772 | """ | |
9773 | DragAcceptFiles(self, bool accept) | |
9774 | ||
9775 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9776 | Only functional on Windows. | |
9777 | """ | |
9778 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9779 | ||
e811c8ce | 9780 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 9781 | """ |
a95a7133 | 9782 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
9783 | |
9784 | Sets the window to have the given layout constraints. If an existing | |
9785 | layout constraints object is already owned by the window, it will be | |
9786 | deleted. Pass None to disassociate and delete the window's current | |
9787 | constraints. | |
9788 | ||
9789 | You must call SetAutoLayout to tell a window to use the constraints | |
9790 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9791 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9792 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9793 | effect. | |
9794 | """ | |
54f9ee45 | 9795 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
9796 | |
9797 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 9798 | """ |
a95a7133 | 9799 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
9800 | |
9801 | Returns a pointer to the window's layout constraints, or None if there | |
9802 | are none. | |
9803 | """ | |
54f9ee45 | 9804 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
9805 | |
9806 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9807 | """ |
a95a7133 | 9808 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
9809 | |
9810 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
9811 | when the window is resized. lease note that this only happens for the |
9812 | windows usually used to contain children, namely `wx.Panel` and | |
9813 | `wx.TopLevelWindow` (and the classes deriving from them). | |
9814 | ||
9815 | This method is called implicitly by `SetSizer` but if you use | |
9816 | `SetConstraints` you should call it manually or otherwise the window | |
9817 | layout won't be correctly updated when its size changes. | |
15afbcd0 | 9818 | """ |
54f9ee45 | 9819 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9820 | |
9821 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9822 | """ |
a95a7133 | 9823 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
9824 | |
9825 | Returns the current autoLayout setting | |
9826 | """ | |
54f9ee45 | 9827 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9828 | |
9829 | def Layout(*args, **kwargs): | |
15afbcd0 | 9830 | """ |
a95a7133 | 9831 | Layout(self) -> bool |
15afbcd0 RD |
9832 | |
9833 | Invokes the constraint-based layout algorithm or the sizer-based | |
9834 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9835 | this function gets called automatically by the default EVT_SIZE | |
9836 | handler when the window is resized. | |
9837 | """ | |
54f9ee45 | 9838 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
9839 | |
9840 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 9841 | """ |
a95a7133 | 9842 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9843 | |
9844 | Sets the window to have the given layout sizer. The window will then | |
9845 | own the object, and will take care of its deletion. If an existing | |
9846 | layout sizer object is already owned by the window, it will be deleted | |
9847 | if the deleteOld parameter is true. Note that this function will also | |
9848 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 9849 | non-None, and False otherwise. |
15afbcd0 | 9850 | """ |
54f9ee45 | 9851 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
9852 | |
9853 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 9854 | """ |
a95a7133 | 9855 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9856 | |
9857 | The same as SetSizer, except it also sets the size hints for the | |
9858 | window based on the sizer's minimum size. | |
9859 | """ | |
54f9ee45 | 9860 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
9861 | |
9862 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 9863 | """ |
a95a7133 | 9864 | GetSizer(self) -> Sizer |
15afbcd0 RD |
9865 | |
9866 | Return the sizer associated with the window by a previous call to | |
9867 | SetSizer or None if there isn't one. | |
9868 | """ | |
54f9ee45 | 9869 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
9870 | |
9871 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9872 | """ |
a95a7133 | 9873 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
9874 | |
9875 | This normally does not need to be called by application code. It is | |
9876 | called internally when a window is added to a sizer, and is used so | |
9877 | the window can remove itself from the sizer when it is destroyed. | |
9878 | """ | |
54f9ee45 | 9879 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
9880 | |
9881 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9882 | """ |
a95a7133 | 9883 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
9884 | |
9885 | Return the sizer that this window is a member of, if any, otherwise None. | |
9886 | """ | |
54f9ee45 | 9887 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 9888 | |
a95a7133 RD |
9889 | def InheritAttributes(*args, **kwargs): |
9890 | """ | |
9891 | InheritAttributes(self) | |
9892 | ||
41e2b43e RD |
9893 | This function is (or should be, in case of custom controls) called |
9894 | during window creation to intelligently set up the window visual | |
9895 | attributes, that is the font and the foreground and background | |
9896 | colours. | |
9897 | ||
9898 | By 'intelligently' the following is meant: by default, all windows use | |
9899 | their own default attributes. However if some of the parent's | |
9900 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9901 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
9902 | explicitly set for this window itself, then this window takes the same |
9903 | value as used by the parent. In addition, if the window overrides | |
9904 | ShouldInheritColours to return false, the colours will not be changed | |
9905 | no matter what and only the font might. | |
9906 | ||
34621cc5 | 9907 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 9908 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
9909 | attributes are used and in this case, nothing should be inherited as |
9910 | in modern GUIs different controls use different fonts (and colours) | |
9911 | than their siblings so they can't inherit the same value from the | |
9912 | parent. However it was also deemed desirable to allow to simply change | |
9913 | the attributes of all children at once by just changing the font or | |
9914 | colour of their common parent, hence in this case we do inherit the | |
9915 | parents attributes. | |
9916 | ||
a95a7133 | 9917 | """ |
54f9ee45 | 9918 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
9919 | |
9920 | def ShouldInheritColours(*args, **kwargs): | |
9921 | """ | |
9922 | ShouldInheritColours(self) -> bool | |
9923 | ||
9924 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
9925 | changed by InheritAttributes, returning false forbids inheriting them |
9926 | from the parent window. | |
a95a7133 | 9927 | |
41e2b43e RD |
9928 | The base class version returns false, but this method is overridden in |
9929 | wxControl where it returns true. | |
a95a7133 | 9930 | """ |
54f9ee45 | 9931 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 9932 | |
fc46b7f3 RD |
9933 | def CanSetTransparent(*args, **kwargs): |
9934 | """ | |
9935 | CanSetTransparent(self) -> bool | |
9936 | ||
9937 | Returns ``True`` if the platform supports setting the transparency for | |
9938 | this window. Note that this method will err on the side of caution, | |
9939 | so it is possible that this will return ``False`` when it is in fact | |
9940 | possible to set the transparency. | |
9941 | ||
9942 | NOTE: On X-windows systems the X server must have the composite | |
9943 | extension loaded, and there must be a composite manager program (such | |
9944 | as xcompmgr) running. | |
9945 | """ | |
9946 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
9947 | ||
9948 | def SetTransparent(*args, **kwargs): | |
9949 | """ | |
9950 | SetTransparent(self, byte alpha) -> bool | |
9951 | ||
9952 | Attempt to set the transparency of this window to the ``alpha`` value, | |
9953 | returns True on success. The ``alpha`` value is an integer in the | |
9954 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
9955 | opaque. | |
9956 | """ | |
9957 | return _core_.Window_SetTransparent(*args, **kwargs) | |
9958 | ||
e811c8ce | 9959 | def PostCreate(self, pre): |
15afbcd0 RD |
9960 | """ |
9961 | Phase 3 of the 2-phase create <wink!> | |
9962 | Call this method after precreating the window with the 2-phase create method. | |
9963 | """ | |
e811c8ce RD |
9964 | self.this = pre.this |
9965 | self.thisown = pre.thisown | |
9966 | pre.thisown = 0 | |
9967 | if hasattr(self, '_setOORInfo'): | |
9968 | self._setOORInfo(self) | |
9969 | if hasattr(self, '_setCallbackInfo'): | |
9970 | self._setCallbackInfo(self, self.__class__) | |
9971 | ||
7e08d4ef | 9972 | def SendSizeEvent(self): |
453fb36b | 9973 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) |
7e08d4ef | 9974 | |
2bf58437 RD |
9975 | AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") |
9976 | AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`") | |
9977 | AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") | |
9978 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
9979 | BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") | |
9980 | BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`") | |
9981 | BestSize = property(GetBestSize,doc="See `GetBestSize`") | |
9982 | BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`") | |
9983 | Border = property(GetBorder,doc="See `GetBorder`") | |
9984 | Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`") | |
9985 | CharHeight = property(GetCharHeight,doc="See `GetCharHeight`") | |
9986 | CharWidth = property(GetCharWidth,doc="See `GetCharWidth`") | |
9987 | Children = property(GetChildren,doc="See `GetChildren`") | |
9988 | ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`") | |
9989 | ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`") | |
9990 | ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`") | |
9991 | Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`") | |
9992 | ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`") | |
9993 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
9994 | DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`") | |
9995 | DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`") | |
9996 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
9997 | ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`") | |
9998 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
9999 | ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`") | |
2bf58437 RD |
10000 | GrandParent = property(GetGrandParent,doc="See `GetGrandParent`") |
10001 | Handle = property(GetHandle,doc="See `GetHandle`") | |
10002 | HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`") | |
2bf58437 RD |
10003 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") |
10004 | Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`") | |
994453b8 | 10005 | LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`") |
2bf58437 RD |
10006 | MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`") |
10007 | MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`") | |
10008 | MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`") | |
10009 | MinHeight = property(GetMinHeight,doc="See `GetMinHeight`") | |
10010 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
10011 | MinWidth = property(GetMinWidth,doc="See `GetMinWidth`") | |
10012 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
10013 | Parent = property(GetParent,doc="See `GetParent`") | |
10014 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
10015 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
10016 | ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`") | |
10017 | ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`") | |
2bf58437 RD |
10018 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") |
10019 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
2bf58437 RD |
10020 | ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`") |
10021 | ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`") | |
10022 | UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`") | |
10023 | UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`") | |
10024 | Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`") | |
10025 | VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`") | |
10026 | WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`") | |
10027 | WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`") | |
10028 | WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`") | |
97ab0f6a RD |
10029 | Shown = property(IsShown,Show,doc="See `IsShown` and `Show`") |
10030 | Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`") | |
10031 | TopLevel = property(IsTopLevel,doc="See `IsTopLevel`") | |
2131d850 | 10032 | _core_.Window_swigregister(Window) |
e811c8ce RD |
10033 | |
10034 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
10035 | """ |
10036 | PreWindow() -> Window | |
10037 | ||
10038 | Precreate a Window for 2-phase creation. | |
10039 | """ | |
54f9ee45 | 10040 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
10041 | return val |
10042 | ||
0085ce49 RD |
10043 | def Window_NewControlId(*args): |
10044 | """ | |
15afbcd0 RD |
10045 | Window_NewControlId() -> int |
10046 | ||
10047 | Generate a control id for the controls which were not given one. | |
10048 | """ | |
0085ce49 | 10049 | return _core_.Window_NewControlId(*args) |
e811c8ce RD |
10050 | |
10051 | def Window_NextControlId(*args, **kwargs): | |
0085ce49 | 10052 | """ |
15afbcd0 RD |
10053 | Window_NextControlId(int winid) -> int |
10054 | ||
10055 | Get the id of the control following the one with the given | |
41e2b43e | 10056 | autogenerated) id |
15afbcd0 | 10057 | """ |
0085ce49 | 10058 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
10059 | |
10060 | def Window_PrevControlId(*args, **kwargs): | |
0085ce49 | 10061 | """ |
15afbcd0 RD |
10062 | Window_PrevControlId(int winid) -> int |
10063 | ||
10064 | Get the id of the control preceding the one with the given | |
41e2b43e | 10065 | autogenerated) id |
15afbcd0 | 10066 | """ |
0085ce49 | 10067 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce | 10068 | |
0085ce49 RD |
10069 | def Window_FindFocus(*args): |
10070 | """ | |
15afbcd0 RD |
10071 | Window_FindFocus() -> Window |
10072 | ||
10073 | Returns the window or control that currently has the keyboard focus, | |
10074 | or None. | |
10075 | """ | |
0085ce49 | 10076 | return _core_.Window_FindFocus(*args) |
e811c8ce | 10077 | |
0085ce49 RD |
10078 | def Window_GetCapture(*args): |
10079 | """ | |
15afbcd0 RD |
10080 | Window_GetCapture() -> Window |
10081 | ||
10082 | Returns the window which currently captures the mouse or None | |
10083 | """ | |
0085ce49 | 10084 | return _core_.Window_GetCapture(*args) |
e811c8ce | 10085 | |
74a57fcd | 10086 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10087 | """ |
74a57fcd RD |
10088 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10089 | ||
41e2b43e RD |
10090 | Get the default attributes for this class. This is useful if you want |
10091 | to use the same font or colour in your own control as in a standard | |
10092 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
10093 | colours or fonts which might look completely out of place on the |
10094 | user's system, especially if it uses themes. | |
74a57fcd RD |
10095 | |
10096 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 10097 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
10098 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10099 | this. | |
74a57fcd | 10100 | """ |
0085ce49 | 10101 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10102 | |
e811c8ce | 10103 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
10104 | """ |
10105 | Convenience function for converting a Point or (x,y) in | |
10106 | dialog units to pixel units. | |
10107 | """ | |
e811c8ce RD |
10108 | if y is None: |
10109 | return win.ConvertDialogPointToPixels(point_or_x) | |
10110 | else: | |
fd3f2efe | 10111 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
10112 | |
10113 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
10114 | """ |
10115 | Convenience function for converting a Size or (w,h) in | |
10116 | dialog units to pixel units. | |
10117 | """ | |
e811c8ce RD |
10118 | if height is None: |
10119 | return win.ConvertDialogSizeToPixels(size_width) | |
10120 | else: | |
fd3f2efe | 10121 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
10122 | |
10123 | ||
10124 | def FindWindowById(*args, **kwargs): | |
0085ce49 | 10125 | """ |
15afbcd0 RD |
10126 | FindWindowById(long id, Window parent=None) -> Window |
10127 | ||
10128 | Find the first window in the application with the given id. If parent | |
10129 | is None, the search will start from all top-level frames and dialog | |
10130 | boxes; if non-None, the search will be limited to the given window | |
10131 | hierarchy. The search is recursive in both cases. | |
10132 | """ | |
0085ce49 | 10133 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
10134 | |
10135 | def FindWindowByName(*args, **kwargs): | |
0085ce49 | 10136 | """ |
15afbcd0 RD |
10137 | FindWindowByName(String name, Window parent=None) -> Window |
10138 | ||
10139 | Find a window by its name (as given in a window constructor or Create | |
10140 | function call). If parent is None, the search will start from all | |
10141 | top-level frames and dialog boxes; if non-None, the search will be | |
10142 | limited to the given window hierarchy. The search is recursive in both | |
10143 | cases. | |
10144 | ||
10145 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10146 | """ | |
0085ce49 | 10147 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
10148 | |
10149 | def FindWindowByLabel(*args, **kwargs): | |
0085ce49 | 10150 | """ |
15afbcd0 RD |
10151 | FindWindowByLabel(String label, Window parent=None) -> Window |
10152 | ||
10153 | Find a window by its label. Depending on the type of window, the label | |
10154 | may be a window title or panel item label. If parent is None, the | |
10155 | search will start from all top-level frames and dialog boxes; if | |
10156 | non-None, the search will be limited to the given window | |
10157 | hierarchy. The search is recursive in both cases. | |
10158 | """ | |
0085ce49 | 10159 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
10160 | |
10161 | def Window_FromHWND(*args, **kwargs): | |
0085ce49 RD |
10162 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
10163 | return _core_.Window_FromHWND(*args, **kwargs) | |
b6b0383e | 10164 | |
0085ce49 RD |
10165 | def GetTopLevelWindows(*args): |
10166 | """ | |
b6b0383e RD |
10167 | GetTopLevelWindows() -> PyObject |
10168 | ||
10169 | Returns a list of the the application's top-level windows, (frames, | |
10170 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10171 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10172 | are closed or new top-level windows are created. | |
10173 | ||
10174 | """ | |
0085ce49 | 10175 | return _core_.GetTopLevelWindows(*args) |
e811c8ce RD |
10176 | #--------------------------------------------------------------------------- |
10177 | ||
10178 | class Validator(EvtHandler): | |
093d3ff1 | 10179 | """Proxy of C++ Validator class""" |
0085ce49 RD |
10180 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10181 | __repr__ = _swig_repr | |
10182 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10183 | """__init__(self) -> Validator""" |
0085ce49 | 10184 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d14a1e28 | 10185 | self._setOORInfo(self) |
e811c8ce RD |
10186 | |
10187 | def Clone(*args, **kwargs): | |
a95a7133 | 10188 | """Clone(self) -> Validator""" |
54f9ee45 | 10189 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
10190 | |
10191 | def Validate(*args, **kwargs): | |
a95a7133 | 10192 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 10193 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
10194 | |
10195 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 10196 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 10197 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
10198 | |
10199 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 10200 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 10201 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
10202 | |
10203 | def GetWindow(*args, **kwargs): | |
a95a7133 | 10204 | """GetWindow(self) -> Window""" |
54f9ee45 | 10205 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
10206 | |
10207 | def SetWindow(*args, **kwargs): | |
a95a7133 | 10208 | """SetWindow(self, Window window)""" |
54f9ee45 | 10209 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
10210 | |
10211 | def IsSilent(*args, **kwargs): | |
66c033b4 | 10212 | """IsSilent() -> bool""" |
54f9ee45 | 10213 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
10214 | |
10215 | IsSilent = staticmethod(IsSilent) | |
10216 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 10217 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 10218 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10219 | |
10220 | SetBellOnError = staticmethod(SetBellOnError) | |
2131d850 | 10221 | _core_.Validator_swigregister(Validator) |
e811c8ce | 10222 | |
0085ce49 RD |
10223 | def Validator_IsSilent(*args): |
10224 | """Validator_IsSilent() -> bool""" | |
10225 | return _core_.Validator_IsSilent(*args) | |
e811c8ce RD |
10226 | |
10227 | def Validator_SetBellOnError(*args, **kwargs): | |
0085ce49 RD |
10228 | """Validator_SetBellOnError(int doIt=True)""" |
10229 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
e811c8ce RD |
10230 | |
10231 | class PyValidator(Validator): | |
093d3ff1 | 10232 | """Proxy of C++ PyValidator class""" |
0085ce49 RD |
10233 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10234 | __repr__ = _swig_repr | |
10235 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10236 | """__init__(self) -> PyValidator""" |
0085ce49 | 10237 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
e811c8ce RD |
10238 | |
10239 | self._setCallbackInfo(self, PyValidator, 1) | |
10240 | self._setOORInfo(self) | |
10241 | ||
10242 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 10243 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" |
54f9ee45 | 10244 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce | 10245 | |
2131d850 | 10246 | _core_.PyValidator_swigregister(PyValidator) |
e811c8ce RD |
10247 | |
10248 | #--------------------------------------------------------------------------- | |
10249 | ||
10250 | class Menu(EvtHandler): | |
093d3ff1 | 10251 | """Proxy of C++ Menu class""" |
0085ce49 RD |
10252 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10253 | __repr__ = _swig_repr | |
10254 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10255 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
0085ce49 | 10256 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
e811c8ce RD |
10257 | self._setOORInfo(self) |
10258 | ||
10259 | def Append(*args, **kwargs): | |
97ab0f6a RD |
10260 | """ |
10261 | Append(self, int id, String text=EmptyString, String help=EmptyString, | |
10262 | int kind=ITEM_NORMAL) -> MenuItem | |
10263 | """ | |
54f9ee45 | 10264 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
10265 | |
10266 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 10267 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 10268 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
10269 | |
10270 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 10271 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10272 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
10273 | |
10274 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 10275 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10276 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
10277 | |
10278 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 10279 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10280 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce | 10281 | |
50efceee RD |
10282 | def AppendSubMenu(*args, **kwargs): |
10283 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
10284 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
10285 | ||
e811c8ce | 10286 | def AppendItem(*args, **kwargs): |
a95a7133 | 10287 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10288 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce | 10289 | |
e811c8ce | 10290 | def InsertItem(*args, **kwargs): |
a95a7133 | 10291 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 10292 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce | 10293 | |
0085ce49 RD |
10294 | def PrependItem(*args, **kwargs): |
10295 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10296 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10297 | ||
10298 | def Break(*args, **kwargs): | |
10299 | """Break(self)""" | |
10300 | return _core_.Menu_Break(*args, **kwargs) | |
10301 | ||
e811c8ce | 10302 | def Insert(*args, **kwargs): |
0df68c9f | 10303 | """ |
97ab0f6a | 10304 | Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString, |
a41e16b6 | 10305 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 10306 | """ |
54f9ee45 | 10307 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
10308 | |
10309 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 10310 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 10311 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
10312 | |
10313 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 10314 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10315 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
10316 | |
10317 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 10318 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10319 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
10320 | |
10321 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 10322 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10323 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce | 10324 | |
e811c8ce | 10325 | def Prepend(*args, **kwargs): |
97ab0f6a RD |
10326 | """ |
10327 | Prepend(self, int id, String text=EmptyString, String help=EmptyString, | |
10328 | int kind=ITEM_NORMAL) -> MenuItem | |
10329 | """ | |
54f9ee45 | 10330 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
10331 | |
10332 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 10333 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 10334 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
10335 | |
10336 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 10337 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10338 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
10339 | |
10340 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 10341 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10342 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
10343 | |
10344 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 10345 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10346 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
10347 | |
10348 | def Remove(*args, **kwargs): | |
a95a7133 | 10349 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 10350 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce RD |
10351 | |
10352 | def RemoveItem(*args, **kwargs): | |
a95a7133 | 10353 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10354 | return _core_.Menu_RemoveItem(*args, **kwargs) |
e811c8ce RD |
10355 | |
10356 | def Delete(*args, **kwargs): | |
a95a7133 | 10357 | """Delete(self, int id) -> bool""" |
54f9ee45 | 10358 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
10359 | |
10360 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 10361 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 10362 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
10363 | |
10364 | def Destroy(*args, **kwargs): | |
0df68c9f | 10365 | """ |
a95a7133 | 10366 | Destroy(self) |
e811c8ce | 10367 | |
0df68c9f RD |
10368 | Deletes the C++ object this Python object is a proxy for. |
10369 | """ | |
7e08d4ef RD |
10370 | val = _core_.Menu_Destroy(*args, **kwargs) |
10371 | args[0].thisown = 0 | |
10372 | return val | |
e811c8ce RD |
10373 | |
10374 | def DestroyId(*args, **kwargs): | |
0df68c9f | 10375 | """ |
a95a7133 | 10376 | DestroyId(self, int id) -> bool |
e811c8ce | 10377 | |
0df68c9f RD |
10378 | Deletes the C++ object this Python object is a proxy for. |
10379 | """ | |
7e08d4ef RD |
10380 | val = _core_.Menu_DestroyId(*args, **kwargs) |
10381 | args[0].thisown = 0 | |
10382 | return val | |
e811c8ce RD |
10383 | |
10384 | def DestroyItem(*args, **kwargs): | |
0df68c9f | 10385 | """ |
a95a7133 | 10386 | DestroyItem(self, MenuItem item) -> bool |
e811c8ce | 10387 | |
0df68c9f RD |
10388 | Deletes the C++ object this Python object is a proxy for. |
10389 | """ | |
7e08d4ef RD |
10390 | val = _core_.Menu_DestroyItem(*args, **kwargs) |
10391 | args[0].thisown = 0 | |
10392 | return val | |
e811c8ce RD |
10393 | |
10394 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 10395 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 10396 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
10397 | |
10398 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 10399 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 10400 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
10401 | |
10402 | def FindItem(*args, **kwargs): | |
a95a7133 | 10403 | """FindItem(self, String item) -> int""" |
54f9ee45 | 10404 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
10405 | |
10406 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10407 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10408 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
10409 | |
10410 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 10411 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 10412 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
10413 | |
10414 | def Enable(*args, **kwargs): | |
a95a7133 | 10415 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10416 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
10417 | |
10418 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10419 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10420 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10421 | |
10422 | def Check(*args, **kwargs): | |
a95a7133 | 10423 | """Check(self, int id, bool check)""" |
54f9ee45 | 10424 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
10425 | |
10426 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10427 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10428 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
10429 | |
10430 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10431 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10432 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
10433 | |
10434 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10435 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10436 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
10437 | |
10438 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10439 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10440 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10441 | |
10442 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10443 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10444 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10445 | |
10446 | def SetTitle(*args, **kwargs): | |
a95a7133 | 10447 | """SetTitle(self, String title)""" |
54f9ee45 | 10448 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
10449 | |
10450 | def GetTitle(*args, **kwargs): | |
a95a7133 | 10451 | """GetTitle(self) -> String""" |
54f9ee45 | 10452 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
10453 | |
10454 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 10455 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 10456 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
10457 | |
10458 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 10459 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 10460 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
10461 | |
10462 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10463 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 10464 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10465 | |
10466 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10467 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 10468 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10469 | |
10470 | def GetStyle(*args, **kwargs): | |
a95a7133 | 10471 | """GetStyle(self) -> long""" |
54f9ee45 | 10472 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
10473 | |
10474 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 10475 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 10476 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
10477 | |
10478 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 10479 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 10480 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
10481 | |
10482 | def Attach(*args, **kwargs): | |
a95a7133 | 10483 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 10484 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
10485 | |
10486 | def Detach(*args, **kwargs): | |
a95a7133 | 10487 | """Detach(self)""" |
54f9ee45 | 10488 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
10489 | |
10490 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10491 | """IsAttached(self) -> bool""" |
54f9ee45 | 10492 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
10493 | |
10494 | def SetParent(*args, **kwargs): | |
a95a7133 | 10495 | """SetParent(self, Menu parent)""" |
54f9ee45 | 10496 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
10497 | |
10498 | def GetParent(*args, **kwargs): | |
a95a7133 | 10499 | """GetParent(self) -> Menu""" |
54f9ee45 | 10500 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 10501 | |
57332a5a RD |
10502 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") |
10503 | HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`") | |
10504 | InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`") | |
10505 | MenuBar = property(GetMenuBar,doc="See `GetMenuBar`") | |
10506 | MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`") | |
10507 | MenuItems = property(GetMenuItems,doc="See `GetMenuItems`") | |
10508 | Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`") | |
10509 | Style = property(GetStyle,doc="See `GetStyle`") | |
10510 | Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`") | |
2131d850 | 10511 | _core_.Menu_swigregister(Menu) |
d14a1e28 RD |
10512 | DefaultValidator = cvar.DefaultValidator |
10513 | ||
10514 | #--------------------------------------------------------------------------- | |
10515 | ||
10516 | class MenuBar(Window): | |
093d3ff1 | 10517 | """Proxy of C++ MenuBar class""" |
0085ce49 RD |
10518 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10519 | __repr__ = _swig_repr | |
10520 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10521 | """__init__(self, long style=0) -> MenuBar""" |
0085ce49 | 10522 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d14a1e28 | 10523 | self._setOORInfo(self) |
e811c8ce RD |
10524 | |
10525 | def Append(*args, **kwargs): | |
a95a7133 | 10526 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 10527 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
10528 | |
10529 | def Insert(*args, **kwargs): | |
a95a7133 | 10530 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 10531 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
10532 | |
10533 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 10534 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 10535 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
10536 | |
10537 | def GetMenu(*args, **kwargs): | |
a95a7133 | 10538 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 10539 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
10540 | |
10541 | def Replace(*args, **kwargs): | |
a95a7133 | 10542 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 10543 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
10544 | |
10545 | def Remove(*args, **kwargs): | |
a95a7133 | 10546 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 10547 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
10548 | |
10549 | def EnableTop(*args, **kwargs): | |
a95a7133 | 10550 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 10551 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
10552 | |
10553 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 10554 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 10555 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
10556 | |
10557 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 10558 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 10559 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
10560 | |
10561 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 10562 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 10563 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
10564 | |
10565 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 10566 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 10567 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
10568 | |
10569 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10570 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10571 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
10572 | |
10573 | def FindMenu(*args, **kwargs): | |
a95a7133 | 10574 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 10575 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
10576 | |
10577 | def Enable(*args, **kwargs): | |
a95a7133 | 10578 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10579 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
10580 | |
10581 | def Check(*args, **kwargs): | |
a95a7133 | 10582 | """Check(self, int id, bool check)""" |
54f9ee45 | 10583 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
10584 | |
10585 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10586 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10587 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
10588 | |
10589 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10590 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10591 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10592 | |
10593 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10594 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10595 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
10596 | |
10597 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10598 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10599 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
10600 | |
10601 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10602 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10603 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10604 | |
10605 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10606 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10607 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10608 | |
10609 | def GetFrame(*args, **kwargs): | |
a95a7133 | 10610 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 10611 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
10612 | |
10613 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10614 | """IsAttached(self) -> bool""" |
54f9ee45 | 10615 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
10616 | |
10617 | def Attach(*args, **kwargs): | |
a95a7133 | 10618 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 10619 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
10620 | |
10621 | def Detach(*args, **kwargs): | |
a95a7133 | 10622 | """Detach(self)""" |
54f9ee45 | 10623 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 10624 | |
587d0f36 RD |
10625 | def UpdateMenus(*args, **kwargs): |
10626 | """UpdateMenus(self)""" | |
10627 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
10628 | ||
4f433fef RD |
10629 | def SetAutoWindowMenu(*args, **kwargs): |
10630 | """SetAutoWindowMenu(bool enable)""" | |
10631 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10632 | ||
10633 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10634 | def GetAutoWindowMenu(*args, **kwargs): | |
10635 | """GetAutoWindowMenu() -> bool""" | |
10636 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10637 | ||
10638 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
97ab0f6a RD |
10639 | def GetMenus(self): |
10640 | """Return a list of (menu, label) items for the menus in the MenuBar. """ | |
10641 | return [(self.GetMenu(i), self.GetLabelTop(i)) | |
10642 | for i in range(self.GetMenuCount())] | |
10643 | ||
10644 | def SetMenus(self, items): | |
10645 | """Clear and add new menus to the MenuBar from a list of (menu, label) items. """ | |
10646 | for i in range(self.GetMenuCount()-1, -1, -1): | |
10647 | self.Remove(i) | |
10648 | for m, l in items: | |
10649 | self.Append(m, l) | |
10650 | ||
57332a5a RD |
10651 | Frame = property(GetFrame,doc="See `GetFrame`") |
10652 | Menu = property(GetMenu,doc="See `GetMenu`") | |
10653 | MenuCount = property(GetMenuCount,doc="See `GetMenuCount`") | |
10654 | Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`") | |
2131d850 | 10655 | _core_.MenuBar_swigregister(MenuBar) |
d14a1e28 | 10656 | |
4f433fef | 10657 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
0085ce49 RD |
10658 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
10659 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 10660 | |
0085ce49 RD |
10661 | def MenuBar_GetAutoWindowMenu(*args): |
10662 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10663 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 10664 | |
d14a1e28 RD |
10665 | #--------------------------------------------------------------------------- |
10666 | ||
10667 | class MenuItem(Object): | |
093d3ff1 | 10668 | """Proxy of C++ MenuItem class""" |
0085ce49 RD |
10669 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10670 | __repr__ = _swig_repr | |
10671 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10672 | """ |
a95a7133 | 10673 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
196addbf RD |
10674 | String help=EmptyString, int kind=ITEM_NORMAL, |
10675 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 10676 | """ |
0085ce49 RD |
10677 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
10678 | __swig_destroy__ = _core_.delete_MenuItem | |
10679 | __del__ = lambda self : None; | |
e811c8ce | 10680 | def GetMenu(*args, **kwargs): |
a95a7133 | 10681 | """GetMenu(self) -> Menu""" |
54f9ee45 | 10682 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
10683 | |
10684 | def SetMenu(*args, **kwargs): | |
a95a7133 | 10685 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 10686 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
10687 | |
10688 | def SetId(*args, **kwargs): | |
a95a7133 | 10689 | """SetId(self, int id)""" |
54f9ee45 | 10690 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
10691 | |
10692 | def GetId(*args, **kwargs): | |
a95a7133 | 10693 | """GetId(self) -> int""" |
54f9ee45 | 10694 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
10695 | |
10696 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 10697 | """IsSeparator(self) -> bool""" |
54f9ee45 | 10698 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
10699 | |
10700 | def SetText(*args, **kwargs): | |
a95a7133 | 10701 | """SetText(self, String str)""" |
54f9ee45 | 10702 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
10703 | |
10704 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10705 | """GetLabel(self) -> String""" |
54f9ee45 | 10706 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
10707 | |
10708 | def GetText(*args, **kwargs): | |
a95a7133 | 10709 | """GetText(self) -> String""" |
54f9ee45 | 10710 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
10711 | |
10712 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 10713 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 10714 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
10715 | |
10716 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10717 | def GetKind(*args, **kwargs): | |
a95a7133 | 10718 | """GetKind(self) -> int""" |
54f9ee45 | 10719 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 10720 | |
a95a7133 RD |
10721 | def SetKind(*args, **kwargs): |
10722 | """SetKind(self, int kind)""" | |
54f9ee45 | 10723 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 10724 | |
e811c8ce | 10725 | def SetCheckable(*args, **kwargs): |
a95a7133 | 10726 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 10727 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
10728 | |
10729 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 10730 | """IsCheckable(self) -> bool""" |
54f9ee45 | 10731 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
10732 | |
10733 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 10734 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 10735 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
10736 | |
10737 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 10738 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 10739 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
10740 | |
10741 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 10742 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 10743 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
10744 | |
10745 | def Enable(*args, **kwargs): | |
a95a7133 | 10746 | """Enable(self, bool enable=True)""" |
54f9ee45 | 10747 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
10748 | |
10749 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10750 | """IsEnabled(self) -> bool""" |
54f9ee45 | 10751 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10752 | |
10753 | def Check(*args, **kwargs): | |
a95a7133 | 10754 | """Check(self, bool check=True)""" |
54f9ee45 | 10755 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
10756 | |
10757 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10758 | """IsChecked(self) -> bool""" |
54f9ee45 | 10759 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
10760 | |
10761 | def Toggle(*args, **kwargs): | |
a95a7133 | 10762 | """Toggle(self)""" |
54f9ee45 | 10763 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
10764 | |
10765 | def SetHelp(*args, **kwargs): | |
a95a7133 | 10766 | """SetHelp(self, String str)""" |
54f9ee45 | 10767 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
10768 | |
10769 | def GetHelp(*args, **kwargs): | |
a95a7133 | 10770 | """GetHelp(self) -> String""" |
54f9ee45 | 10771 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
10772 | |
10773 | def GetAccel(*args, **kwargs): | |
a95a7133 | 10774 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 10775 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
10776 | |
10777 | def SetAccel(*args, **kwargs): | |
a95a7133 | 10778 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 10779 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 10780 | |
091f5bed RD |
10781 | def SetBitmap(*args, **kwargs): |
10782 | """SetBitmap(self, Bitmap bitmap)""" | |
10783 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10784 | ||
10785 | def GetBitmap(*args, **kwargs): | |
10786 | """GetBitmap(self) -> Bitmap""" | |
10787 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10788 | ||
c1280d1e RD |
10789 | def SetFont(*args, **kwargs): |
10790 | """SetFont(self, Font font)""" | |
10791 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10792 | ||
10793 | def GetFont(*args, **kwargs): | |
10794 | """GetFont(self) -> Font""" | |
10795 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10796 | ||
10797 | def SetTextColour(*args, **kwargs): | |
10798 | """SetTextColour(self, Colour colText)""" | |
10799 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10800 | ||
10801 | def GetTextColour(*args, **kwargs): | |
10802 | """GetTextColour(self) -> Colour""" | |
10803 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10804 | ||
10805 | def SetBackgroundColour(*args, **kwargs): | |
10806 | """SetBackgroundColour(self, Colour colBack)""" | |
10807 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10808 | ||
10809 | def GetBackgroundColour(*args, **kwargs): | |
10810 | """GetBackgroundColour(self) -> Colour""" | |
10811 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10812 | ||
10813 | def SetBitmaps(*args, **kwargs): | |
10814 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10815 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10816 | ||
10817 | def SetDisabledBitmap(*args, **kwargs): | |
10818 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10819 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10820 | ||
10821 | def GetDisabledBitmap(*args, **kwargs): | |
10822 | """GetDisabledBitmap(self) -> Bitmap""" | |
10823 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10824 | ||
10825 | def SetMarginWidth(*args, **kwargs): | |
10826 | """SetMarginWidth(self, int nWidth)""" | |
10827 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10828 | ||
10829 | def GetMarginWidth(*args, **kwargs): | |
10830 | """GetMarginWidth(self) -> int""" | |
10831 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10832 | ||
e811c8ce | 10833 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 10834 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 10835 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
10836 | |
10837 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10838 | def IsOwnerDrawn(*args, **kwargs): |
10839 | """IsOwnerDrawn(self) -> bool""" | |
10840 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10841 | ||
10842 | def SetOwnerDrawn(*args, **kwargs): | |
10843 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10844 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10845 | ||
10846 | def ResetOwnerDrawn(*args, **kwargs): | |
10847 | """ResetOwnerDrawn(self)""" | |
10848 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10849 | ||
57332a5a RD |
10850 | Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`") |
10851 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
10852 | Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`") | |
10853 | DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`") | |
10854 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
10855 | Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`") | |
10856 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
10857 | Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`") | |
10858 | Label = property(GetLabel,doc="See `GetLabel`") | |
10859 | MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`") | |
10860 | Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`") | |
10861 | SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`") | |
10862 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
10863 | TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`") | |
2131d850 | 10864 | _core_.MenuItem_swigregister(MenuItem) |
d14a1e28 | 10865 | |
e811c8ce | 10866 | def MenuItem_GetLabelFromText(*args, **kwargs): |
0085ce49 RD |
10867 | """MenuItem_GetLabelFromText(String text) -> String""" |
10868 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d14a1e28 | 10869 | |
0085ce49 RD |
10870 | def MenuItem_GetDefaultMarginWidth(*args): |
10871 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10872 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d14a1e28 RD |
10873 | |
10874 | #--------------------------------------------------------------------------- | |
10875 | ||
10876 | class Control(Window): | |
15afbcd0 RD |
10877 | """ |
10878 | This is the base class for a control or 'widget'. | |
10879 | ||
41e2b43e RD |
10880 | A control is generally a small window which processes user input |
10881 | and/or displays one or more item of data. | |
15afbcd0 | 10882 | """ |
0085ce49 RD |
10883 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10884 | __repr__ = _swig_repr | |
10885 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10886 | """ |
248ed943 RD |
10887 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10888 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10889 | String name=ControlNameStr) -> Control |
15afbcd0 | 10890 | |
41e2b43e RD |
10891 | Create a Control. Normally you should only call this from a subclass' |
10892 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 10893 | """ |
0085ce49 | 10894 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d14a1e28 | 10895 | self._setOORInfo(self) |
e811c8ce RD |
10896 | |
10897 | def Create(*args, **kwargs): | |
0df68c9f | 10898 | """ |
248ed943 RD |
10899 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10900 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10901 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
10902 | |
10903 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 10904 | """ |
54f9ee45 | 10905 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce | 10906 | |
10044bf1 RD |
10907 | def GetAlignment(*args, **kwargs): |
10908 | """ | |
10909 | GetAlignment(self) -> int | |
10910 | ||
10911 | Get the control alignment (left/right/centre, top/bottom/centre) | |
10912 | """ | |
10913 | return _core_.Control_GetAlignment(*args, **kwargs) | |
10914 | ||
34e0a3bb | 10915 | def GetLabelText(*args, **kwargs): |
10044bf1 | 10916 | """ |
10044bf1 RD |
10917 | GetLabelText(self) -> String |
10918 | ||
10919 | Get just the text of the label, without mnemonic characters ('&') | |
10920 | """ | |
34e0a3bb | 10921 | return _core_.Control_GetLabelText(*args, **kwargs) |
10044bf1 | 10922 | |
e811c8ce | 10923 | def Command(*args, **kwargs): |
15afbcd0 | 10924 | """ |
a95a7133 | 10925 | Command(self, CommandEvent event) |
15afbcd0 | 10926 | |
41e2b43e RD |
10927 | Simulates the effect of the user issuing a command to the item. |
10928 | ||
10929 | :see: `wx.CommandEvent` | |
10930 | ||
15afbcd0 | 10931 | """ |
54f9ee45 | 10932 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce RD |
10933 | |
10934 | def GetLabel(*args, **kwargs): | |
15afbcd0 | 10935 | """ |
a95a7133 | 10936 | GetLabel(self) -> String |
15afbcd0 RD |
10937 | |
10938 | Return a control's text. | |
10939 | """ | |
54f9ee45 | 10940 | return _core_.Control_GetLabel(*args, **kwargs) |
e811c8ce | 10941 | |
74a57fcd | 10942 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
10943 | """ |
10944 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10945 | ||
10946 | Get the default attributes for this class. This is useful if you want | |
10947 | to use the same font or colour in your own control as in a standard | |
10948 | control -- which is a much better idea than hard coding specific | |
10949 | colours or fonts which might look completely out of place on the | |
10950 | user's system, especially if it uses themes. | |
10951 | ||
10952 | The variant parameter is only relevant under Mac currently and is | |
10953 | ignore under other platforms. Under Mac, it will change the size of | |
10954 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10955 | this. | |
10956 | """ | |
54f9ee45 | 10957 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
10958 | |
10959 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2bf58437 RD |
10960 | Alignment = property(GetAlignment,doc="See `GetAlignment`") |
10961 | Label = property(GetLabel,doc="See `GetLabel`") | |
10962 | LabelText = property(GetLabelText,doc="See `GetLabelText`") | |
2131d850 | 10963 | _core_.Control_swigregister(Control) |
b2dc1044 | 10964 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
10965 | |
10966 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
10967 | """ |
10968 | PreControl() -> Control | |
10969 | ||
10970 | Precreate a Control control for 2-phase creation | |
10971 | """ | |
54f9ee45 | 10972 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
10973 | return val |
10974 | ||
74a57fcd | 10975 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10976 | """ |
110da5b0 RD |
10977 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10978 | ||
10979 | Get the default attributes for this class. This is useful if you want | |
10980 | to use the same font or colour in your own control as in a standard | |
10981 | control -- which is a much better idea than hard coding specific | |
10982 | colours or fonts which might look completely out of place on the | |
10983 | user's system, especially if it uses themes. | |
10984 | ||
10985 | The variant parameter is only relevant under Mac currently and is | |
10986 | ignore under other platforms. Under Mac, it will change the size of | |
10987 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10988 | this. | |
10989 | """ | |
0085ce49 | 10990 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10991 | |
d14a1e28 RD |
10992 | #--------------------------------------------------------------------------- |
10993 | ||
10994 | class ItemContainer(object): | |
15afbcd0 | 10995 | """ |
53aa7709 RD |
10996 | The wx.ItemContainer class defines an interface which is implemented |
10997 | by all controls which have string subitems, each of which may be | |
10998 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10999 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 11000 | this one. |
15afbcd0 | 11001 | |
41e2b43e RD |
11002 | It defines the methods for accessing the control's items and although |
11003 | each of the derived classes implements them differently, they still | |
11004 | all conform to the same interface. | |
15afbcd0 | 11005 | |
41e2b43e RD |
11006 | The items in a wx.ItemContainer have (non empty) string labels and, |
11007 | optionally, client data associated with them. | |
15afbcd0 RD |
11008 | |
11009 | """ | |
0085ce49 RD |
11010 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11011 | def __init__(self): raise AttributeError, "No constructor defined" | |
11012 | __repr__ = _swig_repr | |
e811c8ce | 11013 | def Append(*args, **kwargs): |
15afbcd0 | 11014 | """ |
a95a7133 | 11015 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 11016 | |
41e2b43e RD |
11017 | Adds the item to the control, associating the given data with the item |
11018 | if not None. The return value is the index of the newly added item | |
11019 | which may be different from the last one if the control is sorted (e.g. | |
11020 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 11021 | """ |
54f9ee45 | 11022 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
11023 | |
11024 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 11025 | """ |
f5b96ee1 | 11026 | AppendItems(self, List strings) |
15afbcd0 | 11027 | |
41e2b43e RD |
11028 | Apend several items at once to the control. Notice that calling this |
11029 | method may be much faster than appending the items one by one if you | |
11030 | need to add a lot of items. | |
15afbcd0 | 11031 | """ |
54f9ee45 | 11032 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
11033 | |
11034 | def Insert(*args, **kwargs): | |
15afbcd0 | 11035 | """ |
50f151d7 | 11036 | Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int |
15afbcd0 | 11037 | |
41e2b43e | 11038 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
11039 | optionally associating some data object with the item. |
11040 | """ | |
54f9ee45 | 11041 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
11042 | |
11043 | def Clear(*args, **kwargs): | |
15afbcd0 | 11044 | """ |
a95a7133 | 11045 | Clear(self) |
15afbcd0 RD |
11046 | |
11047 | Removes all items from the control. | |
11048 | """ | |
54f9ee45 | 11049 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
11050 | |
11051 | def Delete(*args, **kwargs): | |
15afbcd0 | 11052 | """ |
50f151d7 | 11053 | Delete(self, unsigned int n) |
15afbcd0 | 11054 | |
41e2b43e RD |
11055 | Deletes the item at the zero-based index 'n' from the control. Note |
11056 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11057 | enabled) to remove an item with the index negative or greater or equal | |
11058 | than the number of items in the control. | |
15afbcd0 | 11059 | """ |
54f9ee45 | 11060 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 11061 | |
53aa7709 RD |
11062 | def GetClientData(*args, **kwargs): |
11063 | """ | |
50f151d7 | 11064 | GetClientData(self, unsigned int n) -> PyObject |
53aa7709 RD |
11065 | |
11066 | Returns the client data associated with the given item, (if any.) | |
11067 | """ | |
11068 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
11069 | ||
11070 | def SetClientData(*args, **kwargs): | |
11071 | """ | |
50f151d7 | 11072 | SetClientData(self, unsigned int n, PyObject clientData) |
53aa7709 RD |
11073 | |
11074 | Associate the given client data with the item at position n. | |
11075 | """ | |
11076 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
11077 | ||
e811c8ce | 11078 | def GetCount(*args, **kwargs): |
15afbcd0 | 11079 | """ |
50f151d7 | 11080 | GetCount(self) -> unsigned int |
15afbcd0 RD |
11081 | |
11082 | Returns the number of items in the control. | |
11083 | """ | |
54f9ee45 | 11084 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
11085 | |
11086 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 11087 | """ |
a95a7133 | 11088 | IsEmpty(self) -> bool |
15afbcd0 RD |
11089 | |
11090 | Returns True if the control is empty or False if it has some items. | |
11091 | """ | |
54f9ee45 | 11092 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
11093 | |
11094 | def GetString(*args, **kwargs): | |
15afbcd0 | 11095 | """ |
50f151d7 | 11096 | GetString(self, unsigned int n) -> String |
15afbcd0 RD |
11097 | |
11098 | Returns the label of the item with the given index. | |
11099 | """ | |
54f9ee45 | 11100 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
11101 | |
11102 | def GetStrings(*args, **kwargs): | |
a95a7133 | 11103 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 11104 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
11105 | |
11106 | def SetString(*args, **kwargs): | |
15afbcd0 | 11107 | """ |
50f151d7 | 11108 | SetString(self, unsigned int n, String s) |
15afbcd0 RD |
11109 | |
11110 | Sets the label for the given item. | |
11111 | """ | |
54f9ee45 | 11112 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
11113 | |
11114 | def FindString(*args, **kwargs): | |
15afbcd0 | 11115 | """ |
a95a7133 | 11116 | FindString(self, String s) -> int |
15afbcd0 RD |
11117 | |
11118 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
11119 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11120 | found. | |
15afbcd0 | 11121 | """ |
54f9ee45 | 11122 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 11123 | |
53aa7709 | 11124 | def SetSelection(*args, **kwargs): |
15afbcd0 | 11125 | """ |
53aa7709 | 11126 | SetSelection(self, int n) |
15afbcd0 RD |
11127 | |
11128 | Sets the item at index 'n' to be the selected item. | |
11129 | """ | |
53aa7709 | 11130 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
11131 | |
11132 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 11133 | """ |
a95a7133 | 11134 | GetSelection(self) -> int |
15afbcd0 | 11135 | |
41e2b43e RD |
11136 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11137 | is selected. | |
15afbcd0 | 11138 | """ |
54f9ee45 | 11139 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 11140 | |
53aa7709 RD |
11141 | def SetStringSelection(*args, **kwargs): |
11142 | """SetStringSelection(self, String s) -> bool""" | |
11143 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11144 | ||
e811c8ce | 11145 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 11146 | """ |
a95a7133 | 11147 | GetStringSelection(self) -> String |
15afbcd0 | 11148 | |
41e2b43e RD |
11149 | Returns the label of the selected item or an empty string if no item |
11150 | is selected. | |
15afbcd0 | 11151 | """ |
54f9ee45 | 11152 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 11153 | |
53aa7709 | 11154 | def Select(*args, **kwargs): |
15afbcd0 | 11155 | """ |
53aa7709 | 11156 | Select(self, int n) |
15afbcd0 | 11157 | |
53aa7709 RD |
11158 | This is the same as `SetSelection` and exists only because it is |
11159 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 11160 | """ |
53aa7709 | 11161 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 11162 | |
97ab0f6a RD |
11163 | def GetItems(self): |
11164 | """Return a list of the strings in the control""" | |
11165 | return [self.GetString(i) for i in xrange(self.GetCount())] | |
11166 | ||
11167 | def SetItems(self, items): | |
11168 | """Clear and set the strings in the control from a list""" | |
11169 | self.Clear() | |
11170 | for i in items: | |
11171 | self.Append(i) | |
11172 | ||
11173 | Count = property(GetCount,doc="See `GetCount`") | |
11174 | Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`") | |
11175 | Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`") | |
11176 | StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`") | |
11177 | Strings = property(GetStrings,doc="See `GetStrings`") | |
2131d850 | 11178 | _core_.ItemContainer_swigregister(ItemContainer) |
d14a1e28 RD |
11179 | |
11180 | #--------------------------------------------------------------------------- | |
11181 | ||
11182 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 11183 | """ |
41e2b43e RD |
11184 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11185 | wx.Control class, and is used for the base class of various controls | |
11186 | that have items. | |
15afbcd0 | 11187 | """ |
0085ce49 RD |
11188 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11189 | def __init__(self): raise AttributeError, "No constructor defined" | |
11190 | __repr__ = _swig_repr | |
2131d850 | 11191 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d14a1e28 RD |
11192 | |
11193 | #--------------------------------------------------------------------------- | |
11194 | ||
11195 | class SizerItem(Object): | |
248ed943 RD |
11196 | """ |
11197 | The wx.SizerItem class is used to track the position, size and other | |
01f6b6d3 RD |
11198 | attributes of each item managed by a `wx.Sizer`. It is not usually |
11199 | necessary to use this class because the sizer elements can also be | |
11200 | identified by their positions or window or sizer references but | |
11201 | sometimes it may be more convenient to use wx.SizerItem directly. | |
11202 | Also, custom classes derived from `wx.PySizer` will probably need to | |
11203 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
11204 | layout. | |
248ed943 RD |
11205 | |
11206 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11207 | """ | |
0085ce49 RD |
11208 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11209 | __repr__ = _swig_repr | |
11210 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11211 | """ |
11212 | __init__(self) -> SizerItem | |
11213 | ||
11214 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11215 | size will need to be set before this item can be used in a Sizer. | |
11216 | ||
11217 | You will probably never need to create a wx.SizerItem directly as they | |
11218 | are created automatically when the sizer's Add, Insert or Prepend | |
11219 | methods are called. | |
11220 | ||
11221 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11222 | """ | |
0085ce49 RD |
11223 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
11224 | __swig_destroy__ = _core_.delete_SizerItem | |
11225 | __del__ = lambda self : None; | |
e811c8ce | 11226 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
11227 | """ |
11228 | DeleteWindows(self) | |
11229 | ||
11230 | Destroy the window or the windows in a subsizer, depending on the type | |
11231 | of item. | |
11232 | """ | |
54f9ee45 | 11233 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11234 | |
11235 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
11236 | """ |
11237 | DetachSizer(self) | |
11238 | ||
11239 | Enable deleting the SizerItem without destroying the contained sizer. | |
11240 | """ | |
54f9ee45 | 11241 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
11242 | |
11243 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11244 | """ |
11245 | GetSize(self) -> Size | |
11246 | ||
11247 | Get the current size of the item, as set in the last Layout. | |
11248 | """ | |
54f9ee45 | 11249 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
11250 | |
11251 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11252 | """ |
11253 | CalcMin(self) -> Size | |
11254 | ||
11255 | Calculates the minimum desired size for the item, including any space | |
11256 | needed by borders. | |
11257 | """ | |
54f9ee45 | 11258 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
11259 | |
11260 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
11261 | """ |
11262 | SetDimension(self, Point pos, Size size) | |
11263 | ||
11264 | Set the position and size of the space allocated for this item by the | |
11265 | sizer, and adjust the position and size of the item (window or | |
11266 | subsizer) to be within that space taking alignment and borders into | |
11267 | account. | |
11268 | """ | |
54f9ee45 | 11269 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
11270 | |
11271 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11272 | """ |
11273 | GetMinSize(self) -> Size | |
11274 | ||
11275 | Get the minimum size needed for the item. | |
11276 | """ | |
54f9ee45 | 11277 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 11278 | |
dfbb5885 RD |
11279 | def GetMinSizeWithBorder(*args, **kwargs): |
11280 | """ | |
11281 | GetMinSizeWithBorder(self) -> Size | |
11282 | ||
11283 | Get the minimum size needed for the item with space for the borders | |
11284 | added, if needed. | |
11285 | """ | |
11286 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11287 | ||
e811c8ce | 11288 | def SetInitSize(*args, **kwargs): |
a95a7133 | 11289 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 11290 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
11291 | |
11292 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
11293 | """ |
11294 | SetRatioWH(self, int width, int height) | |
11295 | ||
11296 | Set the ratio item attribute. | |
11297 | """ | |
54f9ee45 | 11298 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
11299 | |
11300 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
11301 | """ |
11302 | SetRatioSize(self, Size size) | |
11303 | ||
11304 | Set the ratio item attribute. | |
11305 | """ | |
54f9ee45 | 11306 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
11307 | |
11308 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
11309 | """ |
11310 | SetRatio(self, float ratio) | |
11311 | ||
11312 | Set the ratio item attribute. | |
11313 | """ | |
54f9ee45 | 11314 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
11315 | |
11316 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
11317 | """ |
11318 | GetRatio(self) -> float | |
11319 | ||
11320 | Set the ratio item attribute. | |
11321 | """ | |
54f9ee45 | 11322 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 11323 | |
d3b6e4ff RD |
11324 | def GetRect(*args, **kwargs): |
11325 | """ | |
11326 | GetRect(self) -> Rect | |
11327 | ||
11328 | Returns the rectangle that the sizer item should occupy | |
11329 | """ | |
11330 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
11331 | ||
e811c8ce | 11332 | def IsWindow(*args, **kwargs): |
248ed943 RD |
11333 | """ |
11334 | IsWindow(self) -> bool | |
11335 | ||
11336 | Is this sizer item a window? | |
11337 | """ | |
54f9ee45 | 11338 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
11339 | |
11340 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
11341 | """ |
11342 | IsSizer(self) -> bool | |
11343 | ||
11344 | Is this sizer item a subsizer? | |
11345 | """ | |
54f9ee45 | 11346 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
11347 | |
11348 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
11349 | """ |
11350 | IsSpacer(self) -> bool | |
11351 | ||
11352 | Is this sizer item a spacer? | |
11353 | """ | |
54f9ee45 | 11354 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
11355 | |
11356 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
11357 | """ |
11358 | SetProportion(self, int proportion) | |
11359 | ||
11360 | Set the proportion value for this item. | |
11361 | """ | |
54f9ee45 | 11362 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
11363 | |
11364 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
11365 | """ |
11366 | GetProportion(self) -> int | |
11367 | ||
11368 | Get the proportion value for this item. | |
11369 | """ | |
54f9ee45 | 11370 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 11371 | |
248ed943 RD |
11372 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11373 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 11374 | def SetFlag(*args, **kwargs): |
248ed943 RD |
11375 | """ |
11376 | SetFlag(self, int flag) | |
11377 | ||
11378 | Set the flag value for this item. | |
11379 | """ | |
54f9ee45 | 11380 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
11381 | |
11382 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
11383 | """ |
11384 | GetFlag(self) -> int | |
11385 | ||
11386 | Get the flag value for this item. | |
11387 | """ | |
54f9ee45 | 11388 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
11389 | |
11390 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
11391 | """ |
11392 | SetBorder(self, int border) | |
11393 | ||
11394 | Set the border value for this item. | |
11395 | """ | |
54f9ee45 | 11396 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
11397 | |
11398 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
11399 | """ |
11400 | GetBorder(self) -> int | |
11401 | ||
11402 | Get the border value for this item. | |
11403 | """ | |
54f9ee45 | 11404 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
11405 | |
11406 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
11407 | """ |
11408 | GetWindow(self) -> Window | |
11409 | ||
11410 | Get the window (if any) that is managed by this sizer item. | |
11411 | """ | |
54f9ee45 | 11412 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce RD |
11413 | |
11414 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
11415 | """ |
11416 | SetWindow(self, Window window) | |
11417 | ||
11418 | Set the window to be managed by this sizer item. | |
11419 | """ | |
54f9ee45 | 11420 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
e811c8ce RD |
11421 | |
11422 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
11423 | """ |
11424 | GetSizer(self) -> Sizer | |
11425 | ||
11426 | Get the subsizer (if any) that is managed by this sizer item. | |
11427 | """ | |
54f9ee45 | 11428 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce RD |
11429 | |
11430 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
11431 | """ |
11432 | SetSizer(self, Sizer sizer) | |
11433 | ||
11434 | Set the subsizer to be managed by this sizer item. | |
11435 | """ | |
54f9ee45 | 11436 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce RD |
11437 | |
11438 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
11439 | """ |
11440 | GetSpacer(self) -> Size | |
11441 | ||
11442 | Get the size of the spacer managed by this sizer item. | |
11443 | """ | |
54f9ee45 | 11444 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
e811c8ce RD |
11445 | |
11446 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
11447 | """ |
11448 | SetSpacer(self, Size size) | |
11449 | ||
11450 | Set the size of the spacer to be managed by this sizer item. | |
11451 | """ | |
54f9ee45 | 11452 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce RD |
11453 | |
11454 | def Show(*args, **kwargs): | |
248ed943 RD |
11455 | """ |
11456 | Show(self, bool show) | |
11457 | ||
11458 | Set the show item attribute, which sizers use to determine if the item | |
11459 | is to be made part of the layout or not. If the item is tracking a | |
11460 | window then it is shown or hidden as needed. | |
11461 | """ | |
54f9ee45 | 11462 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
11463 | |
11464 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11465 | """ |
11466 | IsShown(self) -> bool | |
11467 | ||
11468 | Is the item to be shown in the layout? | |
11469 | """ | |
54f9ee45 | 11470 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
11471 | |
11472 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11473 | """ |
11474 | GetPosition(self) -> Point | |
11475 | ||
11476 | Returns the current position of the item, as set in the last Layout. | |
11477 | """ | |
54f9ee45 | 11478 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
11479 | |
11480 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
11481 | """ |
11482 | GetUserData(self) -> PyObject | |
11483 | ||
11484 | Returns the userData associated with this sizer item, or None if there | |
11485 | isn't any. | |
11486 | """ | |
54f9ee45 | 11487 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 11488 | |
091f5bed RD |
11489 | def SetUserData(*args, **kwargs): |
11490 | """ | |
11491 | SetUserData(self, PyObject userData) | |
11492 | ||
11493 | Associate a Python object with this sizer item. | |
11494 | """ | |
11495 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
11496 | ||
33d6fd3b RD |
11497 | Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`") |
11498 | Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`") | |
11499 | MinSize = property(GetMinSize,doc="See `GetMinSize`") | |
11500 | MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`") | |
11501 | Position = property(GetPosition,doc="See `GetPosition`") | |
11502 | Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`") | |
11503 | Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`") | |
11504 | Rect = property(GetRect,doc="See `GetRect`") | |
11505 | Size = property(GetSize,doc="See `GetSize`") | |
11506 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
11507 | Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`") | |
11508 | UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`") | |
11509 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") | |
2131d850 | 11510 | _core_.SizerItem_swigregister(SizerItem) |
d14a1e28 | 11511 | |
248ed943 | 11512 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 11513 | """ |
248ed943 RD |
11514 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11515 | PyObject userData=None) -> SizerItem | |
11516 | ||
11517 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 11518 | """ |
248ed943 | 11519 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
11520 | return val |
11521 | ||
248ed943 | 11522 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 11523 | """ |
248ed943 RD |
11524 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
11525 | PyObject userData=None) -> SizerItem | |
11526 | ||
11527 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 11528 | """ |
248ed943 | 11529 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
11530 | return val |
11531 | ||
11532 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
11533 | """ |
11534 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
11535 | PyObject userData=None) -> SizerItem |
11536 | ||
11537 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 11538 | """ |
54f9ee45 | 11539 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
11540 | return val |
11541 | ||
11542 | class Sizer(Object): | |
248ed943 RD |
11543 | """ |
11544 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11545 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11546 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
1d5ee749 RD |
11547 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and |
11548 | `wx.GridBagSizer`. | |
248ed943 RD |
11549 | |
11550 | The concept implemented by sizers in wxWidgets is closely related to | |
11551 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11552 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11553 | subwindows reporting their minimal required size and their ability to | |
11554 | get stretched if the size of the parent window has changed. This will | |
11555 | most often mean that the programmer does not set the original size of | |
11556 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11557 | this sizer will be queried about the recommended size. The sizer in | |
11558 | turn will query its children, which can be normal windows or contorls, | |
11559 | empty space or other sizers, so that a hierarchy of sizers can be | |
11560 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11561 | do not interfere with tab ordering and requires very little resources | |
11562 | compared to a real window on screen. | |
11563 | ||
11564 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11565 | every control reports its own minimal size and the algorithm can | |
11566 | handle differences in font sizes or different window (dialog item) | |
11567 | sizes on different platforms without problems. If for example the | |
11568 | standard font as well as the overall design of Mac widgets requires | |
11569 | more space than on Windows, then the initial size of a dialog using a | |
11570 | sizer will automatically be bigger on Mac than on Windows. | |
11571 | """ | |
0085ce49 RD |
11572 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11573 | def __init__(self): raise AttributeError, "No constructor defined" | |
11574 | __repr__ = _swig_repr | |
11575 | __swig_destroy__ = _core_.delete_Sizer | |
11576 | __del__ = lambda self : None; | |
e811c8ce | 11577 | def _setOORInfo(*args, **kwargs): |
a95a7133 | 11578 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 11579 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
11580 | |
11581 | def Add(*args, **kwargs): | |
0df68c9f | 11582 | """ |
248ed943 | 11583 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11584 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11585 | |
11586 | Appends a child item to the sizer. | |
0df68c9f | 11587 | """ |
54f9ee45 | 11588 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce RD |
11589 | |
11590 | def Insert(*args, **kwargs): | |
0df68c9f | 11591 | """ |
248ed943 | 11592 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11593 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11594 | |
11595 | Inserts a new item into the list of items managed by this sizer before | |
11596 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 11597 | """ |
54f9ee45 | 11598 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce RD |
11599 | |
11600 | def Prepend(*args, **kwargs): | |
0df68c9f | 11601 | """ |
248ed943 | 11602 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11603 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11604 | |
11605 | Adds a new item to the begining of the list of sizer items managed by | |
11606 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 11607 | """ |
54f9ee45 | 11608 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce RD |
11609 | |
11610 | def Remove(*args, **kwargs): | |
248ed943 RD |
11611 | """ |
11612 | Remove(self, item) -> bool | |
11613 | ||
11614 | Removes an item from the sizer and destroys it. This method does not | |
11615 | cause any layout or resizing to take place, call `Layout` to update | |
11616 | the layout on screen after removing a child from the sizer. The | |
11617 | *item* parameter can be either a window, a sizer, or the zero-based | |
11618 | index of an item to remove. Returns True if the child item was found | |
11619 | and removed. | |
11620 | """ | |
54f9ee45 | 11621 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 11622 | |
1c0f361b | 11623 | def Detach(*args, **kwargs): |
248ed943 RD |
11624 | """ |
11625 | Detach(self, item) -> bool | |
11626 | ||
11627 | Detaches an item from the sizer without destroying it. This method | |
11628 | does not cause any layout or resizing to take place, call `Layout` to | |
11629 | do so. The *item* parameter can be either a window, a sizer, or the | |
11630 | zero-based index of the item to be detached. Returns True if the child item | |
11631 | was found and detached. | |
11632 | """ | |
1c0f361b RD |
11633 | return _core_.Sizer_Detach(*args, **kwargs) |
11634 | ||
d3b6e4ff RD |
11635 | def GetItem(*args, **kwargs): |
11636 | """ | |
11637 | GetItem(self, item) -> wx.SizerItem | |
11638 | ||
11639 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11640 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11641 | the item to be found. |
d3b6e4ff RD |
11642 | """ |
11643 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11644 | ||
e811c8ce | 11645 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 11646 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 11647 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 11648 | |
97ab0f6a RD |
11649 | def _ReplaceWin(*args, **kwargs): |
11650 | """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool""" | |
11651 | return _core_.Sizer__ReplaceWin(*args, **kwargs) | |
11652 | ||
11653 | def _ReplaceSizer(*args, **kwargs): | |
11654 | """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool""" | |
11655 | return _core_.Sizer__ReplaceSizer(*args, **kwargs) | |
11656 | ||
11657 | def _ReplaceItem(*args, **kwargs): | |
11658 | """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool""" | |
11659 | return _core_.Sizer__ReplaceItem(*args, **kwargs) | |
11660 | ||
11661 | def Replace(self, olditem, item, recursive=False): | |
11662 | """ | |
11663 | Detaches the given ``olditem`` from the sizer and replaces it with | |
11664 | ``item`` which can be a window, sizer, or `wx.SizerItem`. The | |
11665 | detached child is destroyed only if it is not a window, (because | |
11666 | windows are owned by their parent, not the sizer.) The | |
11667 | ``recursive`` parameter can be used to search for the given | |
11668 | element recursivly in subsizers. | |
11669 | ||
11670 | This method does not cause any layout or resizing to take place, | |
11671 | call `Layout` to do so. | |
11672 | ||
11673 | Returns ``True`` if the child item was found and removed. | |
11674 | """ | |
11675 | if isinstance(olditem, wx.Window): | |
11676 | return self._ReplaceWin(olditem, item, recursive) | |
11677 | elif isinstnace(olditem, wx.Sizer): | |
11678 | return self._ReplaceSizer(olditem, item, recursive) | |
11679 | elif isinstnace(olditem, int): | |
11680 | return self._ReplaceItem(olditem, item) | |
11681 | else: | |
11682 | raise TypeError("Expected Window, Sizer, or integer for first parameter.") | |
11683 | ||
11684 | def SetContainingWindow(*args, **kwargs): | |
11685 | """ | |
11686 | SetContainingWindow(self, Window window) | |
11687 | ||
11688 | Set (or unset) the window this sizer is used in. | |
11689 | """ | |
11690 | return _core_.Sizer_SetContainingWindow(*args, **kwargs) | |
11691 | ||
11692 | def GetContainingWindow(*args, **kwargs): | |
11693 | """ | |
11694 | GetContainingWindow(self) -> Window | |
11695 | ||
11696 | Get the window this sizer is used in. | |
11697 | """ | |
11698 | return _core_.Sizer_GetContainingWindow(*args, **kwargs) | |
11699 | ||
248ed943 RD |
11700 | def SetItemMinSize(self, item, *args): |
11701 | """ | |
11702 | SetItemMinSize(self, item, Size size) | |
11703 | ||
11704 | Sets the minimum size that will be allocated for an item in the sizer. | |
11705 | The *item* parameter can be either a window, a sizer, or the | |
11706 | zero-based index of the item. If a window or sizer is given then it | |
11707 | will be searched for recursivly in subsizers if neccessary. | |
11708 | """ | |
11709 | if len(args) == 2: | |
11710 | # for backward compatibility accept separate width,height args too | |
11711 | return self._SetItemMinSize(item, args) | |
11712 | else: | |
11713 | return self._SetItemMinSize(item, args[0]) | |
11714 | ||
e811c8ce | 11715 | def AddItem(*args, **kwargs): |
248ed943 RD |
11716 | """ |
11717 | AddItem(self, SizerItem item) | |
11718 | ||
11719 | Adds a `wx.SizerItem` to the sizer. | |
11720 | """ | |
54f9ee45 | 11721 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
11722 | |
11723 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11724 | """ |
11725 | InsertItem(self, int index, SizerItem item) | |
11726 | ||
11727 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11728 | """ | |
54f9ee45 | 11729 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
11730 | |
11731 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11732 | """ |
11733 | PrependItem(self, SizerItem item) | |
11734 | ||
11735 | Prepends a `wx.SizerItem` to the sizer. | |
11736 | """ | |
54f9ee45 | 11737 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 11738 | |
248ed943 | 11739 | def AddMany(self, items): |
66c033b4 RD |
11740 | """ |
11741 | AddMany is a convenience method for adding several items | |
11742 | to a sizer at one time. Simply pass it a list of tuples, | |
11743 | where each tuple consists of the parameters that you | |
11744 | would normally pass to the `Add` method. | |
11745 | """ | |
248ed943 RD |
11746 | for item in items: |
11747 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11748 | item = (item, ) | |
11749 | self.Add(*item) | |
d14a1e28 | 11750 | |
ae5bc7f3 RD |
11751 | def AddSpacer(self, *args, **kw): |
11752 | """AddSpacer(int size) --> SizerItem | |
11753 | ||
11754 | Add a spacer that is (size,size) pixels. | |
11755 | """ | |
11756 | if args and type(args[0]) == int: | |
11757 | return self.Add( (args[0],args[0] ), 0) | |
11758 | else: # otherwise stay compatible with old AddSpacer | |
11759 | return self.Add(*args, **kw) | |
11760 | def PrependSpacer(self, *args, **kw): | |
11761 | """PrependSpacer(int size) --> SizerItem | |
11762 | ||
11763 | Prepend a spacer that is (size, size) pixels.""" | |
11764 | if args and type(args[0]) == int: | |
11765 | return self.Prepend( (args[0],args[0] ), 0) | |
11766 | else: # otherwise stay compatible with old PrependSpacer | |
11767 | return self.Prepend(*args, **kw) | |
11768 | def InsertSpacer(self, index, *args, **kw): | |
11769 | """InsertSpacer(int index, int size) --> SizerItem | |
11770 | ||
11771 | Insert a spacer at position index that is (size, size) pixels.""" | |
11772 | if args and type(args[0]) == int: | |
11773 | return self.Insert( index, (args[0],args[0] ), 0) | |
11774 | else: # otherwise stay compatible with old InsertSpacer | |
11775 | return self.Insert(index, *args, **kw) | |
11776 | ||
11777 | ||
11778 | def AddStretchSpacer(self, prop=1): | |
11779 | """AddStretchSpacer(int prop=1) --> SizerItem | |
11780 | ||
11781 | Add a stretchable spacer.""" | |
11782 | return self.Add((0,0), prop) | |
11783 | def PrependStretchSpacer(self, prop=1): | |
11784 | """PrependStretchSpacer(int prop=1) --> SizerItem | |
11785 | ||
11786 | Prepend a stretchable spacer.""" | |
11787 | return self.Prepend((0,0), prop) | |
11788 | def InsertStretchSpacer(self, index, prop=1): | |
11789 | """InsertStretchSpacer(int index, int prop=1) --> SizerItem | |
11790 | ||
11791 | Insert a stretchable spacer.""" | |
11792 | return self.Insert(index, (0,0), prop) | |
11793 | ||
11794 | ||
74e96f3d | 11795 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
11796 | def AddWindow(self, *args, **kw): |
11797 | """Compatibility alias for `Add`.""" | |
11798 | return self.Add(*args, **kw) | |
11799 | def AddSizer(self, *args, **kw): | |
11800 | """Compatibility alias for `Add`.""" | |
11801 | return self.Add(*args, **kw) | |
b9d6a5f3 RD |
11802 | |
11803 | def PrependWindow(self, *args, **kw): | |
11804 | """Compatibility alias for `Prepend`.""" | |
11805 | return self.Prepend(*args, **kw) | |
11806 | def PrependSizer(self, *args, **kw): | |
11807 | """Compatibility alias for `Prepend`.""" | |
11808 | return self.Prepend(*args, **kw) | |
b9d6a5f3 RD |
11809 | |
11810 | def InsertWindow(self, *args, **kw): | |
11811 | """Compatibility alias for `Insert`.""" | |
11812 | return self.Insert(*args, **kw) | |
11813 | def InsertSizer(self, *args, **kw): | |
11814 | """Compatibility alias for `Insert`.""" | |
b9d6a5f3 RD |
11815 | return self.Insert(*args, **kw) |
11816 | ||
11817 | def RemoveWindow(self, *args, **kw): | |
11818 | """Compatibility alias for `Remove`.""" | |
11819 | return self.Remove(*args, **kw) | |
11820 | def RemoveSizer(self, *args, **kw): | |
11821 | """Compatibility alias for `Remove`.""" | |
11822 | return self.Remove(*args, **kw) | |
11823 | def RemovePos(self, *args, **kw): | |
11824 | """Compatibility alias for `Remove`.""" | |
11825 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
11826 | |
11827 | ||
e811c8ce | 11828 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11829 | """ |
11830 | SetDimension(self, int x, int y, int width, int height) | |
11831 | ||
11832 | Call this to force the sizer to take the given dimension and thus | |
11833 | force the items owned by the sizer to resize themselves according to | |
11834 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11835 | methods. | |
11836 | """ | |
54f9ee45 | 11837 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
11838 | |
11839 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11840 | """ |
11841 | SetMinSize(self, Size size) | |
11842 | ||
11843 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11844 | calculate its minimal size based purely on how much space its children | |
11845 | need. After calling this method `GetMinSize` will return either the | |
11846 | minimal size as requested by its children or the minimal size set | |
11847 | here, depending on which is bigger. | |
11848 | """ | |
54f9ee45 | 11849 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
11850 | |
11851 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11852 | """ |
11853 | GetSize(self) -> Size | |
11854 | ||
11855 | Returns the current size of the space managed by the sizer. | |
11856 | """ | |
54f9ee45 | 11857 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
11858 | |
11859 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11860 | """ |
11861 | GetPosition(self) -> Point | |
11862 | ||
11863 | Returns the current position of the sizer's managed space. | |
11864 | """ | |
54f9ee45 | 11865 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
11866 | |
11867 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11868 | """ |
11869 | GetMinSize(self) -> Size | |
11870 | ||
11871 | Returns the minimal size of the sizer. This is either the combined | |
11872 | minimal size of all the children and their borders or the minimal size | |
11873 | set by SetMinSize, depending on which is bigger. | |
11874 | """ | |
54f9ee45 | 11875 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 11876 | |
d14a1e28 | 11877 | def GetSizeTuple(self): |
1c0f361b | 11878 | return self.GetSize().Get() |
d14a1e28 | 11879 | def GetPositionTuple(self): |
1c0f361b | 11880 | return self.GetPosition().Get() |
d14a1e28 | 11881 | def GetMinSizeTuple(self): |
1c0f361b | 11882 | return self.GetMinSize().Get() |
d14a1e28 | 11883 | |
e811c8ce | 11884 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
11885 | """ |
11886 | RecalcSizes(self) | |
11887 | ||
11888 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11889 | items managed by this sizer. You should not need to call this directly as | |
11890 | it is called by `Layout`. | |
11891 | """ | |
54f9ee45 | 11892 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
11893 | |
11894 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11895 | """ |
11896 | CalcMin(self) -> Size | |
11897 | ||
11898 | This method is where the sizer will do the actual calculation of its | |
11899 | children's minimal sizes. You should not need to call this directly as | |
11900 | it is called by `Layout`. | |
11901 | """ | |
54f9ee45 | 11902 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
11903 | |
11904 | def Layout(*args, **kwargs): | |
248ed943 RD |
11905 | """ |
11906 | Layout(self) | |
11907 | ||
11908 | This method will force the recalculation and layout of the items | |
11909 | controlled by the sizer using the current space allocated to the | |
11910 | sizer. Normally this is called automatically from the owning window's | |
11911 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11912 | one of the items in a sizer change size, or items are added or | |
11913 | removed. | |
11914 | """ | |
54f9ee45 | 11915 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
11916 | |
11917 | def Fit(*args, **kwargs): | |
248ed943 RD |
11918 | """ |
11919 | Fit(self, Window window) -> Size | |
11920 | ||
11921 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11922 | size. This is commonly done in the constructor of the window itself in | |
11923 | order to set its initial size to match the needs of the children as | |
11924 | determined by the sizer. Returns the new size. | |
11925 | ||
11926 | For a top level window this is the total window size, not the client size. | |
11927 | """ | |
54f9ee45 | 11928 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
11929 | |
11930 | def FitInside(*args, **kwargs): | |
248ed943 RD |
11931 | """ |
11932 | FitInside(self, Window window) | |
11933 | ||
11934 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11935 | sizer's minimal size. This will not alter the on screen size of the | |
11936 | window, but may cause the addition/removal/alteration of scrollbars | |
11937 | required to view the virtual area in windows which manage it. | |
11938 | ||
11939 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11940 | ||
11941 | """ | |
54f9ee45 | 11942 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
11943 | |
11944 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
11945 | """ |
11946 | SetSizeHints(self, Window window) | |
11947 | ||
11948 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11949 | match the sizer's minimal size. This is commonly done in the | |
11950 | constructor of the window itself if the window is resizable (as are | |
11951 | many dialogs under Unix and frames on probably all platforms) in order | |
11952 | to prevent the window from being sized smaller than the minimal size | |
11953 | required by the sizer. | |
11954 | """ | |
54f9ee45 | 11955 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
11956 | |
11957 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
11958 | """ |
11959 | SetVirtualSizeHints(self, Window window) | |
11960 | ||
11961 | Tell the sizer to set the minimal size of the window virtual area to | |
11962 | match the sizer's minimal size. For windows with managed scrollbars | |
11963 | this will set them appropriately. | |
11964 | ||
11965 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11966 | ||
11967 | """ | |
54f9ee45 | 11968 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
11969 | |
11970 | def Clear(*args, **kwargs): | |
248ed943 RD |
11971 | """ |
11972 | Clear(self, bool deleteWindows=False) | |
11973 | ||
11974 | Clear all items from the sizer, optionally destroying the window items | |
11975 | as well. | |
11976 | """ | |
54f9ee45 | 11977 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
11978 | |
11979 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
11980 | """ |
11981 | DeleteWindows(self) | |
11982 | ||
11983 | Destroy all windows managed by the sizer. | |
11984 | """ | |
54f9ee45 | 11985 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11986 | |
11987 | def GetChildren(*args, **kwargs): | |
248ed943 | 11988 | """ |
51b83b37 | 11989 | GetChildren(self) -> list |
248ed943 RD |
11990 | |
11991 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11992 | """ | |
54f9ee45 | 11993 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
11994 | |
11995 | def Show(*args, **kwargs): | |
248ed943 | 11996 | """ |
ae8162c8 | 11997 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 11998 | |
248ed943 RD |
11999 | Shows or hides an item managed by the sizer. To make a sizer item |
12000 | disappear or reappear, use Show followed by `Layout`. The *item* | |
12001 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
12002 | the item. Use the recursive parameter to show or hide an item in a |
12003 | subsizer. Returns True if the item was found. | |
248ed943 RD |
12004 | """ |
12005 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
12006 | |
12007 | def IsShown(*args, **kwargs): | |
248ed943 RD |
12008 | """ |
12009 | IsShown(self, item) | |
12010 | ||
b1fcee84 | 12011 | Determines if the item is currently shown. To make a sizer |
248ed943 RD |
12012 | item disappear or reappear, use Show followed by `Layout`. The *item* |
12013 | parameter can be either a window, a sizer, or the zero-based index of | |
12014 | the item. | |
12015 | """ | |
54f9ee45 | 12016 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 12017 | |
7e63a440 | 12018 | def Hide(self, item, recursive=False): |
248ed943 | 12019 | """ |
27fb7603 | 12020 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 12021 | """ |
06759a38 | 12022 | return self.Show(item, False, recursive) |
248ed943 | 12023 | |
e811c8ce | 12024 | def ShowItems(*args, **kwargs): |
248ed943 RD |
12025 | """ |
12026 | ShowItems(self, bool show) | |
12027 | ||
84f85550 | 12028 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 12029 | """ |
54f9ee45 | 12030 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 12031 | |
33d6fd3b RD |
12032 | Children = property(GetChildren,doc="See `GetChildren`") |
12033 | ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`") | |
12034 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
12035 | Position = property(GetPosition,doc="See `GetPosition`") | |
12036 | Size = property(GetSize,doc="See `GetSize`") | |
2131d850 | 12037 | _core_.Sizer_swigregister(Sizer) |
d14a1e28 RD |
12038 | |
12039 | class PySizer(Sizer): | |
248ed943 RD |
12040 | """ |
12041 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12042 | instrumented to allow the C++ virtual methods to be overloaded in | |
12043 | Python derived classes. You would derive from this class if you are | |
12044 | wanting to implement a custom sizer in Python code. Simply implement | |
12045 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12046 | For example:: | |
12047 | ||
12048 | class MySizer(wx.PySizer): | |
12049 | def __init__(self): | |
12050 | wx.PySizer.__init__(self) | |
12051 | ||
12052 | def CalcMin(self): | |
12053 | for item in self.GetChildren(): | |
12054 | # calculate the total minimum width and height needed | |
12055 | # by all items in the sizer according to this sizer's | |
12056 | # layout algorithm. | |
12057 | ... | |
12058 | return wx.Size(width, height) | |
12059 | ||
12060 | def RecalcSizes(self): | |
12061 | # find the space allotted to this sizer | |
12062 | pos = self.GetPosition() | |
12063 | size = self.GetSize() | |
12064 | for item in self.GetChildren(): | |
12065 | # Recalculate (if necessary) the position and size of | |
12066 | # each item and then call item.SetDimension to do the | |
12067 | # actual positioning and sizing of the items within the | |
12068 | # space alloted to this sizer. | |
12069 | ... | |
12070 | item.SetDimension(itemPos, itemSize) | |
12071 | ||
12072 | ||
12073 | When `Layout` is called it first calls `CalcMin` followed by | |
12074 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 12075 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
12076 | |
12077 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12078 | ||
12079 | ||
12080 | """ | |
0085ce49 RD |
12081 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12082 | __repr__ = _swig_repr | |
12083 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12084 | """ |
12085 | __init__(self) -> PySizer | |
12086 | ||
12087 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12088 | class. | |
12089 | """ | |
0085ce49 | 12090 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
d14a1e28 | 12091 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) |
e811c8ce RD |
12092 | |
12093 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 12094 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 12095 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 12096 | |
2131d850 | 12097 | _core_.PySizer_swigregister(PySizer) |
d14a1e28 RD |
12098 | |
12099 | #--------------------------------------------------------------------------- | |
12100 | ||
12101 | class BoxSizer(Sizer): | |
248ed943 RD |
12102 | """ |
12103 | The basic idea behind a box sizer is that windows will most often be | |
12104 | laid out in rather simple basic geometry, typically in a row or a | |
12105 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12106 | its items in a simple row or column, depending on the orientation | |
12107 | parameter passed to the constructor. | |
12108 | """ | |
0085ce49 RD |
12109 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12110 | __repr__ = _swig_repr | |
12111 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12112 | """ |
12113 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
12114 | ||
12115 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12116 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12117 | sizer. | |
12118 | """ | |
0085ce49 | 12119 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d14a1e28 | 12120 | self._setOORInfo(self) |
e811c8ce RD |
12121 | |
12122 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
12123 | """ |
12124 | GetOrientation(self) -> int | |
12125 | ||
12126 | Returns the current orientation of the sizer. | |
12127 | """ | |
54f9ee45 | 12128 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
12129 | |
12130 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
12131 | """ |
12132 | SetOrientation(self, int orient) | |
e811c8ce | 12133 | |
248ed943 RD |
12134 | Resets the orientation of the sizer. |
12135 | """ | |
12136 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 12137 | |
2bf58437 | 12138 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
2131d850 | 12139 | _core_.BoxSizer_swigregister(BoxSizer) |
d14a1e28 RD |
12140 | |
12141 | #--------------------------------------------------------------------------- | |
12142 | ||
12143 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
12144 | """ |
12145 | wx.StaticBoxSizer derives from and functions identically to the | |
12146 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12147 | manages. Note that this static box must be created separately and | |
12148 | passed to the sizer constructor. | |
12149 | """ | |
0085ce49 RD |
12150 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12151 | __repr__ = _swig_repr | |
12152 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12153 | """ |
12154 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
12155 | ||
12156 | Constructor. It takes an associated static box and the orientation | |
12157 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12158 | ``wx.HORIZONTAL``. | |
12159 | """ | |
0085ce49 | 12160 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d14a1e28 | 12161 | self._setOORInfo(self) |
e811c8ce RD |
12162 | |
12163 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
12164 | """ |
12165 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 12166 | |
248ed943 RD |
12167 | Returns the static box associated with this sizer. |
12168 | """ | |
12169 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 12170 | |
33d6fd3b | 12171 | StaticBox = property(GetStaticBox,doc="See `GetStaticBox`") |
2131d850 | 12172 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d14a1e28 RD |
12173 | |
12174 | #--------------------------------------------------------------------------- | |
12175 | ||
12176 | class GridSizer(Sizer): | |
248ed943 RD |
12177 | """ |
12178 | A grid sizer is a sizer which lays out its children in a | |
12179 | two-dimensional table with all cells having the same size. In other | |
12180 | words, the width of each cell within the grid is the width of the | |
12181 | widest item added to the sizer and the height of each grid cell is the | |
12182 | height of the tallest item. An optional vertical and/or horizontal | |
12183 | gap between items can also be specified (in pixels.) | |
12184 | ||
12185 | Items are placed in the cells of the grid in the order they are added, | |
12186 | in row-major order. In other words, the first row is filled first, | |
12187 | then the second, and so on until all items have been added. (If | |
12188 | neccessary, additional rows will be added as items are added.) If you | |
12189 | need to have greater control over the cells that items are placed in | |
12190 | then use the `wx.GridBagSizer`. | |
12191 | ||
12192 | """ | |
0085ce49 RD |
12193 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12194 | __repr__ = _swig_repr | |
12195 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12196 | """ |
12197 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
12198 | ||
12199 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12200 | of columns and rows in the sizer - if either of the parameters is | |
12201 | zero, it will be calculated to from the total number of children in | |
12202 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12203 | define extra space between all children. | |
12204 | """ | |
0085ce49 | 12205 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d14a1e28 | 12206 | self._setOORInfo(self) |
e811c8ce | 12207 | |
e811c8ce | 12208 | def SetCols(*args, **kwargs): |
248ed943 RD |
12209 | """ |
12210 | SetCols(self, int cols) | |
12211 | ||
12212 | Sets the number of columns in the sizer. | |
12213 | """ | |
54f9ee45 | 12214 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
12215 | |
12216 | def SetRows(*args, **kwargs): | |
248ed943 RD |
12217 | """ |
12218 | SetRows(self, int rows) | |
12219 | ||
12220 | Sets the number of rows in the sizer. | |
12221 | """ | |
54f9ee45 | 12222 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
12223 | |
12224 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
12225 | """ |
12226 | SetVGap(self, int gap) | |
12227 | ||
12228 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12229 | """ | |
54f9ee45 | 12230 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
12231 | |
12232 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
12233 | """ |
12234 | SetHGap(self, int gap) | |
12235 | ||
12236 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12237 | """ | |
54f9ee45 | 12238 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
12239 | |
12240 | def GetCols(*args, **kwargs): | |
248ed943 RD |
12241 | """ |
12242 | GetCols(self) -> int | |
12243 | ||
12244 | Returns the number of columns in the sizer. | |
12245 | """ | |
54f9ee45 | 12246 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
12247 | |
12248 | def GetRows(*args, **kwargs): | |
248ed943 RD |
12249 | """ |
12250 | GetRows(self) -> int | |
12251 | ||
12252 | Returns the number of rows in the sizer. | |
12253 | """ | |
54f9ee45 | 12254 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
12255 | |
12256 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
12257 | """ |
12258 | GetVGap(self) -> int | |
12259 | ||
12260 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12261 | """ | |
54f9ee45 | 12262 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
12263 | |
12264 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
12265 | """ |
12266 | GetHGap(self) -> int | |
12267 | ||
12268 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12269 | """ | |
54f9ee45 | 12270 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 12271 | |
0085ce49 RD |
12272 | def CalcRowsCols(self): |
12273 | """ | |
12274 | CalcRowsCols() -> (rows, cols) | |
12275 | ||
12276 | Calculates how many rows and columns will be in the sizer based | |
12277 | on the current number of items and also the rows, cols specified | |
12278 | in the constructor. | |
12279 | """ | |
12280 | nitems = len(self.GetChildren()) | |
12281 | rows = self.GetRows() | |
12282 | cols = self.GetCols() | |
12283 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
12284 | if cols != 0: | |
12285 | rows = (nitems + cols - 1) / cols | |
12286 | elif rows != 0: | |
12287 | cols = (nitems + rows - 1) / rows | |
12288 | return (rows, cols) | |
d14a1e28 | 12289 | |
97ab0f6a RD |
12290 | Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`") |
12291 | HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`") | |
12292 | Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`") | |
12293 | VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`") | |
2131d850 | 12294 | _core_.GridSizer_swigregister(GridSizer) |
d14a1e28 RD |
12295 | |
12296 | #--------------------------------------------------------------------------- | |
12297 | ||
54f9ee45 RD |
12298 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
12299 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12300 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 12301 | class FlexGridSizer(GridSizer): |
248ed943 RD |
12302 | """ |
12303 | A flex grid sizer is a sizer which lays out its children in a | |
12304 | two-dimensional table with all table cells in one row having the same | |
12305 | height and all cells in one column having the same width, but all | |
12306 | rows or all columns are not necessarily the same height or width as in | |
12307 | the `wx.GridSizer`. | |
12308 | ||
12309 | wx.FlexGridSizer can also size items equally in one direction but | |
12310 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12311 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12312 | needs to be decided how the sizer should grow in the other ("non | |
12313 | flexible") direction in order to fill the available space. The | |
12314 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12315 | ||
12316 | ||
12317 | """ | |
0085ce49 RD |
12318 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12319 | __repr__ = _swig_repr | |
12320 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12321 | """ |
12322 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
12323 | ||
12324 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12325 | number of columns and rows in the sizer - if either of the parameters | |
12326 | is zero, it will be calculated to from the total number of children in | |
12327 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12328 | define extra space between all children. | |
12329 | """ | |
0085ce49 | 12330 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d14a1e28 | 12331 | self._setOORInfo(self) |
e811c8ce | 12332 | |
248ed943 RD |
12333 | def AddGrowableRow(*args, **kwargs): |
12334 | """ | |
12335 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 12336 | |
248ed943 RD |
12337 | Specifies that row *idx* (starting from zero) should be grown if there |
12338 | is extra space available to the sizer. | |
e811c8ce | 12339 | |
248ed943 RD |
12340 | The *proportion* parameter has the same meaning as the stretch factor |
12341 | for the box sizers except that if all proportions are 0, then all | |
12342 | columns are resized equally (instead of not being resized at all). | |
12343 | """ | |
54f9ee45 | 12344 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
12345 | |
12346 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
12347 | """ |
12348 | RemoveGrowableRow(self, size_t idx) | |
12349 | ||
12350 | Specifies that row *idx* is no longer growable. | |
12351 | """ | |
54f9ee45 | 12352 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
12353 | |
12354 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
12355 | """ |
12356 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12357 | ||
12358 | Specifies that column *idx* (starting from zero) should be grown if | |
12359 | there is extra space available to the sizer. | |
12360 | ||
12361 | The *proportion* parameter has the same meaning as the stretch factor | |
12362 | for the box sizers except that if all proportions are 0, then all | |
12363 | columns are resized equally (instead of not being resized at all). | |
12364 | """ | |
54f9ee45 | 12365 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
12366 | |
12367 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
12368 | """ |
12369 | RemoveGrowableCol(self, size_t idx) | |
12370 | ||
12371 | Specifies that column *idx* is no longer growable. | |
12372 | """ | |
54f9ee45 | 12373 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
12374 | |
12375 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12376 | """ |
12377 | SetFlexibleDirection(self, int direction) | |
12378 | ||
12379 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12380 | or both. Argument *direction* can be one of the following values. Any | |
12381 | other value is ignored. | |
12382 | ||
12383 | ============== ======================================= | |
12384 | wx.VERTICAL Rows are flexibly sized. | |
12385 | wx.HORIZONTAL Columns are flexibly sized. | |
12386 | wx.BOTH Both rows and columns are flexibly sized | |
12387 | (this is the default value). | |
12388 | ============== ======================================= | |
12389 | ||
12390 | Note that this method does not trigger relayout. | |
12391 | ||
12392 | """ | |
54f9ee45 | 12393 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12394 | |
12395 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12396 | """ |
12397 | GetFlexibleDirection(self) -> int | |
12398 | ||
12399 | Returns a value that specifies whether the sizer | |
12400 | flexibly resizes its columns, rows, or both (default). | |
12401 | ||
12402 | :see: `SetFlexibleDirection` | |
12403 | """ | |
54f9ee45 | 12404 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12405 | |
12406 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12407 | """ |
12408 | SetNonFlexibleGrowMode(self, int mode) | |
12409 | ||
12410 | Specifies how the sizer should grow in the non-flexible direction if | |
12411 | there is one (so `SetFlexibleDirection` must have been called | |
12412 | previously). Argument *mode* can be one of the following values: | |
12413 | ||
12414 | ========================== ================================================= | |
12415 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12416 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12417 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12418 | case equal sizing applies to minimum sizes of | |
12419 | columns or rows (this is the default value). | |
12420 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12421 | the non flexible direction, whether they are | |
12422 | growable or not in the flexbile direction. | |
12423 | ========================== ================================================= | |
12424 | ||
12425 | Note that this method does not trigger relayout. | |
248ed943 | 12426 | """ |
54f9ee45 | 12427 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12428 | |
12429 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12430 | """ |
12431 | GetNonFlexibleGrowMode(self) -> int | |
12432 | ||
12433 | Returns the value that specifies how the sizer grows in the | |
12434 | non-flexible direction if there is one. | |
12435 | ||
12436 | :see: `SetNonFlexibleGrowMode` | |
12437 | """ | |
54f9ee45 | 12438 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12439 | |
12440 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12441 | """ |
12442 | GetRowHeights(self) -> list | |
12443 | ||
12444 | Returns a list of integers representing the heights of each of the | |
12445 | rows in the sizer. | |
12446 | """ | |
54f9ee45 | 12447 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
12448 | |
12449 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12450 | """ |
12451 | GetColWidths(self) -> list | |
12452 | ||
12453 | Returns a list of integers representing the widths of each of the | |
12454 | columns in the sizer. | |
12455 | """ | |
54f9ee45 | 12456 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 12457 | |
97ab0f6a RD |
12458 | ColWidths = property(GetColWidths,doc="See `GetColWidths`") |
12459 | FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`") | |
12460 | NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`") | |
12461 | RowHeights = property(GetRowHeights,doc="See `GetRowHeights`") | |
2131d850 | 12462 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d14a1e28 | 12463 | |
e505d15e RD |
12464 | class StdDialogButtonSizer(BoxSizer): |
12465 | """ | |
12466 | A special sizer that knows how to order and position standard buttons | |
12467 | in order to conform to the current platform's standards. You simply | |
12468 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12469 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
12470 | will take care of the rest. |
12471 | ||
12472 | """ | |
0085ce49 RD |
12473 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12474 | __repr__ = _swig_repr | |
12475 | def __init__(self, *args, **kwargs): | |
e505d15e | 12476 | """__init__(self) -> StdDialogButtonSizer""" |
0085ce49 | 12477 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
e505d15e RD |
12478 | def AddButton(*args, **kwargs): |
12479 | """ | |
12480 | AddButton(self, wxButton button) | |
12481 | ||
12482 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12483 | method in the base class. | |
12484 | """ | |
12485 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
12486 | ||
53aa7709 | 12487 | def Realize(*args, **kwargs): |
e505d15e | 12488 | """ |
53aa7709 | 12489 | Realize(self) |
e505d15e RD |
12490 | |
12491 | This funciton needs to be called after all the buttons have been added | |
12492 | to the sizer. It will reorder them and position them in a platform | |
12493 | specifc manner. | |
12494 | """ | |
53aa7709 | 12495 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12496 | |
12497 | def SetAffirmativeButton(*args, **kwargs): | |
12498 | """SetAffirmativeButton(self, wxButton button)""" | |
12499 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
12500 | ||
12501 | def SetNegativeButton(*args, **kwargs): | |
12502 | """SetNegativeButton(self, wxButton button)""" | |
12503 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
12504 | ||
12505 | def SetCancelButton(*args, **kwargs): | |
12506 | """SetCancelButton(self, wxButton button)""" | |
12507 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
12508 | |
12509 | def GetAffirmativeButton(*args, **kwargs): | |
12510 | """GetAffirmativeButton(self) -> wxButton""" | |
12511 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
12512 | ||
12513 | def GetApplyButton(*args, **kwargs): | |
12514 | """GetApplyButton(self) -> wxButton""" | |
12515 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
12516 | ||
12517 | def GetNegativeButton(*args, **kwargs): | |
12518 | """GetNegativeButton(self) -> wxButton""" | |
12519 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
12520 | ||
12521 | def GetCancelButton(*args, **kwargs): | |
12522 | """GetCancelButton(self) -> wxButton""" | |
12523 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
12524 | ||
12525 | def GetHelpButton(*args, **kwargs): | |
12526 | """GetHelpButton(self) -> wxButton""" | |
12527 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
12528 | ||
33d6fd3b RD |
12529 | AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`") |
12530 | ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`") | |
12531 | CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`") | |
12532 | HelpButton = property(GetHelpButton,doc="See `GetHelpButton`") | |
12533 | NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`") | |
2131d850 | 12534 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
e505d15e | 12535 | |
d14a1e28 RD |
12536 | #--------------------------------------------------------------------------- |
12537 | ||
12538 | class GBPosition(object): | |
248ed943 RD |
12539 | """ |
12540 | This class represents the position of an item in a virtual grid of | |
12541 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12542 | typemaps that will automatically convert from a 2-element sequence of | |
12543 | integers to a wx.GBPosition, so you can use the more pythonic | |
12544 | representation of the position nearly transparently in Python code. | |
12545 | """ | |
0085ce49 RD |
12546 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12547 | __repr__ = _swig_repr | |
12548 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12549 | """ |
12550 | __init__(self, int row=0, int col=0) -> GBPosition | |
12551 | ||
12552 | This class represents the position of an item in a virtual grid of | |
12553 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12554 | typemaps that will automatically convert from a 2-element sequence of | |
12555 | integers to a wx.GBPosition, so you can use the more pythonic | |
12556 | representation of the position nearly transparently in Python code. | |
12557 | """ | |
0085ce49 RD |
12558 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
12559 | __swig_destroy__ = _core_.delete_GBPosition | |
12560 | __del__ = lambda self : None; | |
e811c8ce | 12561 | def GetRow(*args, **kwargs): |
a95a7133 | 12562 | """GetRow(self) -> int""" |
54f9ee45 | 12563 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
12564 | |
12565 | def GetCol(*args, **kwargs): | |
a95a7133 | 12566 | """GetCol(self) -> int""" |
54f9ee45 | 12567 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
12568 | |
12569 | def SetRow(*args, **kwargs): | |
a95a7133 | 12570 | """SetRow(self, int row)""" |
54f9ee45 | 12571 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
12572 | |
12573 | def SetCol(*args, **kwargs): | |
a95a7133 | 12574 | """SetCol(self, int col)""" |
54f9ee45 | 12575 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
12576 | |
12577 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12578 | """ |
12579 | __eq__(self, PyObject other) -> bool | |
12580 | ||
12581 | Compare GBPosition for equality. | |
12582 | """ | |
54f9ee45 | 12583 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
12584 | |
12585 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12586 | """ |
12587 | __ne__(self, PyObject other) -> bool | |
12588 | ||
12589 | Compare GBPosition for inequality. | |
12590 | """ | |
54f9ee45 | 12591 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
12592 | |
12593 | def Set(*args, **kwargs): | |
a95a7133 | 12594 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 12595 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
12596 | |
12597 | def Get(*args, **kwargs): | |
a95a7133 | 12598 | """Get(self) -> PyObject""" |
54f9ee45 | 12599 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 12600 | |
41e2b43e | 12601 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12602 | def __str__(self): return str(self.Get()) |
12603 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12604 | def __len__(self): return len(self.Get()) | |
12605 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12606 | def __setitem__(self, index, val): |
12607 | if index == 0: self.SetRow(val) | |
12608 | elif index == 1: self.SetCol(val) | |
12609 | else: raise IndexError | |
e811c8ce | 12610 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12611 | __safe_for_unpickling__ = True |
12612 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
12613 | |
12614 | row = property(GetRow, SetRow) | |
12615 | col = property(GetCol, SetCol) | |
12616 | ||
2131d850 | 12617 | _core_.GBPosition_swigregister(GBPosition) |
d14a1e28 RD |
12618 | |
12619 | class GBSpan(object): | |
248ed943 RD |
12620 | """ |
12621 | This class is used to hold the row and column spanning attributes of | |
12622 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12623 | automatically convert from a 2-element sequence of integers to a | |
12624 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12625 | nearly transparently in Python code. | |
12626 | ||
12627 | """ | |
0085ce49 RD |
12628 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12629 | __repr__ = _swig_repr | |
12630 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12631 | """ |
12632 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
12633 | ||
12634 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12635 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12636 | cell in each direction. | |
12637 | """ | |
0085ce49 RD |
12638 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
12639 | __swig_destroy__ = _core_.delete_GBSpan | |
12640 | __del__ = lambda self : None; | |
e811c8ce | 12641 | def GetRowspan(*args, **kwargs): |
a95a7133 | 12642 | """GetRowspan(self) -> int""" |
54f9ee45 | 12643 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
12644 | |
12645 | def GetColspan(*args, **kwargs): | |
a95a7133 | 12646 | """GetColspan(self) -> int""" |
54f9ee45 | 12647 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
12648 | |
12649 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 12650 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 12651 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
12652 | |
12653 | def SetColspan(*args, **kwargs): | |
a95a7133 | 12654 | """SetColspan(self, int colspan)""" |
54f9ee45 | 12655 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
12656 | |
12657 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12658 | """ |
12659 | __eq__(self, PyObject other) -> bool | |
12660 | ||
12661 | Compare wxGBSpan for equality. | |
12662 | """ | |
54f9ee45 | 12663 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
12664 | |
12665 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12666 | """ |
12667 | __ne__(self, PyObject other) -> bool | |
12668 | ||
12669 | Compare GBSpan for inequality. | |
12670 | """ | |
54f9ee45 | 12671 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
12672 | |
12673 | def Set(*args, **kwargs): | |
a95a7133 | 12674 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 12675 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
12676 | |
12677 | def Get(*args, **kwargs): | |
a95a7133 | 12678 | """Get(self) -> PyObject""" |
54f9ee45 | 12679 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 12680 | |
41e2b43e | 12681 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12682 | def __str__(self): return str(self.Get()) |
12683 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12684 | def __len__(self): return len(self.Get()) | |
12685 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12686 | def __setitem__(self, index, val): |
12687 | if index == 0: self.SetRowspan(val) | |
12688 | elif index == 1: self.SetColspan(val) | |
12689 | else: raise IndexError | |
e811c8ce | 12690 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12691 | __safe_for_unpickling__ = True |
12692 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
12693 | |
12694 | rowspan = property(GetRowspan, SetRowspan) | |
12695 | colspan = property(GetColspan, SetColspan) | |
12696 | ||
2131d850 | 12697 | _core_.GBSpan_swigregister(GBSpan) |
d14a1e28 RD |
12698 | |
12699 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12700 | """ |
12701 | The wx.GBSizerItem class is used to track the additional data about | |
12702 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12703 | and how many rows or columns it spans. | |
12704 | ||
12705 | """ | |
0085ce49 RD |
12706 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12707 | __repr__ = _swig_repr | |
12708 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12709 | """ |
12710 | __init__(self) -> GBSizerItem | |
12711 | ||
12712 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12713 | size will need to be set, as well as a position and span before this | |
12714 | item can be used in a Sizer. | |
12715 | ||
12716 | You will probably never need to create a wx.GBSizerItem directly as they | |
12717 | are created automatically when the sizer's Add method is called. | |
12718 | """ | |
0085ce49 RD |
12719 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
12720 | __swig_destroy__ = _core_.delete_GBSizerItem | |
12721 | __del__ = lambda self : None; | |
e811c8ce | 12722 | def GetPos(*args, **kwargs): |
248ed943 RD |
12723 | """ |
12724 | GetPos(self) -> GBPosition | |
12725 | ||
12726 | Get the grid position of the item | |
12727 | """ | |
54f9ee45 | 12728 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
12729 | |
12730 | def GetPosTuple(self): return self.GetPos().Get() | |
12731 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12732 | """ |
12733 | GetSpan(self) -> GBSpan | |
12734 | ||
12735 | Get the row and column spanning of the item | |
12736 | """ | |
54f9ee45 | 12737 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
12738 | |
12739 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12740 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12741 | """ |
12742 | SetPos(self, GBPosition pos) -> bool | |
12743 | ||
12744 | If the item is already a member of a sizer then first ensure that | |
12745 | there is no other item that would intersect with this one at the new | |
12746 | position, then set the new position. Returns True if the change is | |
12747 | successful and after the next Layout() the item will be moved. | |
12748 | """ | |
54f9ee45 | 12749 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
12750 | |
12751 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12752 | """ |
12753 | SetSpan(self, GBSpan span) -> bool | |
12754 | ||
12755 | If the item is already a member of a sizer then first ensure that | |
12756 | there is no other item that would intersect with this one with its new | |
12757 | spanning size, then set the new spanning. Returns True if the change | |
12758 | is successful and after the next Layout() the item will be resized. | |
12759 | ||
12760 | """ | |
54f9ee45 | 12761 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 12762 | |
248ed943 | 12763 | def Intersects(*args, **kwargs): |
0df68c9f | 12764 | """ |
a95a7133 | 12765 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
12766 | |
12767 | Returns True if this item and the other item instersect. | |
0df68c9f | 12768 | """ |
248ed943 RD |
12769 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12770 | ||
12771 | def IntersectsPos(*args, **kwargs): | |
12772 | """ | |
12773 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12774 | ||
12775 | Returns True if the given pos/span would intersect with this item. | |
12776 | """ | |
12777 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
12778 | |
12779 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12780 | """ |
12781 | GetEndPos(self) -> GBPosition | |
12782 | ||
12783 | Get the row and column of the endpoint of this item. | |
12784 | """ | |
54f9ee45 | 12785 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
12786 | |
12787 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12788 | """ |
12789 | GetGBSizer(self) -> GridBagSizer | |
12790 | ||
12791 | Get the sizer this item is a member of. | |
12792 | """ | |
54f9ee45 | 12793 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
12794 | |
12795 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12796 | """ |
12797 | SetGBSizer(self, GridBagSizer sizer) | |
12798 | ||
12799 | Set the sizer this item is a member of. | |
12800 | """ | |
54f9ee45 | 12801 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 12802 | |
97ab0f6a RD |
12803 | EndPos = property(GetEndPos,doc="See `GetEndPos`") |
12804 | GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`") | |
12805 | Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`") | |
12806 | Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`") | |
2131d850 | 12807 | _core_.GBSizerItem_swigregister(GBSizerItem) |
d14a1e28 RD |
12808 | DefaultSpan = cvar.DefaultSpan |
12809 | ||
12810 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
12811 | """ |
12812 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12813 | int border, PyObject userData=None) -> GBSizerItem |
12814 | ||
12815 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 12816 | """ |
54f9ee45 | 12817 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12818 | return val |
12819 | ||
12820 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12821 | """ |
12822 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12823 | int border, PyObject userData=None) -> GBSizerItem |
12824 | ||
12825 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 12826 | """ |
54f9ee45 | 12827 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12828 | return val |
12829 | ||
12830 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
12831 | """ |
12832 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12833 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12834 | ||
12835 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 12836 | """ |
54f9ee45 | 12837 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12838 | return val |
12839 | ||
12840 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12841 | """ |
12842 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12843 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12844 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12845 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12846 | virtual grid is determined by the largest row and column that items are | |
12847 | positioned at, adjusted for spanning. | |
12848 | ||
12849 | """ | |
0085ce49 RD |
12850 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12851 | __repr__ = _swig_repr | |
12852 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12853 | """ |
12854 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12855 | ||
12856 | Constructor, with optional parameters to specify the gap between the | |
12857 | rows and columns. | |
12858 | """ | |
0085ce49 | 12859 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
1823fbb4 RD |
12860 | self._setOORInfo(self) |
12861 | ||
e811c8ce | 12862 | def Add(*args, **kwargs): |
0df68c9f | 12863 | """ |
248ed943 | 12864 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 12865 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12866 | |
12867 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12868 | more than one row or column as specified with *span*. The remaining | |
12869 | args behave similarly to `wx.Sizer.Add`. | |
12870 | ||
12871 | Returns True if the item was successfully placed at the given cell | |
12872 | position, False if something was already there. | |
12873 | ||
0df68c9f | 12874 | """ |
54f9ee45 | 12875 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
12876 | |
12877 | def AddItem(*args, **kwargs): | |
248ed943 | 12878 | """ |
d3b6e4ff | 12879 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12880 | |
12881 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12882 | the item was successfully placed at its given cell position, False if | |
12883 | something was already there. | |
12884 | """ | |
54f9ee45 | 12885 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 12886 | |
84f85550 RD |
12887 | def GetCellSize(*args, **kwargs): |
12888 | """ | |
12889 | GetCellSize(self, int row, int col) -> Size | |
12890 | ||
12891 | Get the size of the specified cell, including hgap and | |
12892 | vgap. Only valid after a Layout. | |
12893 | """ | |
12894 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12895 | ||
e811c8ce | 12896 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12897 | """ |
12898 | GetEmptyCellSize(self) -> Size | |
12899 | ||
12900 | Get the size used for cells in the grid with no item. | |
12901 | """ | |
54f9ee45 | 12902 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12903 | |
12904 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12905 | """ |
12906 | SetEmptyCellSize(self, Size sz) | |
12907 | ||
12908 | Set the size used for cells in the grid with no item. | |
12909 | """ | |
54f9ee45 | 12910 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12911 | |
12912 | def GetItemPosition(*args): | |
0df68c9f | 12913 | """ |
248ed943 RD |
12914 | GetItemPosition(self, item) -> GBPosition |
12915 | ||
12916 | Get the grid position of the specified *item* where *item* is either a | |
12917 | window or subsizer that is a member of this sizer, or a zero-based | |
12918 | index of an item. | |
0df68c9f | 12919 | """ |
54f9ee45 | 12920 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
12921 | |
12922 | def SetItemPosition(*args): | |
0df68c9f | 12923 | """ |
248ed943 RD |
12924 | SetItemPosition(self, item, GBPosition pos) -> bool |
12925 | ||
12926 | Set the grid position of the specified *item* where *item* is either a | |
12927 | window or subsizer that is a member of this sizer, or a zero-based | |
12928 | index of an item. Returns True on success. If the move is not | |
12929 | allowed (because an item is already there) then False is returned. | |
12930 | ||
0df68c9f | 12931 | """ |
54f9ee45 | 12932 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
12933 | |
12934 | def GetItemSpan(*args): | |
0df68c9f | 12935 | """ |
248ed943 RD |
12936 | GetItemSpan(self, item) -> GBSpan |
12937 | ||
12938 | Get the row/col spanning of the specified *item* where *item* is | |
12939 | either a window or subsizer that is a member of this sizer, or a | |
12940 | zero-based index of an item. | |
0df68c9f | 12941 | """ |
54f9ee45 | 12942 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
12943 | |
12944 | def SetItemSpan(*args): | |
0df68c9f | 12945 | """ |
248ed943 RD |
12946 | SetItemSpan(self, item, GBSpan span) -> bool |
12947 | ||
12948 | Set the row/col spanning of the specified *item* where *item* is | |
12949 | either a window or subsizer that is a member of this sizer, or a | |
12950 | zero-based index of an item. Returns True on success. If the move is | |
12951 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 12952 | """ |
54f9ee45 | 12953 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
12954 | |
12955 | def FindItem(*args): | |
0df68c9f | 12956 | """ |
248ed943 RD |
12957 | FindItem(self, item) -> GBSizerItem |
12958 | ||
12959 | Find the sizer item for the given window or subsizer, returns None if | |
12960 | not found. (non-recursive) | |
0df68c9f | 12961 | """ |
54f9ee45 | 12962 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce RD |
12963 | |
12964 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
12965 | """ |
12966 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
12967 | ||
12968 | Return the sizer item for the given grid cell, or None if there is no | |
12969 | item at that position. (non-recursive) | |
12970 | """ | |
54f9ee45 | 12971 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
12972 | |
12973 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
12974 | """ |
12975 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
12976 | ||
12977 | Return the sizer item located at the point given in *pt*, or None if | |
12978 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12979 | to the client coordinates of the window using the sizer for | |
12980 | layout. (non-recursive) | |
12981 | """ | |
54f9ee45 | 12982 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 12983 | |
248ed943 RD |
12984 | def CheckForIntersection(*args, **kwargs): |
12985 | """ | |
12986 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 12987 | |
248ed943 RD |
12988 | Look at all items and see if any intersect (or would overlap) the |
12989 | given *item*. Returns True if so, False if there would be no overlap. | |
12990 | If an *excludeItem* is given then it will not be checked for | |
12991 | intersection, for example it may be the item we are checking the | |
12992 | position of. | |
e811c8ce | 12993 | |
248ed943 RD |
12994 | """ |
12995 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 12996 | |
248ed943 | 12997 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 12998 | """ |
248ed943 RD |
12999 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
13000 | ||
13001 | Look at all items and see if any intersect (or would overlap) the | |
13002 | given position and span. Returns True if so, False if there would be | |
13003 | no overlap. If an *excludeItem* is given then it will not be checked | |
13004 | for intersection, for example it may be the item we are checking the | |
13005 | position of. | |
0df68c9f | 13006 | """ |
248ed943 | 13007 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 13008 | |
2131d850 | 13009 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d14a1e28 RD |
13010 | |
13011 | #--------------------------------------------------------------------------- | |
13012 | ||
54f9ee45 RD |
13013 | Left = _core_.Left |
13014 | Top = _core_.Top | |
13015 | Right = _core_.Right | |
13016 | Bottom = _core_.Bottom | |
13017 | Width = _core_.Width | |
13018 | Height = _core_.Height | |
13019 | Centre = _core_.Centre | |
13020 | Center = _core_.Center | |
13021 | CentreX = _core_.CentreX | |
13022 | CentreY = _core_.CentreY | |
13023 | Unconstrained = _core_.Unconstrained | |
13024 | AsIs = _core_.AsIs | |
13025 | PercentOf = _core_.PercentOf | |
13026 | Above = _core_.Above | |
13027 | Below = _core_.Below | |
13028 | LeftOf = _core_.LeftOf | |
13029 | RightOf = _core_.RightOf | |
13030 | SameAs = _core_.SameAs | |
13031 | Absolute = _core_.Absolute | |
d14a1e28 | 13032 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 13033 | """ |
41e2b43e RD |
13034 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
13035 | one of eight possible constraints that a window can be involved in. | |
13036 | You will never need to create an instance of | |
13037 | wx.IndividualLayoutConstraint, rather you should create a | |
13038 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 13039 | that it contains. |
15afbcd0 | 13040 | """ |
0085ce49 RD |
13041 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13042 | def __init__(self): raise AttributeError, "No constructor defined" | |
13043 | __repr__ = _swig_repr | |
e811c8ce | 13044 | def Set(*args, **kwargs): |
41e2b43e RD |
13045 | """ |
13046 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
13047 | ||
13048 | Sets the properties of the constraint. Normally called by one of the | |
13049 | convenience functions such as Above, RightOf, SameAs. | |
13050 | """ | |
54f9ee45 | 13051 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
13052 | |
13053 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 13054 | """ |
a95a7133 | 13055 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 13056 | |
41e2b43e RD |
13057 | Constrains this edge to be to the left of the given window, with an |
13058 | optional margin. Implicitly, this is relative to the left edge of the | |
13059 | other window. | |
15afbcd0 | 13060 | """ |
54f9ee45 | 13061 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
13062 | |
13063 | def RightOf(*args, **kwargs): | |
15afbcd0 | 13064 | """ |
a95a7133 | 13065 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 13066 | |
41e2b43e RD |
13067 | Constrains this edge to be to the right of the given window, with an |
13068 | optional margin. Implicitly, this is relative to the right edge of the | |
13069 | other window. | |
15afbcd0 | 13070 | """ |
54f9ee45 | 13071 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
13072 | |
13073 | def Above(*args, **kwargs): | |
15afbcd0 | 13074 | """ |
a95a7133 | 13075 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 13076 | |
41e2b43e RD |
13077 | Constrains this edge to be above the given window, with an optional |
13078 | margin. Implicitly, this is relative to the top edge of the other | |
13079 | window. | |
15afbcd0 | 13080 | """ |
54f9ee45 | 13081 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
13082 | |
13083 | def Below(*args, **kwargs): | |
15afbcd0 | 13084 | """ |
a95a7133 | 13085 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 13086 | |
41e2b43e RD |
13087 | Constrains this edge to be below the given window, with an optional |
13088 | margin. Implicitly, this is relative to the bottom edge of the other | |
13089 | window. | |
15afbcd0 | 13090 | """ |
54f9ee45 | 13091 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
13092 | |
13093 | def SameAs(*args, **kwargs): | |
15afbcd0 | 13094 | """ |
a95a7133 | 13095 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 13096 | |
41e2b43e RD |
13097 | Constrains this edge or dimension to be to the same as the edge of the |
13098 | given window, with an optional margin. | |
15afbcd0 | 13099 | """ |
54f9ee45 | 13100 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
13101 | |
13102 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 13103 | """ |
a95a7133 | 13104 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 13105 | |
41e2b43e RD |
13106 | Constrains this edge or dimension to be to a percentage of the given |
13107 | window, with an optional margin. | |
15afbcd0 | 13108 | """ |
54f9ee45 | 13109 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
13110 | |
13111 | def Absolute(*args, **kwargs): | |
15afbcd0 | 13112 | """ |
a95a7133 | 13113 | Absolute(self, int val) |
15afbcd0 | 13114 | |
41e2b43e | 13115 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 13116 | """ |
54f9ee45 | 13117 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
13118 | |
13119 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 13120 | """ |
a95a7133 | 13121 | Unconstrained(self) |
15afbcd0 | 13122 | |
41e2b43e RD |
13123 | Sets this edge or dimension to be unconstrained, that is, dependent on |
13124 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 13125 | """ |
54f9ee45 | 13126 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
13127 | |
13128 | def AsIs(*args, **kwargs): | |
15afbcd0 | 13129 | """ |
a95a7133 | 13130 | AsIs(self) |
15afbcd0 | 13131 | |
41e2b43e RD |
13132 | Sets this edge or constraint to be whatever the window's value is at |
13133 | the moment. If either of the width and height constraints are *as is*, | |
13134 | the window will not be resized, but moved instead. This is important | |
13135 | when considering panel items which are intended to have a default | |
13136 | size, such as a button, which may take its size from the size of the | |
13137 | button label. | |
15afbcd0 | 13138 | """ |
54f9ee45 | 13139 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
13140 | |
13141 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 13142 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 13143 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
13144 | |
13145 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 13146 | """GetMyEdge(self) -> int""" |
54f9ee45 | 13147 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
13148 | |
13149 | def SetEdge(*args, **kwargs): | |
a95a7133 | 13150 | """SetEdge(self, int which)""" |
54f9ee45 | 13151 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
13152 | |
13153 | def SetValue(*args, **kwargs): | |
a95a7133 | 13154 | """SetValue(self, int v)""" |
54f9ee45 | 13155 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
13156 | |
13157 | def GetMargin(*args, **kwargs): | |
a95a7133 | 13158 | """GetMargin(self) -> int""" |
54f9ee45 | 13159 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
13160 | |
13161 | def SetMargin(*args, **kwargs): | |
a95a7133 | 13162 | """SetMargin(self, int m)""" |
54f9ee45 | 13163 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
13164 | |
13165 | def GetValue(*args, **kwargs): | |
a95a7133 | 13166 | """GetValue(self) -> int""" |
54f9ee45 | 13167 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
13168 | |
13169 | def GetPercent(*args, **kwargs): | |
a95a7133 | 13170 | """GetPercent(self) -> int""" |
54f9ee45 | 13171 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
13172 | |
13173 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 13174 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 13175 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
13176 | |
13177 | def GetDone(*args, **kwargs): | |
a95a7133 | 13178 | """GetDone(self) -> bool""" |
54f9ee45 | 13179 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
13180 | |
13181 | def SetDone(*args, **kwargs): | |
a95a7133 | 13182 | """SetDone(self, bool d)""" |
54f9ee45 | 13183 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
13184 | |
13185 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 13186 | """GetRelationship(self) -> int""" |
54f9ee45 | 13187 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
13188 | |
13189 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 13190 | """SetRelationship(self, int r)""" |
54f9ee45 | 13191 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
13192 | |
13193 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 13194 | """ |
a95a7133 | 13195 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
13196 | |
13197 | Reset constraint if it mentions otherWin | |
13198 | """ | |
54f9ee45 | 13199 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
13200 | |
13201 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 13202 | """ |
a95a7133 | 13203 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
13204 | |
13205 | Try to satisfy constraint | |
13206 | """ | |
54f9ee45 | 13207 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
13208 | |
13209 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 13210 | """ |
a95a7133 | 13211 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
13212 | |
13213 | Get the value of this edge or dimension, or if this | |
13214 | is not determinable, -1. | |
13215 | """ | |
54f9ee45 | 13216 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 13217 | |
97ab0f6a RD |
13218 | Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`") |
13219 | Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`") | |
13220 | MyEdge = property(GetMyEdge,doc="See `GetMyEdge`") | |
13221 | OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`") | |
13222 | OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`") | |
13223 | Percent = property(GetPercent,doc="See `GetPercent`") | |
13224 | Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`") | |
13225 | Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`") | |
2131d850 | 13226 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d14a1e28 RD |
13227 | |
13228 | class LayoutConstraints(Object): | |
15afbcd0 | 13229 | """ |
41e2b43e RD |
13230 | **Note:** constraints are now deprecated and you should use sizers |
13231 | instead. | |
15afbcd0 | 13232 | |
41e2b43e RD |
13233 | Objects of this class can be associated with a window to define its |
13234 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
13235 | |
13236 | The class consists of the following eight constraints of class | |
13237 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13238 | directly to set the appropriate constraints. | |
13239 | ||
13240 | * left: represents the left hand edge of the window | |
13241 | * right: represents the right hand edge of the window | |
13242 | * top: represents the top edge of the window | |
13243 | * bottom: represents the bottom edge of the window | |
13244 | * width: represents the width of the window | |
13245 | * height: represents the height of the window | |
13246 | * centreX: represents the horizontal centre point of the window | |
13247 | * centreY: represents the vertical centre point of the window | |
13248 | ||
41e2b43e RD |
13249 | Most constraints are initially set to have the relationship |
13250 | wxUnconstrained, which means that their values should be calculated by | |
13251 | looking at known constraints. The exceptions are width and height, | |
13252 | which are set to wxAsIs to ensure that if the user does not specify a | |
13253 | constraint, the existing width and height will be used, to be | |
13254 | compatible with panel items which often have take a default size. If | |
13255 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13256 | ||
13257 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
13258 | |
13259 | """ | |
0085ce49 RD |
13260 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13261 | __repr__ = _swig_repr | |
54f9ee45 RD |
13262 | left = property(_core_.LayoutConstraints_left_get) |
13263 | top = property(_core_.LayoutConstraints_top_get) | |
13264 | right = property(_core_.LayoutConstraints_right_get) | |
13265 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13266 | width = property(_core_.LayoutConstraints_width_get) | |
13267 | height = property(_core_.LayoutConstraints_height_get) | |
13268 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13269 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
0085ce49 | 13270 | def __init__(self, *args, **kwargs): |
a95a7133 | 13271 | """__init__(self) -> LayoutConstraints""" |
0085ce49 RD |
13272 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
13273 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
13274 | __del__ = lambda self : None; | |
e811c8ce | 13275 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 13276 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 13277 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
13278 | |
13279 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 13280 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 13281 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 13282 | |
2131d850 | 13283 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d14a1e28 RD |
13284 | |
13285 | #---------------------------------------------------------------------------- | |
13286 | ||
322913ce | 13287 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
13288 | try: |
13289 | True | |
13290 | except NameError: | |
322913ce RD |
13291 | __builtins__.True = 1==1 |
13292 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
13293 | def bool(value): return not not value |
13294 | __builtins__.bool = bool | |
d14a1e28 | 13295 | |
d14a1e28 RD |
13296 | |
13297 | ||
13298 | # workarounds for bad wxRTTI names | |
13299 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13300 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13301 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13302 | ||
13303 | ||
13304 | #---------------------------------------------------------------------------- | |
13305 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 13306 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
13307 | |
13308 | from __version__ import * | |
13309 | __version__ = VERSION_STRING | |
13310 | ||
7bc1e663 RD |
13311 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13312 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 13313 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 13314 | import warnings |
7bc1e663 | 13315 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 RD |
13316 | |
13317 | #---------------------------------------------------------------------------- | |
13318 | ||
70b7a5fe RD |
13319 | # Set wxPython's default string<-->unicode conversion encoding from |
13320 | # the locale, but only if Python's default hasn't been changed. (We | |
13321 | # assume that if the user has customized it already then that is the | |
13322 | # encoding we need to use as well.) | |
13323 | # | |
13324 | # The encoding selected here is used when string or unicode objects | |
13325 | # need to be converted in order to pass them to wxWidgets. Please be | |
13326 | # aware that the default encoding within the same locale may be | |
13327 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
13328 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13329 | # between the common latin/roman encodings. | |
396fb509 RD |
13330 | |
13331 | default = _sys.getdefaultencoding() | |
13332 | if default == 'ascii': | |
13333 | import locale | |
13334 | import codecs | |
13335 | try: | |
13336 | default = locale.getdefaultlocale()[1] | |
13337 | codecs.lookup(default) | |
70b7a5fe | 13338 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
13339 | default = _sys.getdefaultencoding() |
13340 | del locale | |
13341 | del codecs | |
5cbf236d RD |
13342 | if default: |
13343 | wx.SetDefaultPyEncoding(default) | |
13344 | del default | |
5cbf236d RD |
13345 | |
13346 | #---------------------------------------------------------------------------- | |
13347 | ||
d14a1e28 RD |
13348 | class PyDeadObjectError(AttributeError): |
13349 | pass | |
13350 | ||
d14a1e28 RD |
13351 | class _wxPyDeadObject(object): |
13352 | """ | |
13353 | Instances of wx objects that are OOR capable will have their __class__ | |
13354 | changed to this class when the C++ object is deleted. This should help | |
13355 | prevent crashes due to referencing a bogus C++ pointer. | |
13356 | """ | |
13357 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13358 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13359 | ||
3a04f143 | 13360 | def __repr__(self): |
d14a1e28 RD |
13361 | if not hasattr(self, "_name"): |
13362 | self._name = "[unknown]" | |
13363 | return self.reprStr % self._name | |
13364 | ||
3a04f143 | 13365 | def __getattr__(self, *args): |
d14a1e28 RD |
13366 | if not hasattr(self, "_name"): |
13367 | self._name = "[unknown]" | |
3a04f143 RD |
13368 | raise PyDeadObjectError(self.attrStr % self._name) |
13369 | ||
13370 | def __nonzero__(self): | |
13371 | return 0 | |
13372 | ||
13373 | ||
13374 | ||
13375 | class PyUnbornObjectError(AttributeError): | |
13376 | pass | |
13377 | ||
13378 | class _wxPyUnbornObject(object): | |
13379 | """ | |
54f9ee45 | 13380 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
13381 | imported, but their C++ instance is not created until the wx.App |
13382 | object is created and initialized. These object instances will | |
13383 | temporarily have their __class__ changed to this class so an | |
13384 | exception will be raised if they are used before the C++ instance | |
13385 | is ready. | |
13386 | """ | |
13387 | ||
13388 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13389 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13390 | ||
13391 | def __repr__(self): | |
13392 | #if not hasattr(self, "_name"): | |
13393 | # self._name = "[unknown]" | |
13394 | return self.reprStr #% self._name | |
13395 | ||
13396 | def __getattr__(self, *args): | |
13397 | #if not hasattr(self, "_name"): | |
13398 | # self._name = "[unknown]" | |
13399 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
13400 | |
13401 | def __nonzero__(self): | |
13402 | return 0 | |
13403 | ||
13404 | ||
13405 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
13406 | |
13407 | def CallAfter(callable, *args, **kw): | |
13408 | """ | |
13409 | Call the specified function after the current and pending event | |
13410 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
13411 | method calls from non-GUI threads. Any extra positional or |
13412 | keyword args are passed on to the callable when it is called. | |
13413 | ||
13414 | :see: `wx.FutureCall` | |
d14a1e28 RD |
13415 | """ |
13416 | app = wx.GetApp() | |
dfbb5885 | 13417 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 13418 | |
148275d3 RD |
13419 | if not hasattr(app, "_CallAfterId"): |
13420 | app._CallAfterId = wx.NewEventType() | |
13421 | app.Connect(-1, -1, app._CallAfterId, | |
13422 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 13423 | evt = wx.PyEvent() |
148275d3 | 13424 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
13425 | evt.callable = callable |
13426 | evt.args = args | |
13427 | evt.kw = kw | |
13428 | wx.PostEvent(app, evt) | |
13429 | ||
d14a1e28 RD |
13430 | #---------------------------------------------------------------------------- |
13431 | ||
13432 | ||
13433 | class FutureCall: | |
13434 | """ | |
8ac8dba0 | 13435 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
13436 | object once after the given amount of milliseconds, passing any |
13437 | positional or keyword args. The return value of the callable is | |
61863841 | 13438 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
13439 | |
13440 | If you don't need to get the return value or restart the timer | |
13441 | then there is no need to hold a reference to this object. It will | |
13442 | hold a reference to itself while the timer is running (the timer | |
13443 | has a reference to self.Notify) but the cycle will be broken when | |
13444 | the timer completes, automatically cleaning up the wx.FutureCall | |
13445 | object. | |
61863841 RD |
13446 | |
13447 | :see: `wx.CallAfter` | |
d14a1e28 RD |
13448 | """ |
13449 | def __init__(self, millis, callable, *args, **kwargs): | |
13450 | self.millis = millis | |
13451 | self.callable = callable | |
13452 | self.SetArgs(*args, **kwargs) | |
13453 | self.runCount = 0 | |
4276dc52 | 13454 | self.running = False |
d14a1e28 RD |
13455 | self.hasRun = False |
13456 | self.result = None | |
13457 | self.timer = None | |
13458 | self.Start() | |
13459 | ||
13460 | def __del__(self): | |
13461 | self.Stop() | |
13462 | ||
13463 | ||
13464 | def Start(self, millis=None, *args, **kwargs): | |
13465 | """ | |
13466 | (Re)start the timer | |
13467 | """ | |
13468 | self.hasRun = False | |
13469 | if millis is not None: | |
13470 | self.millis = millis | |
13471 | if args or kwargs: | |
13472 | self.SetArgs(*args, **kwargs) | |
13473 | self.Stop() | |
13474 | self.timer = wx.PyTimer(self.Notify) | |
13475 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 13476 | self.running = True |
d14a1e28 RD |
13477 | Restart = Start |
13478 | ||
13479 | ||
13480 | def Stop(self): | |
13481 | """ | |
13482 | Stop and destroy the timer. | |
13483 | """ | |
13484 | if self.timer is not None: | |
13485 | self.timer.Stop() | |
13486 | self.timer = None | |
13487 | ||
13488 | ||
13489 | def GetInterval(self): | |
13490 | if self.timer is not None: | |
13491 | return self.timer.GetInterval() | |
13492 | else: | |
13493 | return 0 | |
13494 | ||
13495 | ||
13496 | def IsRunning(self): | |
13497 | return self.timer is not None and self.timer.IsRunning() | |
13498 | ||
13499 | ||
13500 | def SetArgs(self, *args, **kwargs): | |
13501 | """ | |
13502 | (Re)set the args passed to the callable object. This is | |
13503 | useful in conjunction with Restart if you want to schedule a | |
13504 | new call to the same callable object but with different | |
13505 | parameters. | |
13506 | """ | |
13507 | self.args = args | |
13508 | self.kwargs = kwargs | |
13509 | ||
13510 | ||
13511 | def HasRun(self): | |
13512 | return self.hasRun | |
13513 | ||
13514 | def GetResult(self): | |
13515 | return self.result | |
13516 | ||
13517 | def Notify(self): | |
13518 | """ | |
13519 | The timer has expired so call the callable. | |
13520 | """ | |
13521 | if self.callable and getattr(self.callable, 'im_self', True): | |
13522 | self.runCount += 1 | |
4276dc52 | 13523 | self.running = False |
d14a1e28 RD |
13524 | self.result = self.callable(*self.args, **self.kwargs) |
13525 | self.hasRun = True | |
4276dc52 RD |
13526 | if not self.running: |
13527 | # if it wasn't restarted, then cleanup | |
13528 | wx.CallAfter(self.Stop) | |
d14a1e28 | 13529 | |
97ab0f6a RD |
13530 | Interval = property(GetInterval) |
13531 | Result = property(GetResult) | |
d14a1e28 | 13532 | |
a95a7133 RD |
13533 | |
13534 | #---------------------------------------------------------------------------- | |
13535 | # Control which items in this module should be documented by epydoc. | |
13536 | # We allow only classes and functions, which will help reduce the size | |
13537 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13538 | # and etc that don't make much sense by themselves, but are instead | |
13539 | # documented (or will be) as part of the classes/functions/methods | |
13540 | # where they should be used. | |
13541 | ||
66c033b4 RD |
13542 | class __DocFilter: |
13543 | """ | |
13544 | A filter for epydoc that only allows non-Ptr classes and | |
34e0a3bb | 13545 | functions, in order to reduce the clutter in the API docs. |
66c033b4 RD |
13546 | """ |
13547 | def __init__(self, globals): | |
13548 | self._globals = globals | |
13549 | ||
13550 | def __call__(self, name): | |
13551 | import types | |
13552 | obj = self._globals.get(name, None) | |
34e0a3bb RD |
13553 | |
13554 | # only document classes and function | |
66c033b4 RD |
13555 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: |
13556 | return False | |
34e0a3bb RD |
13557 | |
13558 | # skip other things that are private or will be documented as part of somethign else | |
0085ce49 | 13559 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
66c033b4 | 13560 | return False |
34e0a3bb RD |
13561 | |
13562 | # skip functions that are duplicates of static functions in a class | |
13563 | if name.find('_') != -1: | |
13564 | cls = self._globals.get(name.split('_')[0], None) | |
13565 | methname = name.split('_')[1] | |
13566 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
13567 | return False | |
13568 | ||
66c033b4 | 13569 | return True |
a95a7133 | 13570 | |
d14a1e28 RD |
13571 | #---------------------------------------------------------------------------- |
13572 | #---------------------------------------------------------------------------- | |
13573 | ||
13574 | # Import other modules in this package that should show up in the | |
13575 | # "core" wx namespace | |
54f9ee45 RD |
13576 | from _gdi import * |
13577 | from _windows import * | |
13578 | from _controls import * | |
13579 | from _misc import * | |
d14a1e28 RD |
13580 | |
13581 | #---------------------------------------------------------------------------- | |
13582 | #---------------------------------------------------------------------------- | |
13583 | ||
13584 | ||
32fe5131 | 13585 |