]>
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 | |
208 | ID_CUT = _core_.ID_CUT | |
209 | ID_COPY = _core_.ID_COPY | |
210 | ID_PASTE = _core_.ID_PASTE | |
211 | ID_CLEAR = _core_.ID_CLEAR | |
212 | ID_FIND = _core_.ID_FIND | |
213 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
214 | ID_SELECTALL = _core_.ID_SELECTALL | |
215 | ID_DELETE = _core_.ID_DELETE | |
216 | ID_REPLACE = _core_.ID_REPLACE | |
217 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
218 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
219 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
220 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
221 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
222 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
223 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
224 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
225 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
226 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
227 | ID_FILE1 = _core_.ID_FILE1 | |
228 | ID_FILE2 = _core_.ID_FILE2 | |
229 | ID_FILE3 = _core_.ID_FILE3 | |
230 | ID_FILE4 = _core_.ID_FILE4 | |
231 | ID_FILE5 = _core_.ID_FILE5 | |
232 | ID_FILE6 = _core_.ID_FILE6 | |
233 | ID_FILE7 = _core_.ID_FILE7 | |
234 | ID_FILE8 = _core_.ID_FILE8 | |
235 | ID_FILE9 = _core_.ID_FILE9 | |
236 | ID_OK = _core_.ID_OK | |
237 | ID_CANCEL = _core_.ID_CANCEL | |
238 | ID_APPLY = _core_.ID_APPLY | |
239 | ID_YES = _core_.ID_YES | |
240 | ID_NO = _core_.ID_NO | |
241 | ID_STATIC = _core_.ID_STATIC | |
242 | ID_FORWARD = _core_.ID_FORWARD | |
243 | ID_BACKWARD = _core_.ID_BACKWARD | |
244 | ID_DEFAULT = _core_.ID_DEFAULT | |
245 | ID_MORE = _core_.ID_MORE | |
246 | ID_SETUP = _core_.ID_SETUP | |
247 | ID_RESET = _core_.ID_RESET | |
248 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
249 | ID_YESTOALL = _core_.ID_YESTOALL | |
250 | ID_NOTOALL = _core_.ID_NOTOALL | |
251 | ID_ABORT = _core_.ID_ABORT | |
252 | ID_RETRY = _core_.ID_RETRY | |
253 | ID_IGNORE = _core_.ID_IGNORE | |
7bc1e663 RD |
254 | ID_ADD = _core_.ID_ADD |
255 | ID_REMOVE = _core_.ID_REMOVE | |
256 | ID_UP = _core_.ID_UP | |
257 | ID_DOWN = _core_.ID_DOWN | |
258 | ID_HOME = _core_.ID_HOME | |
259 | ID_REFRESH = _core_.ID_REFRESH | |
260 | ID_STOP = _core_.ID_STOP | |
261 | ID_INDEX = _core_.ID_INDEX | |
262 | ID_BOLD = _core_.ID_BOLD | |
263 | ID_ITALIC = _core_.ID_ITALIC | |
264 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
265 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
266 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
267 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
268 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
269 | ID_INDENT = _core_.ID_INDENT | |
270 | ID_UNINDENT = _core_.ID_UNINDENT | |
271 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
272 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
273 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
274 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
275 | ID_UNDELETE = _core_.ID_UNDELETE | |
276 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
54f9ee45 | 277 | ID_HIGHEST = _core_.ID_HIGHEST |
54f9ee45 RD |
278 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE |
279 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
280 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
281 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
282 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
283 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
e505d15e RD |
284 | PD_SMOOTH = _core_.PD_SMOOTH |
285 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
54f9ee45 RD |
286 | MENU_TEAROFF = _core_.MENU_TEAROFF |
287 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
288 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
289 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
290 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
291 | LI_VERTICAL = _core_.LI_VERTICAL | |
292 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
293 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
294 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
295 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
296 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
297 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
298 | MM_TEXT = _core_.MM_TEXT | |
299 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
300 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
301 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
302 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
303 | MM_TWIPS = _core_.MM_TWIPS | |
304 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
305 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
306 | MM_POINTS = _core_.MM_POINTS | |
307 | MM_METRIC = _core_.MM_METRIC | |
308 | CENTRE = _core_.CENTRE | |
309 | CENTER = _core_.CENTER | |
310 | HORIZONTAL = _core_.HORIZONTAL | |
311 | VERTICAL = _core_.VERTICAL | |
312 | BOTH = _core_.BOTH | |
313 | LEFT = _core_.LEFT | |
314 | RIGHT = _core_.RIGHT | |
315 | UP = _core_.UP | |
316 | DOWN = _core_.DOWN | |
317 | TOP = _core_.TOP | |
318 | BOTTOM = _core_.BOTTOM | |
319 | NORTH = _core_.NORTH | |
320 | SOUTH = _core_.SOUTH | |
321 | WEST = _core_.WEST | |
322 | EAST = _core_.EAST | |
323 | ALL = _core_.ALL | |
324 | ALIGN_NOT = _core_.ALIGN_NOT | |
325 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
326 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
327 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
328 | ALIGN_TOP = _core_.ALIGN_TOP | |
329 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
330 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
331 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
332 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
333 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
334 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
335 | ALIGN_MASK = _core_.ALIGN_MASK | |
336 | STRETCH_NOT = _core_.STRETCH_NOT | |
337 | SHRINK = _core_.SHRINK | |
338 | GROW = _core_.GROW | |
339 | EXPAND = _core_.EXPAND | |
340 | SHAPED = _core_.SHAPED | |
341 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
342 | TILE = _core_.TILE | |
343 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
344 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
345 | BORDER_NONE = _core_.BORDER_NONE | |
346 | BORDER_STATIC = _core_.BORDER_STATIC | |
347 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
348 | BORDER_RAISED = _core_.BORDER_RAISED | |
349 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
350 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
351 | BORDER_MASK = _core_.BORDER_MASK | |
7bc1e663 RD |
352 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
353 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
354 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
54f9ee45 RD |
355 | DEFAULT = _core_.DEFAULT |
356 | DECORATIVE = _core_.DECORATIVE | |
357 | ROMAN = _core_.ROMAN | |
358 | SCRIPT = _core_.SCRIPT | |
359 | SWISS = _core_.SWISS | |
360 | MODERN = _core_.MODERN | |
361 | TELETYPE = _core_.TELETYPE | |
362 | VARIABLE = _core_.VARIABLE | |
363 | FIXED = _core_.FIXED | |
364 | NORMAL = _core_.NORMAL | |
365 | LIGHT = _core_.LIGHT | |
366 | BOLD = _core_.BOLD | |
367 | ITALIC = _core_.ITALIC | |
368 | SLANT = _core_.SLANT | |
369 | SOLID = _core_.SOLID | |
370 | DOT = _core_.DOT | |
371 | LONG_DASH = _core_.LONG_DASH | |
372 | SHORT_DASH = _core_.SHORT_DASH | |
373 | DOT_DASH = _core_.DOT_DASH | |
374 | USER_DASH = _core_.USER_DASH | |
375 | TRANSPARENT = _core_.TRANSPARENT | |
376 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
377 | STIPPLE_MASK = _core_.STIPPLE_MASK |
378 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
54f9ee45 RD |
379 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
380 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
381 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
382 | CROSS_HATCH = _core_.CROSS_HATCH | |
383 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
384 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
385 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
386 | JOIN_MITER = _core_.JOIN_MITER | |
387 | JOIN_ROUND = _core_.JOIN_ROUND | |
388 | CAP_ROUND = _core_.CAP_ROUND | |
389 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
390 | CAP_BUTT = _core_.CAP_BUTT | |
391 | CLEAR = _core_.CLEAR | |
392 | XOR = _core_.XOR | |
393 | INVERT = _core_.INVERT | |
394 | OR_REVERSE = _core_.OR_REVERSE | |
395 | AND_REVERSE = _core_.AND_REVERSE | |
396 | COPY = _core_.COPY | |
397 | AND = _core_.AND | |
398 | AND_INVERT = _core_.AND_INVERT | |
399 | NO_OP = _core_.NO_OP | |
400 | NOR = _core_.NOR | |
401 | EQUIV = _core_.EQUIV | |
402 | SRC_INVERT = _core_.SRC_INVERT | |
403 | OR_INVERT = _core_.OR_INVERT | |
404 | NAND = _core_.NAND | |
405 | OR = _core_.OR | |
406 | SET = _core_.SET | |
407 | WXK_BACK = _core_.WXK_BACK | |
408 | WXK_TAB = _core_.WXK_TAB | |
409 | WXK_RETURN = _core_.WXK_RETURN | |
410 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
411 | WXK_SPACE = _core_.WXK_SPACE | |
412 | WXK_DELETE = _core_.WXK_DELETE | |
413 | WXK_START = _core_.WXK_START | |
414 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
415 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
416 | WXK_CANCEL = _core_.WXK_CANCEL | |
417 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
418 | WXK_CLEAR = _core_.WXK_CLEAR | |
419 | WXK_SHIFT = _core_.WXK_SHIFT | |
420 | WXK_ALT = _core_.WXK_ALT | |
421 | WXK_CONTROL = _core_.WXK_CONTROL | |
422 | WXK_MENU = _core_.WXK_MENU | |
423 | WXK_PAUSE = _core_.WXK_PAUSE | |
424 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
425 | WXK_PRIOR = _core_.WXK_PRIOR | |
426 | WXK_NEXT = _core_.WXK_NEXT | |
427 | WXK_END = _core_.WXK_END | |
428 | WXK_HOME = _core_.WXK_HOME | |
429 | WXK_LEFT = _core_.WXK_LEFT | |
430 | WXK_UP = _core_.WXK_UP | |
431 | WXK_RIGHT = _core_.WXK_RIGHT | |
432 | WXK_DOWN = _core_.WXK_DOWN | |
433 | WXK_SELECT = _core_.WXK_SELECT | |
434 | WXK_PRINT = _core_.WXK_PRINT | |
435 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
436 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
437 | WXK_INSERT = _core_.WXK_INSERT | |
438 | WXK_HELP = _core_.WXK_HELP | |
439 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
440 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
441 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
442 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
443 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
444 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
445 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
446 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
447 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
448 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
449 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
450 | WXK_ADD = _core_.WXK_ADD | |
451 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
452 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
453 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
454 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
455 | WXK_F1 = _core_.WXK_F1 | |
456 | WXK_F2 = _core_.WXK_F2 | |
457 | WXK_F3 = _core_.WXK_F3 | |
458 | WXK_F4 = _core_.WXK_F4 | |
459 | WXK_F5 = _core_.WXK_F5 | |
460 | WXK_F6 = _core_.WXK_F6 | |
461 | WXK_F7 = _core_.WXK_F7 | |
462 | WXK_F8 = _core_.WXK_F8 | |
463 | WXK_F9 = _core_.WXK_F9 | |
464 | WXK_F10 = _core_.WXK_F10 | |
465 | WXK_F11 = _core_.WXK_F11 | |
466 | WXK_F12 = _core_.WXK_F12 | |
467 | WXK_F13 = _core_.WXK_F13 | |
468 | WXK_F14 = _core_.WXK_F14 | |
469 | WXK_F15 = _core_.WXK_F15 | |
470 | WXK_F16 = _core_.WXK_F16 | |
471 | WXK_F17 = _core_.WXK_F17 | |
472 | WXK_F18 = _core_.WXK_F18 | |
473 | WXK_F19 = _core_.WXK_F19 | |
474 | WXK_F20 = _core_.WXK_F20 | |
475 | WXK_F21 = _core_.WXK_F21 | |
476 | WXK_F22 = _core_.WXK_F22 | |
477 | WXK_F23 = _core_.WXK_F23 | |
478 | WXK_F24 = _core_.WXK_F24 | |
479 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
480 | WXK_SCROLL = _core_.WXK_SCROLL | |
481 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
482 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
483 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
484 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
485 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
486 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
487 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
488 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
489 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
490 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
491 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
492 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
493 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
494 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
495 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
496 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
497 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
498 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
499 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
500 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
501 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
502 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
503 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
504 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
505 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
506 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
507 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
508 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
509 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
510 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
511 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
512 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
513 | WXK_COMMAND = _core_.WXK_COMMAND |
514 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
515 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
516 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
517 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
518 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
519 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
520 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
521 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
522 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
523 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
524 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
525 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
526 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
527 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
528 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
529 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
530 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
531 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
532 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
533 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
54f9ee45 RD |
534 | PAPER_NONE = _core_.PAPER_NONE |
535 | PAPER_LETTER = _core_.PAPER_LETTER | |
536 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
537 | PAPER_A4 = _core_.PAPER_A4 | |
538 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
539 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
540 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
541 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
542 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
543 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
544 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
545 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
546 | PAPER_A3 = _core_.PAPER_A3 | |
547 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
548 | PAPER_A5 = _core_.PAPER_A5 | |
549 | PAPER_B4 = _core_.PAPER_B4 | |
550 | PAPER_B5 = _core_.PAPER_B5 | |
551 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
552 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
553 | PAPER_10X14 = _core_.PAPER_10X14 | |
554 | PAPER_11X17 = _core_.PAPER_11X17 | |
555 | PAPER_NOTE = _core_.PAPER_NOTE | |
556 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
557 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
558 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
559 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
560 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
561 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
562 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
563 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
564 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
565 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
566 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
567 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
568 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
569 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
570 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
571 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
572 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
573 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
574 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
575 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
576 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
577 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
578 | PAPER_9X11 = _core_.PAPER_9X11 | |
579 | PAPER_10X11 = _core_.PAPER_10X11 | |
580 | PAPER_15X11 = _core_.PAPER_15X11 | |
581 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
582 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
583 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
584 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
585 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
586 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
587 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
588 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
589 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
590 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
591 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
592 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
593 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
594 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
595 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
596 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
597 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
598 | PAPER_A2 = _core_.PAPER_A2 | |
599 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
600 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
6c75a4cf RD |
601 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
602 | PAPER_A6 = _core_.PAPER_A6 | |
603 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
604 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
605 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
606 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
607 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
608 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
609 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
610 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
611 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
612 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
613 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
614 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
615 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
616 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
617 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
618 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
619 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
620 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
621 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
622 | PAPER_12X11 = _core_.PAPER_12X11 | |
623 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
624 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
625 | PAPER_P16K = _core_.PAPER_P16K | |
626 | PAPER_P32K = _core_.PAPER_P32K | |
627 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
628 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
629 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
630 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
631 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
632 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
633 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
634 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
635 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
636 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
637 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
638 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
639 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
640 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
641 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
642 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
643 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
644 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
645 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
646 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
647 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
648 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
649 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
650 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
54f9ee45 RD |
651 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
652 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
653 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
654 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
655 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
656 | ITEM_CHECK = _core_.ITEM_CHECK | |
657 | ITEM_RADIO = _core_.ITEM_RADIO | |
658 | ITEM_MAX = _core_.ITEM_MAX | |
659 | HT_NOWHERE = _core_.HT_NOWHERE | |
660 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
661 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
662 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
663 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
664 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
665 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
666 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
667 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
668 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
669 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
670 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
671 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
672 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
673 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
674 | HT_MAX = _core_.HT_MAX | |
675 | MOD_NONE = _core_.MOD_NONE | |
676 | MOD_ALT = _core_.MOD_ALT | |
677 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 678 | MOD_ALTGR = _core_.MOD_ALTGR |
54f9ee45 | 679 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 680 | MOD_META = _core_.MOD_META |
54f9ee45 | 681 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
682 | MOD_CMD = _core_.MOD_CMD |
683 | MOD_ALL = _core_.MOD_ALL | |
54f9ee45 RD |
684 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
685 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
686 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
d14a1e28 RD |
687 | #--------------------------------------------------------------------------- |
688 | ||
689 | class Object(object): | |
0df68c9f RD |
690 | """ |
691 | The base class for most wx objects, although in wxPython not | |
692 | much functionality is needed nor exposed. | |
693 | """ | |
0085ce49 RD |
694 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
695 | def __init__(self): raise AttributeError, "No constructor defined" | |
696 | __repr__ = _swig_repr | |
e811c8ce | 697 | def GetClassName(*args, **kwargs): |
0df68c9f | 698 | """ |
a95a7133 | 699 | GetClassName(self) -> String |
e811c8ce | 700 | |
a95a7133 | 701 | Returns the class name of the C++ class using wxRTTI. |
0df68c9f | 702 | """ |
54f9ee45 | 703 | return _core_.Object_GetClassName(*args, **kwargs) |
e811c8ce RD |
704 | |
705 | def Destroy(*args, **kwargs): | |
0df68c9f | 706 | """ |
a95a7133 | 707 | Destroy(self) |
e811c8ce | 708 | |
0df68c9f RD |
709 | Deletes the C++ object this Python object is a proxy for. |
710 | """ | |
7e08d4ef RD |
711 | val = _core_.Object_Destroy(*args, **kwargs) |
712 | args[0].thisown = 0 | |
713 | return val | |
e811c8ce | 714 | |
2131d850 | 715 | _core_.Object_swigregister(Object) |
54f9ee45 | 716 | _wxPySetDictionary = _core_._wxPySetDictionary |
54f9ee45 | 717 | cvar = _core_.cvar |
196addbf | 718 | EmptyString = cvar.EmptyString |
d14a1e28 RD |
719 | |
720 | #--------------------------------------------------------------------------- | |
721 | ||
54f9ee45 RD |
722 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
723 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
724 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
725 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
726 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
727 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
728 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
729 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
730 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
731 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
732 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
733 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
734 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
735 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
736 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
737 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
738 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
739 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
740 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
741 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
742 | CURSOR_NONE = _core_.CURSOR_NONE | |
743 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
744 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
745 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
746 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
747 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
748 | CURSOR_HAND = _core_.CURSOR_HAND | |
749 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
750 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
751 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
752 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
753 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
754 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
755 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
756 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
757 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
758 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
759 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
760 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
761 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
762 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
763 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
764 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
765 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
766 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
767 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
768 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
769 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
770 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
771 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
772 | CURSOR_MAX = _core_.CURSOR_MAX | |
d14a1e28 RD |
773 | #--------------------------------------------------------------------------- |
774 | ||
775 | class Size(object): | |
0df68c9f | 776 | """ |
41e2b43e | 777 | wx.Size is a useful data structure used to represent the size of |
0085ce49 RD |
778 | something. It simply contains integer width and height |
779 | properties. In most places in wxPython where a wx.Size is | |
093d3ff1 | 780 | expected a (width, height) tuple can be used instead. |
0df68c9f | 781 | """ |
0085ce49 RD |
782 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
783 | __repr__ = _swig_repr | |
54f9ee45 RD |
784 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
785 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
242b7b46 | 786 | x = width; y = height |
0085ce49 | 787 | def __init__(self, *args, **kwargs): |
0df68c9f | 788 | """ |
a95a7133 | 789 | __init__(self, int w=0, int h=0) -> Size |
e811c8ce | 790 | |
0df68c9f RD |
791 | Creates a size object. |
792 | """ | |
0085ce49 RD |
793 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) |
794 | __swig_destroy__ = _core_.delete_Size | |
795 | __del__ = lambda self : None; | |
e811c8ce | 796 | def __eq__(*args, **kwargs): |
0df68c9f | 797 | """ |
e9d6f3a4 | 798 | __eq__(self, PyObject other) -> bool |
e811c8ce | 799 | |
0df68c9f RD |
800 | Test for equality of wx.Size objects. |
801 | """ | |
54f9ee45 | 802 | return _core_.Size___eq__(*args, **kwargs) |
e811c8ce RD |
803 | |
804 | def __ne__(*args, **kwargs): | |
0df68c9f | 805 | """ |
e9d6f3a4 | 806 | __ne__(self, PyObject other) -> bool |
e811c8ce | 807 | |
e9d6f3a4 | 808 | Test for inequality of wx.Size objects. |
0df68c9f | 809 | """ |
54f9ee45 | 810 | return _core_.Size___ne__(*args, **kwargs) |
e811c8ce RD |
811 | |
812 | def __add__(*args, **kwargs): | |
0df68c9f | 813 | """ |
a95a7133 | 814 | __add__(self, Size sz) -> Size |
e811c8ce | 815 | |
0df68c9f RD |
816 | Add sz's proprties to this and return the result. |
817 | """ | |
54f9ee45 | 818 | return _core_.Size___add__(*args, **kwargs) |
e811c8ce RD |
819 | |
820 | def __sub__(*args, **kwargs): | |
0df68c9f | 821 | """ |
a95a7133 | 822 | __sub__(self, Size sz) -> Size |
e811c8ce | 823 | |
0df68c9f RD |
824 | Subtract sz's properties from this and return the result. |
825 | """ | |
54f9ee45 | 826 | return _core_.Size___sub__(*args, **kwargs) |
e811c8ce RD |
827 | |
828 | def IncTo(*args, **kwargs): | |
0df68c9f | 829 | """ |
a95a7133 | 830 | IncTo(self, Size sz) |
e811c8ce | 831 | |
0df68c9f RD |
832 | Increments this object so that both of its dimensions are not less |
833 | than the corresponding dimensions of the size. | |
834 | """ | |
54f9ee45 | 835 | return _core_.Size_IncTo(*args, **kwargs) |
e811c8ce RD |
836 | |
837 | def DecTo(*args, **kwargs): | |
0df68c9f | 838 | """ |
a95a7133 | 839 | DecTo(self, Size sz) |
e811c8ce | 840 | |
0df68c9f RD |
841 | Decrements this object so that both of its dimensions are not greater |
842 | than the corresponding dimensions of the size. | |
843 | """ | |
54f9ee45 | 844 | return _core_.Size_DecTo(*args, **kwargs) |
e811c8ce | 845 | |
10044bf1 RD |
846 | def Scale(*args, **kwargs): |
847 | """ | |
848 | Scale(self, float xscale, float yscale) | |
849 | ||
850 | Scales the dimensions of this object by the given factors. | |
851 | """ | |
852 | return _core_.Size_Scale(*args, **kwargs) | |
853 | ||
e811c8ce | 854 | def Set(*args, **kwargs): |
0df68c9f | 855 | """ |
a95a7133 | 856 | Set(self, int w, int h) |
e811c8ce | 857 | |
0df68c9f RD |
858 | Set both width and height. |
859 | """ | |
54f9ee45 | 860 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
861 | |
862 | def SetWidth(*args, **kwargs): | |
a95a7133 | 863 | """SetWidth(self, int w)""" |
54f9ee45 | 864 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
865 | |
866 | def SetHeight(*args, **kwargs): | |
a95a7133 | 867 | """SetHeight(self, int h)""" |
54f9ee45 | 868 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
869 | |
870 | def GetWidth(*args, **kwargs): | |
a95a7133 | 871 | """GetWidth(self) -> int""" |
54f9ee45 | 872 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
873 | |
874 | def GetHeight(*args, **kwargs): | |
a95a7133 | 875 | """GetHeight(self) -> int""" |
54f9ee45 | 876 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 877 | |
74a57fcd RD |
878 | def IsFullySpecified(*args, **kwargs): |
879 | """ | |
a95a7133 | 880 | IsFullySpecified(self) -> bool |
74a57fcd RD |
881 | |
882 | Returns True if both components of the size are non-default values. | |
883 | """ | |
54f9ee45 | 884 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
885 | |
886 | def SetDefaults(*args, **kwargs): | |
887 | """ | |
a95a7133 | 888 | SetDefaults(self, Size size) |
74a57fcd | 889 | |
41e2b43e RD |
890 | Combine this size with the other one replacing the default components |
891 | of this object (i.e. equal to -1) with those of the other. | |
74a57fcd | 892 | """ |
54f9ee45 | 893 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 894 | |
e811c8ce | 895 | def Get(*args, **kwargs): |
0df68c9f RD |
896 | """ |
897 | Get() -> (width,height) | |
e811c8ce | 898 | |
0df68c9f RD |
899 | Returns the width and height properties as a tuple. |
900 | """ | |
54f9ee45 | 901 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 902 | |
41e2b43e | 903 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
904 | def __str__(self): return str(self.Get()) |
905 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
906 | def __len__(self): return len(self.Get()) | |
907 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
908 | def __setitem__(self, index, val): |
909 | if index == 0: self.width = val | |
910 | elif index == 1: self.height = val | |
911 | else: raise IndexError | |
e811c8ce | 912 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
913 | __safe_for_unpickling__ = True |
914 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 | 915 | |
2131d850 | 916 | _core_.Size_swigregister(Size) |
d14a1e28 RD |
917 | |
918 | #--------------------------------------------------------------------------- | |
919 | ||
920 | class RealPoint(object): | |
0df68c9f | 921 | """ |
41e2b43e RD |
922 | A data structure for representing a point or position with floating |
923 | point x and y properties. In wxPython most places that expect a | |
924 | wx.RealPoint can also accept a (x,y) tuple. | |
0df68c9f | 925 | """ |
0085ce49 RD |
926 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
927 | __repr__ = _swig_repr | |
54f9ee45 RD |
928 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
929 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
0085ce49 | 930 | def __init__(self, *args, **kwargs): |
0df68c9f | 931 | """ |
a95a7133 | 932 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 933 | |
0df68c9f RD |
934 | Create a wx.RealPoint object |
935 | """ | |
0085ce49 RD |
936 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
937 | __swig_destroy__ = _core_.delete_RealPoint | |
938 | __del__ = lambda self : None; | |
e811c8ce | 939 | def __eq__(*args, **kwargs): |
0df68c9f | 940 | """ |
e9d6f3a4 | 941 | __eq__(self, PyObject other) -> bool |
e811c8ce | 942 | |
0df68c9f RD |
943 | Test for equality of wx.RealPoint objects. |
944 | """ | |
54f9ee45 | 945 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
946 | |
947 | def __ne__(*args, **kwargs): | |
0df68c9f | 948 | """ |
e9d6f3a4 | 949 | __ne__(self, PyObject other) -> bool |
e811c8ce | 950 | |
0df68c9f RD |
951 | Test for inequality of wx.RealPoint objects. |
952 | """ | |
54f9ee45 | 953 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
954 | |
955 | def __add__(*args, **kwargs): | |
0df68c9f | 956 | """ |
a95a7133 | 957 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 958 | |
0df68c9f RD |
959 | Add pt's proprties to this and return the result. |
960 | """ | |
54f9ee45 | 961 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
962 | |
963 | def __sub__(*args, **kwargs): | |
0df68c9f | 964 | """ |
a95a7133 | 965 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 966 | |
0df68c9f RD |
967 | Subtract pt's proprties from this and return the result |
968 | """ | |
54f9ee45 | 969 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
970 | |
971 | def Set(*args, **kwargs): | |
0df68c9f | 972 | """ |
a95a7133 | 973 | Set(self, double x, double y) |
e811c8ce | 974 | |
0df68c9f RD |
975 | Set both the x and y properties |
976 | """ | |
54f9ee45 | 977 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
978 | |
979 | def Get(*args, **kwargs): | |
0df68c9f RD |
980 | """ |
981 | Get() -> (x,y) | |
e811c8ce | 982 | |
0df68c9f RD |
983 | Return the x and y properties as a tuple. |
984 | """ | |
54f9ee45 | 985 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 986 | |
41e2b43e | 987 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
988 | def __str__(self): return str(self.Get()) |
989 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
990 | def __len__(self): return len(self.Get()) | |
991 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 992 | def __setitem__(self, index, val): |
e811c8ce RD |
993 | if index == 0: self.x = val |
994 | elif index == 1: self.y = val | |
d14a1e28 | 995 | else: raise IndexError |
e811c8ce | 996 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
997 | __safe_for_unpickling__ = True |
998 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 | 999 | |
2131d850 | 1000 | _core_.RealPoint_swigregister(RealPoint) |
d14a1e28 RD |
1001 | |
1002 | #--------------------------------------------------------------------------- | |
1003 | ||
1004 | class Point(object): | |
0df68c9f | 1005 | """ |
41e2b43e RD |
1006 | A data structure for representing a point or position with integer x |
1007 | and y properties. Most places in wxPython that expect a wx.Point can | |
1008 | also accept a (x,y) tuple. | |
0df68c9f | 1009 | """ |
0085ce49 RD |
1010 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1011 | __repr__ = _swig_repr | |
54f9ee45 RD |
1012 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1013 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
0085ce49 | 1014 | def __init__(self, *args, **kwargs): |
0df68c9f | 1015 | """ |
a95a7133 | 1016 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1017 | |
0df68c9f RD |
1018 | Create a wx.Point object |
1019 | """ | |
0085ce49 RD |
1020 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1021 | __swig_destroy__ = _core_.delete_Point | |
1022 | __del__ = lambda self : None; | |
e811c8ce | 1023 | def __eq__(*args, **kwargs): |
0df68c9f | 1024 | """ |
e9d6f3a4 | 1025 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1026 | |
0df68c9f RD |
1027 | Test for equality of wx.Point objects. |
1028 | """ | |
54f9ee45 | 1029 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1030 | |
1031 | def __ne__(*args, **kwargs): | |
0df68c9f | 1032 | """ |
e9d6f3a4 | 1033 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1034 | |
0df68c9f RD |
1035 | Test for inequality of wx.Point objects. |
1036 | """ | |
54f9ee45 | 1037 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1038 | |
1039 | def __add__(*args, **kwargs): | |
0df68c9f | 1040 | """ |
a95a7133 | 1041 | __add__(self, Point pt) -> Point |
e811c8ce | 1042 | |
0df68c9f RD |
1043 | Add pt's proprties to this and return the result. |
1044 | """ | |
54f9ee45 | 1045 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1046 | |
1047 | def __sub__(*args, **kwargs): | |
0df68c9f | 1048 | """ |
a95a7133 | 1049 | __sub__(self, Point pt) -> Point |
e811c8ce | 1050 | |
0df68c9f RD |
1051 | Subtract pt's proprties from this and return the result |
1052 | """ | |
54f9ee45 | 1053 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1054 | |
1055 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1056 | """ |
a95a7133 | 1057 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1058 | |
0df68c9f RD |
1059 | Add pt to this object. |
1060 | """ | |
54f9ee45 | 1061 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1062 | |
1063 | def __isub__(*args, **kwargs): | |
0df68c9f | 1064 | """ |
a95a7133 | 1065 | __isub__(self, Point pt) -> Point |
e811c8ce | 1066 | |
0df68c9f RD |
1067 | Subtract pt from this object. |
1068 | """ | |
54f9ee45 | 1069 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1070 | |
1071 | def Set(*args, **kwargs): | |
0df68c9f | 1072 | """ |
a95a7133 | 1073 | Set(self, long x, long y) |
e811c8ce | 1074 | |
0df68c9f RD |
1075 | Set both the x and y properties |
1076 | """ | |
54f9ee45 | 1077 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1078 | |
1079 | def Get(*args, **kwargs): | |
0df68c9f RD |
1080 | """ |
1081 | Get() -> (x,y) | |
e811c8ce | 1082 | |
0df68c9f RD |
1083 | Return the x and y properties as a tuple. |
1084 | """ | |
54f9ee45 | 1085 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1086 | |
41e2b43e | 1087 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1088 | def __str__(self): return str(self.Get()) |
1089 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1090 | def __len__(self): return len(self.Get()) | |
1091 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1092 | def __setitem__(self, index, val): |
1093 | if index == 0: self.x = val | |
1094 | elif index == 1: self.y = val | |
1095 | else: raise IndexError | |
e811c8ce | 1096 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1097 | __safe_for_unpickling__ = True |
1098 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 | 1099 | |
2131d850 | 1100 | _core_.Point_swigregister(Point) |
d14a1e28 RD |
1101 | |
1102 | #--------------------------------------------------------------------------- | |
1103 | ||
1104 | class Rect(object): | |
0df68c9f | 1105 | """ |
41e2b43e RD |
1106 | A class for representing and manipulating rectangles. It has x, y, |
1107 | width and height properties. In wxPython most palces that expect a | |
1108 | wx.Rect can also accept a (x,y,width,height) tuple. | |
0df68c9f | 1109 | """ |
0085ce49 RD |
1110 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1111 | __repr__ = _swig_repr | |
1112 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1113 | """ |
a95a7133 | 1114 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1115 | |
0df68c9f RD |
1116 | Create a new Rect object. |
1117 | """ | |
0085ce49 RD |
1118 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1119 | __swig_destroy__ = _core_.delete_Rect | |
1120 | __del__ = lambda self : None; | |
e811c8ce | 1121 | def GetX(*args, **kwargs): |
a95a7133 | 1122 | """GetX(self) -> int""" |
54f9ee45 | 1123 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1124 | |
1125 | def SetX(*args, **kwargs): | |
a95a7133 | 1126 | """SetX(self, int x)""" |
54f9ee45 | 1127 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1128 | |
1129 | def GetY(*args, **kwargs): | |
a95a7133 | 1130 | """GetY(self) -> int""" |
54f9ee45 | 1131 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1132 | |
1133 | def SetY(*args, **kwargs): | |
a95a7133 | 1134 | """SetY(self, int y)""" |
54f9ee45 | 1135 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1136 | |
1137 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1138 | """GetWidth(self) -> int""" |
54f9ee45 | 1139 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1140 | |
1141 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1142 | """SetWidth(self, int w)""" |
54f9ee45 | 1143 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1144 | |
1145 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1146 | """GetHeight(self) -> int""" |
54f9ee45 | 1147 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1148 | |
1149 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1150 | """SetHeight(self, int h)""" |
54f9ee45 | 1151 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1152 | |
1153 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1154 | """GetPosition(self) -> Point""" |
54f9ee45 | 1155 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1156 | |
1157 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1158 | """SetPosition(self, Point p)""" |
54f9ee45 | 1159 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1160 | |
1161 | def GetSize(*args, **kwargs): | |
a95a7133 | 1162 | """GetSize(self) -> Size""" |
54f9ee45 | 1163 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1164 | |
1165 | def SetSize(*args, **kwargs): | |
a95a7133 | 1166 | """SetSize(self, Size s)""" |
54f9ee45 | 1167 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1168 | |
aff4cc5c RD |
1169 | def IsEmpty(*args, **kwargs): |
1170 | """IsEmpty(self) -> bool""" | |
1171 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1172 | ||
c9c7117a | 1173 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1174 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1175 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1176 | |
1177 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1178 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1179 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1180 | |
1181 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1182 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1183 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1184 | |
1185 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1186 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1187 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1188 | |
e811c8ce | 1189 | def GetLeft(*args, **kwargs): |
a95a7133 | 1190 | """GetLeft(self) -> int""" |
54f9ee45 | 1191 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1192 | |
1193 | def GetTop(*args, **kwargs): | |
a95a7133 | 1194 | """GetTop(self) -> int""" |
54f9ee45 | 1195 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1196 | |
1197 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1198 | """GetBottom(self) -> int""" |
54f9ee45 | 1199 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1200 | |
1201 | def GetRight(*args, **kwargs): | |
a95a7133 | 1202 | """GetRight(self) -> int""" |
54f9ee45 | 1203 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1204 | |
1205 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1206 | """SetLeft(self, int left)""" |
54f9ee45 | 1207 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1208 | |
1209 | def SetRight(*args, **kwargs): | |
a95a7133 | 1210 | """SetRight(self, int right)""" |
54f9ee45 | 1211 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1212 | |
1213 | def SetTop(*args, **kwargs): | |
a95a7133 | 1214 | """SetTop(self, int top)""" |
54f9ee45 | 1215 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1216 | |
1217 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1218 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1219 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce RD |
1220 | |
1221 | position = property(GetPosition, SetPosition) | |
1222 | size = property(GetSize, SetSize) | |
1223 | left = property(GetLeft, SetLeft) | |
1224 | right = property(GetRight, SetRight) | |
1225 | top = property(GetTop, SetTop) | |
1226 | bottom = property(GetBottom, SetBottom) | |
1227 | ||
1228 | def Inflate(*args, **kwargs): | |
0df68c9f | 1229 | """ |
a95a7133 | 1230 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1231 | |
8e738329 RD |
1232 | Increases the size of the rectangle. |
1233 | ||
1234 | The left border is moved farther left and the right border is moved | |
1235 | farther right by ``dx``. The upper border is moved farther up and the | |
1236 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1237 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1238 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1239 | opposite happens: the rectangle size decreases in the respective | |
1240 | direction. | |
1241 | ||
1242 | The change is made to the rectangle inplace, if instead you need a | |
1243 | copy that is inflated, preserving the original then make the copy | |
1244 | first:: | |
1245 | ||
1246 | copy = wx.Rect(*original) | |
1247 | copy.Inflate(10,15) | |
1248 | ||
1249 | ||
0df68c9f | 1250 | """ |
54f9ee45 | 1251 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1252 | |
1253 | def Deflate(*args, **kwargs): | |
0df68c9f | 1254 | """ |
a95a7133 | 1255 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1256 | |
8e738329 RD |
1257 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1258 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1259 | `Inflate` for a full description. | |
0df68c9f | 1260 | """ |
54f9ee45 | 1261 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1262 | |
1263 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1264 | """ |
a95a7133 | 1265 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1266 | |
41e2b43e RD |
1267 | Moves the rectangle by the specified offset. If dx is positive, the |
1268 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1269 | bottom, otherwise it is moved to the left or top respectively. | |
0df68c9f | 1270 | """ |
54f9ee45 | 1271 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1272 | |
1273 | def Offset(*args, **kwargs): | |
0df68c9f | 1274 | """ |
a95a7133 | 1275 | Offset(self, Point pt) |
e811c8ce | 1276 | |
b1fcee84 | 1277 | Same as `OffsetXY` but uses dx,dy from Point |
0df68c9f | 1278 | """ |
54f9ee45 | 1279 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1280 | |
1281 | def Intersect(*args, **kwargs): | |
0df68c9f | 1282 | """ |
a95a7133 | 1283 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1284 | |
5cbf236d | 1285 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1286 | """ |
54f9ee45 | 1287 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1288 | |
5cbf236d RD |
1289 | def Union(*args, **kwargs): |
1290 | """ | |
1291 | Union(self, Rect rect) -> Rect | |
1292 | ||
1293 | Returns the union of this rectangle and rect. | |
1294 | """ | |
1295 | return _core_.Rect_Union(*args, **kwargs) | |
1296 | ||
e811c8ce | 1297 | def __add__(*args, **kwargs): |
0df68c9f | 1298 | """ |
a95a7133 | 1299 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1300 | |
0df68c9f RD |
1301 | Add the properties of rect to this rectangle and return the result. |
1302 | """ | |
54f9ee45 | 1303 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1304 | |
1305 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1306 | """ |
a95a7133 | 1307 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1308 | |
0df68c9f RD |
1309 | Add the properties of rect to this rectangle, updating this rectangle. |
1310 | """ | |
54f9ee45 | 1311 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1312 | |
1313 | def __eq__(*args, **kwargs): | |
0df68c9f | 1314 | """ |
e9d6f3a4 | 1315 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1316 | |
e9d6f3a4 | 1317 | Test for equality of wx.Rect objects. |
0df68c9f | 1318 | """ |
54f9ee45 | 1319 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1320 | |
1321 | def __ne__(*args, **kwargs): | |
0df68c9f | 1322 | """ |
e9d6f3a4 | 1323 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1324 | |
e9d6f3a4 | 1325 | Test for inequality of wx.Rect objects. |
0df68c9f | 1326 | """ |
54f9ee45 | 1327 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce RD |
1328 | |
1329 | def InsideXY(*args, **kwargs): | |
0df68c9f | 1330 | """ |
a95a7133 | 1331 | InsideXY(self, int x, int y) -> bool |
e811c8ce | 1332 | |
0df68c9f RD |
1333 | Return True if the point is (not strcitly) inside the rect. |
1334 | """ | |
54f9ee45 | 1335 | return _core_.Rect_InsideXY(*args, **kwargs) |
e811c8ce RD |
1336 | |
1337 | def Inside(*args, **kwargs): | |
0df68c9f | 1338 | """ |
a95a7133 | 1339 | Inside(self, Point pt) -> bool |
e811c8ce | 1340 | |
0df68c9f RD |
1341 | Return True if the point is (not strcitly) inside the rect. |
1342 | """ | |
54f9ee45 | 1343 | return _core_.Rect_Inside(*args, **kwargs) |
e811c8ce | 1344 | |
fc46b7f3 RD |
1345 | def InsideRect(*args, **kwargs): |
1346 | """ | |
1347 | InsideRect(self, Rect rect) -> bool | |
1348 | ||
1349 | Returns ``True`` if the given rectangle is completely inside this | |
1350 | rectangle or touches its boundary. | |
1351 | """ | |
1352 | return _core_.Rect_InsideRect(*args, **kwargs) | |
1353 | ||
e811c8ce | 1354 | def Intersects(*args, **kwargs): |
0df68c9f | 1355 | """ |
a95a7133 | 1356 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1357 | |
0df68c9f RD |
1358 | Returns True if the rectangles have a non empty intersection. |
1359 | """ | |
54f9ee45 | 1360 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1361 | |
b1fcee84 RD |
1362 | def CenterIn(*args, **kwargs): |
1363 | """ | |
1364 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1365 | ||
1366 | Center this rectangle within the one passed to the method, which is | |
1367 | usually, but not necessarily, the larger one. | |
1368 | """ | |
1369 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1370 | ||
1371 | CentreIn = CenterIn | |
54f9ee45 RD |
1372 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1373 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1374 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1375 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
e811c8ce | 1376 | def Set(*args, **kwargs): |
0df68c9f | 1377 | """ |
a95a7133 | 1378 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1379 | |
0df68c9f RD |
1380 | Set all rectangle properties. |
1381 | """ | |
54f9ee45 | 1382 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1383 | |
1384 | def Get(*args, **kwargs): | |
0df68c9f RD |
1385 | """ |
1386 | Get() -> (x,y,width,height) | |
e811c8ce | 1387 | |
0df68c9f RD |
1388 | Return the rectangle properties as a tuple. |
1389 | """ | |
54f9ee45 | 1390 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1391 | |
41e2b43e | 1392 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1393 | def __str__(self): return str(self.Get()) |
1394 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1395 | def __len__(self): return len(self.Get()) | |
1396 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1397 | def __setitem__(self, index, val): |
1398 | if index == 0: self.x = val | |
1399 | elif index == 1: self.y = val | |
1400 | elif index == 2: self.width = val | |
1401 | elif index == 3: self.height = val | |
1402 | else: raise IndexError | |
e811c8ce | 1403 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1404 | __safe_for_unpickling__ = True |
1405 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 | 1406 | |
2131d850 | 1407 | _core_.Rect_swigregister(Rect) |
d14a1e28 RD |
1408 | |
1409 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1410 | """ |
1411 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1412 | |
0df68c9f RD |
1413 | Create a new Rect object from Points representing two corners. |
1414 | """ | |
54f9ee45 | 1415 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1416 | return val |
1417 | ||
1418 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1419 | """ |
1420 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1421 | |
0df68c9f RD |
1422 | Create a new Rect from a position and size. |
1423 | """ | |
54f9ee45 | 1424 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1425 | return val |
1426 | ||
d3b6e4ff RD |
1427 | def RectS(*args, **kwargs): |
1428 | """ | |
1429 | RectS(Size size) -> Rect | |
1430 | ||
1431 | Create a new Rect from a size only. | |
1432 | """ | |
1433 | val = _core_.new_RectS(*args, **kwargs) | |
d3b6e4ff RD |
1434 | return val |
1435 | ||
d14a1e28 | 1436 | |
e811c8ce | 1437 | def IntersectRect(*args, **kwargs): |
0085ce49 | 1438 | """ |
0df68c9f | 1439 | IntersectRect(Rect r1, Rect r2) -> Rect |
e811c8ce | 1440 | |
0df68c9f RD |
1441 | Calculate and return the intersection of r1 and r2. |
1442 | """ | |
0085ce49 | 1443 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1444 | #--------------------------------------------------------------------------- |
1445 | ||
1446 | class Point2D(object): | |
41e2b43e RD |
1447 | """ |
1448 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1449 | with floating point values. | |
1450 | """ | |
0085ce49 RD |
1451 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1452 | __repr__ = _swig_repr | |
1453 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1454 | """ |
a95a7133 | 1455 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1456 | |
0df68c9f RD |
1457 | Create a w.Point2D object. |
1458 | """ | |
0085ce49 | 1459 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
e811c8ce | 1460 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1461 | """ |
1462 | GetFloor() -> (x,y) | |
1463 | ||
1464 | Convert to integer | |
1465 | """ | |
54f9ee45 | 1466 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1467 | |
1468 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1469 | """ |
1470 | GetRounded() -> (x,y) | |
1471 | ||
1472 | Convert to integer | |
1473 | """ | |
54f9ee45 | 1474 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1475 | |
1476 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1477 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1478 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1479 | |
1480 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1481 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1482 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1483 | |
1484 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1485 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1486 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1487 | |
1488 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1489 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1490 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1491 | |
d14a1e28 RD |
1492 | def SetPolarCoordinates(self, angle, length): |
1493 | self.SetVectorLength(length) | |
1494 | self.SetVectorAngle(angle) | |
1495 | def Normalize(self): | |
1496 | self.SetVectorLength(1.0) | |
1497 | ||
e811c8ce | 1498 | def GetDistance(*args, **kwargs): |
a95a7133 | 1499 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1500 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1501 | |
1502 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1503 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1504 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1505 | |
1506 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1507 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1508 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1509 | |
1510 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1511 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1512 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1513 | |
1514 | def __neg__(*args, **kwargs): | |
0df68c9f | 1515 | """ |
a95a7133 | 1516 | __neg__(self) -> Point2D |
e811c8ce | 1517 | |
0df68c9f RD |
1518 | the reflection of this point |
1519 | """ | |
54f9ee45 | 1520 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1521 | |
1522 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1523 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1524 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1525 | |
1526 | def __isub__(*args, **kwargs): | |
a95a7133 | 1527 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1528 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1529 | |
1530 | def __imul__(*args, **kwargs): | |
a95a7133 | 1531 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1532 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1533 | |
1534 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1535 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1536 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1537 | |
1538 | def __eq__(*args, **kwargs): | |
0df68c9f | 1539 | """ |
e9d6f3a4 | 1540 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1541 | |
e9d6f3a4 | 1542 | Test for equality of wx.Point2D objects. |
0df68c9f | 1543 | """ |
54f9ee45 | 1544 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1545 | |
1546 | def __ne__(*args, **kwargs): | |
0df68c9f | 1547 | """ |
e9d6f3a4 | 1548 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1549 | |
e9d6f3a4 | 1550 | Test for inequality of wx.Point2D objects. |
0df68c9f | 1551 | """ |
54f9ee45 | 1552 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1553 | |
54f9ee45 RD |
1554 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1555 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1556 | def Set(*args, **kwargs): |
a95a7133 | 1557 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1558 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1559 | |
1560 | def Get(*args, **kwargs): | |
0df68c9f RD |
1561 | """ |
1562 | Get() -> (x,y) | |
e811c8ce | 1563 | |
0df68c9f RD |
1564 | Return x and y properties as a tuple. |
1565 | """ | |
54f9ee45 | 1566 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1567 | |
41e2b43e | 1568 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1569 | def __str__(self): return str(self.Get()) |
1570 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1571 | def __len__(self): return len(self.Get()) | |
1572 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1573 | def __setitem__(self, index, val): |
e811c8ce RD |
1574 | if index == 0: self.x = val |
1575 | elif index == 1: self.y = val | |
d14a1e28 | 1576 | else: raise IndexError |
e811c8ce | 1577 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1578 | __safe_for_unpickling__ = True |
1579 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 | 1580 | |
2131d850 | 1581 | _core_.Point2D_swigregister(Point2D) |
d14a1e28 RD |
1582 | |
1583 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1584 | """ |
1585 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1586 | |
0df68c9f RD |
1587 | Create a w.Point2D object. |
1588 | """ | |
54f9ee45 | 1589 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1590 | return val |
1591 | ||
1592 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1593 | """ |
1594 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1595 | |
0df68c9f RD |
1596 | Create a w.Point2D object. |
1597 | """ | |
54f9ee45 | 1598 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1599 | return val |
1600 | ||
1601 | #--------------------------------------------------------------------------- | |
1602 | ||
54f9ee45 RD |
1603 | FromStart = _core_.FromStart |
1604 | FromCurrent = _core_.FromCurrent | |
1605 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1606 | class InputStream(object): |
093d3ff1 | 1607 | """Proxy of C++ InputStream class""" |
0085ce49 RD |
1608 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1609 | __repr__ = _swig_repr | |
1610 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1611 | """__init__(self, PyObject p) -> InputStream""" |
0085ce49 RD |
1612 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1613 | __swig_destroy__ = _core_.delete_InputStream | |
1614 | __del__ = lambda self : None; | |
e811c8ce | 1615 | def close(*args, **kwargs): |
a95a7133 | 1616 | """close(self)""" |
54f9ee45 | 1617 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1618 | |
1619 | def flush(*args, **kwargs): | |
a95a7133 | 1620 | """flush(self)""" |
54f9ee45 | 1621 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
1622 | |
1623 | def eof(*args, **kwargs): | |
a95a7133 | 1624 | """eof(self) -> bool""" |
54f9ee45 | 1625 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
1626 | |
1627 | def read(*args, **kwargs): | |
a95a7133 | 1628 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 1629 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
1630 | |
1631 | def readline(*args, **kwargs): | |
a95a7133 | 1632 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 1633 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
1634 | |
1635 | def readlines(*args, **kwargs): | |
a95a7133 | 1636 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 1637 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
1638 | |
1639 | def seek(*args, **kwargs): | |
a95a7133 | 1640 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 1641 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
1642 | |
1643 | def tell(*args, **kwargs): | |
a95a7133 | 1644 | """tell(self) -> int""" |
54f9ee45 | 1645 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
1646 | |
1647 | def Peek(*args, **kwargs): | |
a95a7133 | 1648 | """Peek(self) -> char""" |
54f9ee45 | 1649 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
1650 | |
1651 | def GetC(*args, **kwargs): | |
a95a7133 | 1652 | """GetC(self) -> char""" |
54f9ee45 | 1653 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
1654 | |
1655 | def LastRead(*args, **kwargs): | |
a95a7133 | 1656 | """LastRead(self) -> size_t""" |
54f9ee45 | 1657 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
1658 | |
1659 | def CanRead(*args, **kwargs): | |
a95a7133 | 1660 | """CanRead(self) -> bool""" |
54f9ee45 | 1661 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
1662 | |
1663 | def Eof(*args, **kwargs): | |
a95a7133 | 1664 | """Eof(self) -> bool""" |
54f9ee45 | 1665 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
1666 | |
1667 | def Ungetch(*args, **kwargs): | |
a95a7133 | 1668 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 1669 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
1670 | |
1671 | def SeekI(*args, **kwargs): | |
a95a7133 | 1672 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 1673 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
1674 | |
1675 | def TellI(*args, **kwargs): | |
a95a7133 | 1676 | """TellI(self) -> long""" |
54f9ee45 | 1677 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 1678 | |
2131d850 | 1679 | _core_.InputStream_swigregister(InputStream) |
d14a1e28 RD |
1680 | DefaultPosition = cvar.DefaultPosition |
1681 | DefaultSize = cvar.DefaultSize | |
1682 | ||
1683 | class OutputStream(object): | |
093d3ff1 | 1684 | """Proxy of C++ OutputStream class""" |
0085ce49 RD |
1685 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1686 | def __init__(self): raise AttributeError, "No constructor defined" | |
1687 | __repr__ = _swig_repr | |
e811c8ce | 1688 | def write(*args, **kwargs): |
a95a7133 | 1689 | """write(self, PyObject obj)""" |
54f9ee45 | 1690 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 1691 | |
0085ce49 RD |
1692 | def LastWrite(*args, **kwargs): |
1693 | """LastWrite(self) -> size_t""" | |
1694 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d14a1e28 | 1695 | |
2131d850 | 1696 | _core_.OutputStream_swigregister(OutputStream) |
d14a1e28 RD |
1697 | |
1698 | #--------------------------------------------------------------------------- | |
1699 | ||
1700 | class FSFile(Object): | |
093d3ff1 | 1701 | """Proxy of C++ FSFile class""" |
0085ce49 RD |
1702 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1703 | __repr__ = _swig_repr | |
1704 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1705 | """ |
a95a7133 | 1706 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 1707 | DateTime modif) -> FSFile |
0df68c9f | 1708 | """ |
0085ce49 | 1709 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
0085ce49 RD |
1710 | __swig_destroy__ = _core_.delete_FSFile |
1711 | __del__ = lambda self : None; | |
e811c8ce | 1712 | def GetStream(*args, **kwargs): |
a95a7133 | 1713 | """GetStream(self) -> InputStream""" |
54f9ee45 | 1714 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce RD |
1715 | |
1716 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 1717 | """GetMimeType(self) -> String""" |
54f9ee45 | 1718 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1719 | |
1720 | def GetLocation(*args, **kwargs): | |
a95a7133 | 1721 | """GetLocation(self) -> String""" |
54f9ee45 | 1722 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
1723 | |
1724 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1725 | """GetAnchor(self) -> String""" |
54f9ee45 | 1726 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1727 | |
1728 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 1729 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 1730 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 1731 | |
2131d850 | 1732 | _core_.FSFile_swigregister(FSFile) |
d14a1e28 RD |
1733 | |
1734 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1735 | """Proxy of C++ CPPFileSystemHandler class""" |
0085ce49 RD |
1736 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1737 | def __init__(self): raise AttributeError, "No constructor defined" | |
1738 | __repr__ = _swig_repr | |
50f151d7 RD |
1739 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
1740 | __del__ = lambda self : None; | |
2131d850 | 1741 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d14a1e28 RD |
1742 | |
1743 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1744 | """Proxy of C++ FileSystemHandler class""" |
0085ce49 RD |
1745 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1746 | __repr__ = _swig_repr | |
1747 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1748 | """__init__(self) -> FileSystemHandler""" |
0085ce49 | 1749 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
d14a1e28 | 1750 | self._setCallbackInfo(self, FileSystemHandler) |
e811c8ce RD |
1751 | |
1752 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 1753 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 1754 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
1755 | |
1756 | def CanOpen(*args, **kwargs): | |
a95a7133 | 1757 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1758 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1759 | |
1760 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1761 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1762 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1763 | |
1764 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1765 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1766 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1767 | |
1768 | def FindNext(*args, **kwargs): | |
a95a7133 | 1769 | """FindNext(self) -> String""" |
54f9ee45 | 1770 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
1771 | |
1772 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 1773 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 1774 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
1775 | |
1776 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 1777 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 1778 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
1779 | |
1780 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1781 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 1782 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1783 | |
1784 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 1785 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 1786 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
1787 | |
1788 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 1789 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 1790 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 1791 | |
2131d850 | 1792 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d14a1e28 RD |
1793 | |
1794 | class FileSystem(Object): | |
093d3ff1 | 1795 | """Proxy of C++ FileSystem class""" |
0085ce49 RD |
1796 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1797 | __repr__ = _swig_repr | |
1798 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1799 | """__init__(self) -> FileSystem""" |
0085ce49 RD |
1800 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
1801 | __swig_destroy__ = _core_.delete_FileSystem | |
1802 | __del__ = lambda self : None; | |
e811c8ce | 1803 | def ChangePathTo(*args, **kwargs): |
a95a7133 | 1804 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 1805 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
1806 | |
1807 | def GetPath(*args, **kwargs): | |
a95a7133 | 1808 | """GetPath(self) -> String""" |
54f9ee45 | 1809 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
1810 | |
1811 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1812 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 1813 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
1814 | |
1815 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1816 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1817 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
1818 | |
1819 | def FindNext(*args, **kwargs): | |
a95a7133 | 1820 | """FindNext(self) -> String""" |
54f9ee45 | 1821 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
1822 | |
1823 | def AddHandler(*args, **kwargs): | |
66c033b4 | 1824 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 1825 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
1826 | |
1827 | AddHandler = staticmethod(AddHandler) | |
1828 | def CleanUpHandlers(*args, **kwargs): | |
66c033b4 | 1829 | """CleanUpHandlers()""" |
54f9ee45 | 1830 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
1831 | |
1832 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1833 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 1834 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 1835 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
1836 | |
1837 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
1838 | def URLToFileName(*args, **kwargs): |
1839 | """URLToFileName(String url) -> String""" | |
1840 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1841 | ||
1842 | URLToFileName = staticmethod(URLToFileName) | |
2131d850 | 1843 | _core_.FileSystem_swigregister(FileSystem) |
d14a1e28 | 1844 | |
e811c8ce | 1845 | def FileSystem_AddHandler(*args, **kwargs): |
0085ce49 RD |
1846 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
1847 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d14a1e28 | 1848 | |
0085ce49 RD |
1849 | def FileSystem_CleanUpHandlers(*args): |
1850 | """FileSystem_CleanUpHandlers()""" | |
1851 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d14a1e28 | 1852 | |
e811c8ce | 1853 | def FileSystem_FileNameToURL(*args, **kwargs): |
0085ce49 RD |
1854 | """FileSystem_FileNameToURL(String filename) -> String""" |
1855 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d14a1e28 | 1856 | |
e811c8ce | 1857 | def FileSystem_URLToFileName(*args, **kwargs): |
0085ce49 RD |
1858 | """FileSystem_URLToFileName(String url) -> String""" |
1859 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2ef75293 | 1860 | |
d14a1e28 | 1861 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1862 | """Proxy of C++ InternetFSHandler class""" |
0085ce49 RD |
1863 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1864 | __repr__ = _swig_repr | |
1865 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1866 | """__init__(self) -> InternetFSHandler""" |
0085ce49 | 1867 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
e811c8ce | 1868 | def CanOpen(*args, **kwargs): |
a95a7133 | 1869 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1870 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1871 | |
1872 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1873 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1874 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 1875 | |
2131d850 | 1876 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d14a1e28 RD |
1877 | |
1878 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1879 | """Proxy of C++ ZipFSHandler class""" |
0085ce49 RD |
1880 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1881 | __repr__ = _swig_repr | |
1882 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1883 | """__init__(self) -> ZipFSHandler""" |
0085ce49 | 1884 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
e811c8ce | 1885 | def CanOpen(*args, **kwargs): |
a95a7133 | 1886 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1887 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1888 | |
1889 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1890 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1891 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1892 | |
1893 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1894 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1895 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1896 | |
1897 | def FindNext(*args, **kwargs): | |
a95a7133 | 1898 | """FindNext(self) -> String""" |
54f9ee45 | 1899 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1900 | |
2131d850 | 1901 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d14a1e28 RD |
1902 | |
1903 | ||
e811c8ce | 1904 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
0085ce49 RD |
1905 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
1906 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d14a1e28 | 1907 | |
e811c8ce | 1908 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
0085ce49 RD |
1909 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
1910 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d14a1e28 | 1911 | |
e811c8ce | 1912 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
0085ce49 RD |
1913 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
1914 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2ef75293 RD |
1915 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1916 | """ | |
1917 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1918 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1919 | arbitrary data. If a bitmap or image is used then the imgType | |
1920 | parameter should specify what kind of image file it should be | |
1921 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1922 | """ | |
1923 | if isinstance(dataItem, wx.Image): | |
1924 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1925 | elif isinstance(dataItem, wx.Bitmap): | |
1926 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1927 | elif type(dataItem) == str: | |
1928 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
1929 | else: | |
1930 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d14a1e28 RD |
1931 | |
1932 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1933 | """Proxy of C++ MemoryFSHandler class""" |
0085ce49 RD |
1934 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1935 | __repr__ = _swig_repr | |
1936 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1937 | """__init__(self) -> MemoryFSHandler""" |
0085ce49 | 1938 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
e811c8ce | 1939 | def RemoveFile(*args, **kwargs): |
66c033b4 | 1940 | """RemoveFile(String filename)""" |
54f9ee45 | 1941 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
1942 | |
1943 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 1944 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 1945 | def CanOpen(*args, **kwargs): |
a95a7133 | 1946 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1947 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1948 | |
1949 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1950 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1951 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1952 | |
1953 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1954 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1955 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1956 | |
1957 | def FindNext(*args, **kwargs): | |
a95a7133 | 1958 | """FindNext(self) -> String""" |
54f9ee45 | 1959 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1960 | |
2131d850 | 1961 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d14a1e28 | 1962 | |
e811c8ce | 1963 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
0085ce49 RD |
1964 | """MemoryFSHandler_RemoveFile(String filename)""" |
1965 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d14a1e28 | 1966 | |
bcd0d7b6 RD |
1967 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
1968 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
1969 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d14a1e28 RD |
1970 | #--------------------------------------------------------------------------- |
1971 | ||
1972 | class ImageHandler(Object): | |
27fb7603 RD |
1973 | """ |
1974 | This is the base class for implementing image file loading/saving, and | |
1975 | image creation from data. It is used within `wx.Image` and is not | |
1976 | normally seen by the application. | |
1977 | """ | |
0085ce49 RD |
1978 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1979 | def __init__(self): raise AttributeError, "No constructor defined" | |
1980 | __repr__ = _swig_repr | |
e811c8ce | 1981 | def GetName(*args, **kwargs): |
a95a7133 | 1982 | """GetName(self) -> String""" |
54f9ee45 | 1983 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
1984 | |
1985 | def GetExtension(*args, **kwargs): | |
a95a7133 | 1986 | """GetExtension(self) -> String""" |
54f9ee45 | 1987 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
1988 | |
1989 | def GetType(*args, **kwargs): | |
a95a7133 | 1990 | """GetType(self) -> long""" |
54f9ee45 | 1991 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
1992 | |
1993 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 1994 | """GetMimeType(self) -> String""" |
54f9ee45 | 1995 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1996 | |
1997 | def CanRead(*args, **kwargs): | |
a95a7133 | 1998 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 1999 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce | 2000 | |
b02396e8 RD |
2001 | def CanReadStream(*args, **kwargs): |
2002 | """CanReadStream(self, InputStream stream) -> bool""" | |
2003 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2004 | ||
e811c8ce | 2005 | def SetName(*args, **kwargs): |
a95a7133 | 2006 | """SetName(self, String name)""" |
54f9ee45 | 2007 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
2008 | |
2009 | def SetExtension(*args, **kwargs): | |
a95a7133 | 2010 | """SetExtension(self, String extension)""" |
54f9ee45 | 2011 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
2012 | |
2013 | def SetType(*args, **kwargs): | |
a95a7133 | 2014 | """SetType(self, long type)""" |
54f9ee45 | 2015 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
2016 | |
2017 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2018 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2019 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2020 | |
2131d850 | 2021 | _core_.ImageHandler_swigregister(ImageHandler) |
d14a1e28 | 2022 | |
943e8dfd RD |
2023 | class PyImageHandler(ImageHandler): |
2024 | """ | |
2025 | This is the base class for implementing image file loading/saving, and | |
2026 | image creation from data, all written in Python. To create a custom | |
2027 | image handler derive a new class from wx.PyImageHandler and provide | |
2028 | the following methods:: | |
2029 | ||
2030 | def DoCanRead(self, stream) --> bool | |
2031 | '''Check if this handler can read the image on the stream''' | |
2032 | ||
2033 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2034 | '''Load image data from the stream and load it into image.''' | |
2035 | ||
2036 | def SaveFile(self, image, stream, verbose) --> bool | |
2037 | '''Save the iamge data in image to the stream using | |
2038 | this handler's image file format.''' | |
2039 | ||
2040 | def GetImageCount(self, stream) --> int | |
2041 | '''If this image format can hold more than one image, | |
2042 | how many does the image on the stream have?''' | |
2043 | ||
2044 | To activate your handler create an instance of it and pass it to | |
2045 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2046 | `SetExtension` from your constructor. | |
2047 | ||
2048 | """ | |
0085ce49 RD |
2049 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2050 | __repr__ = _swig_repr | |
2051 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2052 | """ |
2053 | __init__(self) -> PyImageHandler | |
2054 | ||
2055 | This is the base class for implementing image file loading/saving, and | |
2056 | image creation from data, all written in Python. To create a custom | |
2057 | image handler derive a new class from wx.PyImageHandler and provide | |
2058 | the following methods:: | |
2059 | ||
2060 | def DoCanRead(self, stream) --> bool | |
2061 | '''Check if this handler can read the image on the stream''' | |
2062 | ||
2063 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2064 | '''Load image data from the stream and load it into image.''' | |
2065 | ||
2066 | def SaveFile(self, image, stream, verbose) --> bool | |
2067 | '''Save the iamge data in image to the stream using | |
2068 | this handler's image file format.''' | |
2069 | ||
2070 | def GetImageCount(self, stream) --> int | |
2071 | '''If this image format can hold more than one image, | |
2072 | how many does the image on the stream have?''' | |
2073 | ||
2074 | To activate your handler create an instance of it and pass it to | |
2075 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2076 | `SetExtension` from your constructor. | |
2077 | ||
2078 | """ | |
0085ce49 | 2079 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2080 | self._SetSelf(self) |
2081 | ||
2082 | def _SetSelf(*args, **kwargs): | |
2083 | """_SetSelf(self, PyObject self)""" | |
2084 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2085 | ||
2131d850 | 2086 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2087 | |
d14a1e28 | 2088 | class ImageHistogram(object): |
093d3ff1 | 2089 | """Proxy of C++ ImageHistogram class""" |
0085ce49 RD |
2090 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2091 | __repr__ = _swig_repr | |
2092 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2093 | """__init__(self) -> ImageHistogram""" |
0085ce49 | 2094 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
e811c8ce | 2095 | def MakeKey(*args, **kwargs): |
0df68c9f | 2096 | """ |
7a27cf7c | 2097 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2098 | |
0df68c9f RD |
2099 | Get the key in the histogram for the given RGB values |
2100 | """ | |
54f9ee45 | 2101 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce RD |
2102 | |
2103 | MakeKey = staticmethod(MakeKey) | |
2104 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2105 | """ |
2106 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2107 | ||
2108 | Find first colour that is not used in the image and has higher RGB | |
2109 | values than startR, startG, startB. Returns a tuple consisting of a | |
2110 | success flag and rgb values. | |
2111 | """ | |
54f9ee45 | 2112 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2113 | |
f1cbd8fa RD |
2114 | def GetCount(*args, **kwargs): |
2115 | """ | |
2116 | GetCount(self, unsigned long key) -> unsigned long | |
2117 | ||
2118 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2119 | key value from a RGB tripple. | |
2120 | """ | |
2121 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2122 | ||
2123 | def GetCountRGB(*args, **kwargs): | |
2124 | """ | |
7a27cf7c | 2125 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2126 | |
2127 | Returns the pixel count for the given RGB values. | |
2128 | """ | |
2129 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2130 | ||
2131 | def GetCountColour(*args, **kwargs): | |
2132 | """ | |
2133 | GetCountColour(self, Colour colour) -> unsigned long | |
2134 | ||
2135 | Returns the pixel count for the given `wx.Colour` value. | |
2136 | """ | |
2137 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2138 | ||
2131d850 | 2139 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d14a1e28 | 2140 | |
e811c8ce | 2141 | def ImageHistogram_MakeKey(*args, **kwargs): |
0085ce49 | 2142 | """ |
7a27cf7c | 2143 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2144 | |
0df68c9f RD |
2145 | Get the key in the histogram for the given RGB values |
2146 | """ | |
0085ce49 | 2147 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 | 2148 | |
943e8dfd RD |
2149 | class Image_RGBValue(object): |
2150 | """ | |
2151 | An object that contains values for red, green and blue which represent | |
2152 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2153 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2154 | color space. | |
2155 | """ | |
0085ce49 RD |
2156 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2157 | __repr__ = _swig_repr | |
2158 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2159 | """ |
2160 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2161 | ||
2162 | Constructor. | |
2163 | """ | |
0085ce49 | 2164 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2165 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2166 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2167 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2168 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2169 | |
2170 | class Image_HSVValue(object): | |
2171 | """ | |
2172 | An object that contains values for hue, saturation and value which | |
2173 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2174 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2175 | color space. | |
2176 | """ | |
0085ce49 RD |
2177 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2178 | __repr__ = _swig_repr | |
2179 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2180 | """ |
2181 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2182 | ||
2183 | Constructor. | |
2184 | """ | |
0085ce49 | 2185 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2186 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2187 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2188 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2189 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2190 | |
d14a1e28 | 2191 | class Image(Object): |
7a27cf7c RD |
2192 | """ |
2193 | A platform-independent image class. An image can be created from | |
2194 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2195 | variety of formats. Functions are available to set and get image | |
2196 | bits, so it can be used for basic image manipulation. | |
2197 | ||
2198 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2199 | platform-specific `wx.Bitmap` object must be created from it using the | |
2200 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2201 | device context, using `wx.DC.DrawBitmap`. | |
2202 | ||
2203 | One colour value of the image may be used as a mask colour which will | |
2204 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2205 | bitmap object. | |
2206 | ||
2207 | wx.Image supports alpha channel data, that is in addition to a byte | |
2208 | for the red, green and blue colour components for each pixel it also | |
2209 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2210 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2211 | means that the pixel is 100% opaque. | |
2212 | ||
2213 | Unlike RGB data, not all images have an alpha channel and before using | |
2214 | `GetAlpha` you should check if this image contains an alpha channel | |
2215 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2216 | with transparency information will have an alpha channel. | |
2217 | """ | |
0085ce49 RD |
2218 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2219 | __repr__ = _swig_repr | |
2220 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2221 | """ |
2222 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2223 | ||
2224 | Loads an image from a file. | |
2225 | """ | |
0085ce49 RD |
2226 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2227 | __swig_destroy__ = _core_.delete_Image | |
2228 | __del__ = lambda self : None; | |
e811c8ce | 2229 | def Create(*args, **kwargs): |
7a27cf7c RD |
2230 | """ |
2231 | Create(self, int width, int height, bool clear=True) | |
2232 | ||
2233 | Creates a fresh image. If clear is ``True``, the new image will be | |
2234 | initialized to black. Otherwise, the image data will be uninitialized. | |
2235 | """ | |
54f9ee45 | 2236 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2237 | |
2238 | def Destroy(*args, **kwargs): | |
0df68c9f | 2239 | """ |
a95a7133 | 2240 | Destroy(self) |
e811c8ce | 2241 | |
7a27cf7c | 2242 | Destroys the image data. |
0df68c9f | 2243 | """ |
7e08d4ef RD |
2244 | val = _core_.Image_Destroy(*args, **kwargs) |
2245 | args[0].thisown = 0 | |
2246 | return val | |
e811c8ce RD |
2247 | |
2248 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2249 | """ |
2250 | Scale(self, int width, int height) -> Image | |
2251 | ||
2252 | Returns a scaled version of the image. This is also useful for scaling | |
2253 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2254 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2255 | """ | |
54f9ee45 | 2256 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce RD |
2257 | |
2258 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2259 | """ |
2260 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2261 | ||
2262 | Return a version of the image scaled smaller by the given factors. | |
2263 | """ | |
54f9ee45 | 2264 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce RD |
2265 | |
2266 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2267 | """ |
2268 | Rescale(self, int width, int height) -> Image | |
2269 | ||
2270 | Changes the size of the image in-place by scaling it: after a call to | |
2271 | this function, the image will have the given width and height. | |
2272 | ||
2273 | Returns the (modified) image itself. | |
2274 | """ | |
54f9ee45 | 2275 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 2276 | |
aff4cc5c | 2277 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2278 | """ |
2279 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2280 | ||
2281 | Changes the size of the image in-place without scaling it, by adding | |
2282 | either a border with the given colour or cropping as necessary. The | |
2283 | image is pasted into a new image with the given size and background | |
2284 | colour at the position pos relative to the upper left of the new | |
2285 | image. If red = green = blue = -1 then use either the current mask | |
2286 | colour if set or find, use, and set a suitable mask colour for any | |
2287 | newly exposed areas. | |
2288 | ||
2289 | Returns the (modified) image itself. | |
2290 | """ | |
aff4cc5c RD |
2291 | return _core_.Image_Resize(*args, **kwargs) |
2292 | ||
e811c8ce | 2293 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2294 | """ |
2295 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2296 | ||
2297 | Sets the pixel at the given coordinate. This routine performs | |
2298 | bounds-checks for the coordinate so it can be considered a safe way to | |
2299 | manipulate the data, but in some cases this might be too slow so that | |
2300 | the data will have to be set directly. In that case you will have to | |
2301 | get access to the image data using the `GetData` method. | |
2302 | """ | |
54f9ee45 | 2303 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 2304 | |
aff4cc5c | 2305 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2306 | """ |
2307 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2308 | ||
2309 | Sets the colour of the pixels within the given rectangle. This routine | |
2310 | performs bounds-checks for the rectangle so it can be considered a | |
2311 | safe way to manipulate the data. | |
2312 | """ | |
aff4cc5c RD |
2313 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2314 | ||
e811c8ce | 2315 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2316 | """ |
2317 | GetRed(self, int x, int y) -> byte | |
2318 | ||
2319 | Returns the red intensity at the given coordinate. | |
2320 | """ | |
54f9ee45 | 2321 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce RD |
2322 | |
2323 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2324 | """ |
2325 | GetGreen(self, int x, int y) -> byte | |
2326 | ||
2327 | Returns the green intensity at the given coordinate. | |
2328 | """ | |
54f9ee45 | 2329 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce RD |
2330 | |
2331 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2332 | """ |
2333 | GetBlue(self, int x, int y) -> byte | |
2334 | ||
2335 | Returns the blue intensity at the given coordinate. | |
2336 | """ | |
54f9ee45 | 2337 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce RD |
2338 | |
2339 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2340 | """ |
2341 | SetAlpha(self, int x, int y, byte alpha) | |
2342 | ||
2343 | Sets the alpha value for the given pixel. This function should only be | |
2344 | called if the image has alpha channel data, use `HasAlpha` to check | |
2345 | for this. | |
2346 | """ | |
54f9ee45 | 2347 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce RD |
2348 | |
2349 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2350 | """ |
2351 | GetAlpha(self, int x, int y) -> byte | |
2352 | ||
2353 | Returns the alpha value for the given pixel. This function may only be | |
2354 | called for the images with alpha channel, use `HasAlpha` to check for | |
2355 | this. | |
2356 | ||
2357 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2358 | corresponds to the fully transparent pixels while the value of 255 to | |
2359 | the fully opaque pixels. | |
2360 | """ | |
54f9ee45 | 2361 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce RD |
2362 | |
2363 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2364 | """ |
2365 | HasAlpha(self) -> bool | |
2366 | ||
2367 | Returns true if this image has alpha channel, false otherwise. | |
2368 | """ | |
54f9ee45 | 2369 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 2370 | |
68350608 RD |
2371 | def InitAlpha(*args, **kwargs): |
2372 | """ | |
2373 | InitAlpha(self) | |
2374 | ||
2375 | Initializes the image alpha channel data. It is an error to call it if | |
2376 | the image already has alpha data. If it doesn't, alpha data will be by | |
2377 | default initialized to all pixels being fully opaque. But if the image | |
2378 | has a a mask colour, all mask pixels will be completely transparent. | |
2379 | """ | |
2380 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2381 | ||
bcd0d7b6 RD |
2382 | def IsTransparent(*args, **kwargs): |
2383 | """ | |
7a27cf7c | 2384 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2385 | |
7a27cf7c RD |
2386 | Returns ``True`` if this pixel is masked or has an alpha value less |
2387 | than the spcified threshold. | |
bcd0d7b6 RD |
2388 | """ |
2389 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2390 | ||
e811c8ce | 2391 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2392 | """ |
2393 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2394 | ||
2395 | Find first colour that is not used in the image and has higher RGB | |
2396 | values than startR, startG, startB. Returns a tuple consisting of a | |
2397 | success flag and rgb values. | |
2398 | """ | |
54f9ee45 | 2399 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2400 | |
4cf4100f RD |
2401 | def ConvertAlphaToMask(*args, **kwargs): |
2402 | """ | |
bcd0d7b6 | 2403 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2404 | |
7a27cf7c RD |
2405 | If the image has alpha channel, this method converts it to mask. All |
2406 | pixels with alpha value less than ``threshold`` are replaced with the | |
2407 | mask colour and the alpha channel is removed. The mask colour is | |
2408 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2409 | |
2410 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2411 | nothing. | |
2412 | """ | |
2413 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2414 | ||
8fb0e70a RD |
2415 | def ConvertColourToAlpha(*args, **kwargs): |
2416 | """ | |
7a27cf7c | 2417 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2418 | |
2419 | This method converts an image where the original alpha information is | |
2420 | only available as a shades of a colour (actually shades of grey) | |
2421 | typically when you draw anti-aliased text into a bitmap. The DC | |
2422 | drawing routines draw grey values on the black background although | |
2423 | they actually mean to draw white with differnt alpha values. This | |
2424 | method reverses it, assuming a black (!) background and white text. | |
2425 | The method will then fill up the whole image with the colour given. | |
2426 | """ | |
2427 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2428 | ||
e811c8ce | 2429 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2430 | """ |
2431 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2432 | ||
2433 | Sets the image's mask so that the pixels that have RGB value of | |
2434 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2435 | by first finding an unused colour in the image, setting this colour as | |
2436 | the mask colour and then using this colour to draw all pixels in the | |
2437 | image who corresponding pixel in mask has given RGB value. | |
2438 | ||
2439 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2440 | image or if there is no unused colour left. Returns ``True`` if the | |
2441 | mask was successfully applied. | |
2442 | ||
2443 | Note that this method involves computing the histogram, which is | |
2444 | computationally intensive operation. | |
2445 | """ | |
54f9ee45 | 2446 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce RD |
2447 | |
2448 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2449 | """ |
2450 | CanRead(String filename) -> bool | |
2451 | ||
2452 | Returns True if the image handlers can read this file. | |
2453 | """ | |
54f9ee45 | 2454 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce RD |
2455 | |
2456 | CanRead = staticmethod(CanRead) | |
2457 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2458 | """ |
2459 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2460 | ||
2461 | If the image file contains more than one image and the image handler | |
2462 | is capable of retrieving these individually, this function will return | |
2463 | the number of available images. | |
2464 | """ | |
54f9ee45 | 2465 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce RD |
2466 | |
2467 | GetImageCount = staticmethod(GetImageCount) | |
2468 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2469 | """ |
2470 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2471 | ||
2472 | Loads an image from a file. If no handler type is provided, the | |
2473 | library will try to autodetect the format. | |
2474 | """ | |
54f9ee45 | 2475 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce RD |
2476 | |
2477 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2478 | """ |
2479 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2480 | ||
2481 | Loads an image from a file, specifying the image type with a MIME type | |
2482 | string. | |
2483 | """ | |
54f9ee45 | 2484 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce RD |
2485 | |
2486 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2487 | """ |
2488 | SaveFile(self, String name, int type) -> bool | |
2489 | ||
2490 | Saves an image in the named file. | |
2491 | """ | |
54f9ee45 | 2492 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce RD |
2493 | |
2494 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2495 | """ |
2496 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2497 | ||
2498 | Saves an image in the named file. | |
2499 | """ | |
54f9ee45 | 2500 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce RD |
2501 | |
2502 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2503 | """ |
2504 | CanReadStream(InputStream stream) -> bool | |
2505 | ||
2506 | Returns True if the image handlers can read an image file from the | |
2507 | data currently on the input stream, or a readable Python file-like | |
2508 | object. | |
2509 | """ | |
54f9ee45 | 2510 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce RD |
2511 | |
2512 | CanReadStream = staticmethod(CanReadStream) | |
2513 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2514 | """ |
2515 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2516 | ||
2517 | Loads an image from an input stream or a readable Python file-like | |
2518 | object. If no handler type is provided, the library will try to | |
2519 | autodetect the format. | |
2520 | """ | |
54f9ee45 | 2521 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce RD |
2522 | |
2523 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2524 | """ |
2525 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2526 | ||
2527 | Loads an image from an input stream or a readable Python file-like | |
2528 | object, using a MIME type string to specify the image file format. | |
2529 | """ | |
54f9ee45 | 2530 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce RD |
2531 | |
2532 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2533 | """ |
2534 | Ok(self) -> bool | |
2535 | ||
2536 | Returns true if image data is present. | |
2537 | """ | |
54f9ee45 | 2538 | return _core_.Image_Ok(*args, **kwargs) |
e811c8ce RD |
2539 | |
2540 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2541 | """ |
2542 | GetWidth(self) -> int | |
2543 | ||
2544 | Gets the width of the image in pixels. | |
2545 | """ | |
54f9ee45 | 2546 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce RD |
2547 | |
2548 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2549 | """ |
2550 | GetHeight(self) -> int | |
2551 | ||
2552 | Gets the height of the image in pixels. | |
2553 | """ | |
54f9ee45 | 2554 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 2555 | |
b2df227b | 2556 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
2557 | """ |
2558 | GetSize(self) -> Size | |
2559 | ||
2560 | Returns the size of the image in pixels. | |
2561 | """ | |
54f9ee45 | 2562 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 2563 | |
e811c8ce | 2564 | def GetSubImage(*args, **kwargs): |
7a27cf7c RD |
2565 | """ |
2566 | GetSubImage(self, Rect rect) -> Image | |
2567 | ||
2568 | Returns a sub image of the current one as long as the rect belongs | |
2569 | entirely to the image. | |
2570 | """ | |
54f9ee45 | 2571 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 2572 | |
aff4cc5c | 2573 | def Size(*args, **kwargs): |
7a27cf7c RD |
2574 | """ |
2575 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2576 | ||
2577 | Returns a resized version of this image without scaling it by adding | |
2578 | either a border with the given colour or cropping as necessary. The | |
2579 | image is pasted into a new image with the given size and background | |
2580 | colour at the position ``pos`` relative to the upper left of the new | |
2581 | image. If red = green = blue = -1 then use either the current mask | |
2582 | colour if set or find, use, and set a suitable mask colour for any | |
2583 | newly exposed areas. | |
2584 | """ | |
aff4cc5c RD |
2585 | return _core_.Image_Size(*args, **kwargs) |
2586 | ||
e811c8ce | 2587 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2588 | """ |
2589 | Copy(self) -> Image | |
2590 | ||
2591 | Returns an identical copy of the image. | |
2592 | """ | |
54f9ee45 | 2593 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce RD |
2594 | |
2595 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2596 | """ |
2597 | Paste(self, Image image, int x, int y) | |
2598 | ||
2599 | Pastes ``image`` into this instance and takes care of the mask colour | |
2600 | and any out of bounds problems. | |
2601 | """ | |
54f9ee45 | 2602 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
2603 | |
2604 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
2605 | """ |
2606 | GetData(self) -> PyObject | |
2607 | ||
2608 | Returns a string containing a copy of the RGB bytes of the image. | |
2609 | """ | |
54f9ee45 | 2610 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
2611 | |
2612 | def SetData(*args, **kwargs): | |
61d07ac7 RD |
2613 | """ |
2614 | SetData(self, buffer data) | |
2615 | ||
2616 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2617 | either a string or a buffer object holding the data and the length of | |
2618 | the data must be width*height*3. | |
2619 | """ | |
54f9ee45 | 2620 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
2621 | |
2622 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2623 | """ |
2624 | GetDataBuffer(self) -> PyObject | |
2625 | ||
2626 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2627 | image data buffer inside the wx.Image. You need to ensure that you do |
2628 | not use this buffer object after the image has been destroyed. | |
61d07ac7 | 2629 | """ |
54f9ee45 | 2630 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2631 | |
2632 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2633 | """ |
2634 | SetDataBuffer(self, buffer data) | |
2635 | ||
2636 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2637 | object. This can save making an extra copy of the data but you must |
2638 | ensure that the buffer object lives longer than the wx.Image does. | |
61d07ac7 | 2639 | """ |
54f9ee45 | 2640 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2641 | |
2642 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2643 | """ |
2644 | GetAlphaData(self) -> PyObject | |
2645 | ||
2646 | Returns a string containing a copy of the alpha bytes of the image. | |
2647 | """ | |
54f9ee45 | 2648 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
2649 | |
2650 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2651 | """ |
2652 | SetAlphaData(self, buffer alpha) | |
2653 | ||
2654 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2655 | a string or a buffer object holding the data and the length of the | |
2656 | data must be width*height. | |
2657 | """ | |
54f9ee45 | 2658 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
2659 | |
2660 | def GetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2661 | """ |
2662 | GetAlphaBuffer(self) -> PyObject | |
2663 | ||
2664 | Returns a writable Python buffer object that is pointing at the Alpha | |
2665 | data buffer inside the wx.Image. You need to ensure that you do not | |
2666 | use this buffer object after the image has been destroyed. | |
2667 | """ | |
54f9ee45 | 2668 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2669 | |
2670 | def SetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2671 | """ |
2672 | SetAlphaBuffer(self, buffer alpha) | |
2673 | ||
2674 | Sets the internal image alpha pointer to point at a Python buffer | |
2675 | object. This can save making an extra copy of the data but you must | |
2676 | ensure that the buffer object lives as long as the wx.Image does. | |
2677 | """ | |
54f9ee45 | 2678 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2679 | |
2680 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2681 | """ |
2682 | SetMaskColour(self, byte r, byte g, byte b) | |
2683 | ||
2684 | Sets the mask colour for this image (and tells the image to use the | |
2685 | mask). | |
2686 | """ | |
54f9ee45 | 2687 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 2688 | |
aff4cc5c RD |
2689 | def GetOrFindMaskColour(*args, **kwargs): |
2690 | """ | |
2691 | GetOrFindMaskColour() -> (r,g,b) | |
2692 | ||
2693 | Get the current mask colour or find a suitable colour. | |
2694 | """ | |
2695 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2696 | ||
e811c8ce | 2697 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2698 | """ |
2699 | GetMaskRed(self) -> byte | |
2700 | ||
2701 | Gets the red component of the mask colour. | |
2702 | """ | |
54f9ee45 | 2703 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce RD |
2704 | |
2705 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2706 | """ |
2707 | GetMaskGreen(self) -> byte | |
2708 | ||
2709 | Gets the green component of the mask colour. | |
2710 | """ | |
54f9ee45 | 2711 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce RD |
2712 | |
2713 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2714 | """ |
2715 | GetMaskBlue(self) -> byte | |
2716 | ||
2717 | Gets the blue component of the mask colour. | |
2718 | """ | |
54f9ee45 | 2719 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce RD |
2720 | |
2721 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2722 | """ |
2723 | SetMask(self, bool mask=True) | |
2724 | ||
2725 | Specifies whether there is a mask or not. The area of the mask is | |
2726 | determined by the current mask colour. | |
2727 | """ | |
54f9ee45 | 2728 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce RD |
2729 | |
2730 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2731 | """ |
2732 | HasMask(self) -> bool | |
2733 | ||
2734 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2735 | """ | |
54f9ee45 | 2736 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
2737 | |
2738 | def Rotate(*args, **kwargs): | |
0df68c9f | 2739 | """ |
a95a7133 | 2740 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 2741 | Point offset_after_rotation=None) -> Image |
7a27cf7c RD |
2742 | |
2743 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2744 | ``True`` to ``interpolating`` results in better image quality, but is | |
2745 | slower. If the image has a mask, then the mask colour is used for the | |
2746 | uncovered pixels in the rotated image background. Otherwise, black | |
2747 | will be used as the fill colour. | |
2748 | ||
2749 | Returns the rotated image, leaving this image intact. | |
0df68c9f | 2750 | """ |
54f9ee45 | 2751 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce RD |
2752 | |
2753 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2754 | """ |
2755 | Rotate90(self, bool clockwise=True) -> Image | |
2756 | ||
2757 | Returns a copy of the image rotated 90 degrees in the direction | |
2758 | indicated by ``clockwise``. | |
2759 | """ | |
54f9ee45 | 2760 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce RD |
2761 | |
2762 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2763 | """ |
2764 | Mirror(self, bool horizontally=True) -> Image | |
2765 | ||
2766 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2767 | indicates the orientation. | |
2768 | """ | |
54f9ee45 | 2769 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
2770 | |
2771 | def Replace(*args, **kwargs): | |
0df68c9f | 2772 | """ |
7a27cf7c RD |
2773 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2774 | ||
2775 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2776 | ``(r2,g2,b2)``. | |
0df68c9f | 2777 | """ |
54f9ee45 | 2778 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce | 2779 | |
32fe5131 RD |
2780 | def ConvertToGreyscale(*args, **kwargs): |
2781 | """ | |
2782 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2783 | ||
2784 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2785 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2786 | defaults to ITU-T BT.601 | |
2787 | """ | |
2788 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2789 | ||
e811c8ce | 2790 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2791 | """ |
2792 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2793 | ||
2794 | Returns monochromatic version of the image. The returned image has | |
2795 | white colour where the original has ``(r,g,b)`` colour and black | |
2796 | colour everywhere else. | |
2797 | """ | |
54f9ee45 | 2798 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce RD |
2799 | |
2800 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2801 | """ |
2802 | SetOption(self, String name, String value) | |
2803 | ||
2804 | Sets an image handler defined option. For example, when saving as a | |
2805 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2806 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2807 | """ | |
54f9ee45 | 2808 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce RD |
2809 | |
2810 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2811 | """ |
2812 | SetOptionInt(self, String name, int value) | |
2813 | ||
2814 | Sets an image option as an integer. | |
2815 | """ | |
54f9ee45 | 2816 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce RD |
2817 | |
2818 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2819 | """ |
2820 | GetOption(self, String name) -> String | |
2821 | ||
2822 | Gets the value of an image handler option. | |
2823 | """ | |
54f9ee45 | 2824 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce RD |
2825 | |
2826 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2827 | """ |
2828 | GetOptionInt(self, String name) -> int | |
2829 | ||
2830 | Gets the value of an image handler option as an integer. If the given | |
2831 | option is not present, the function returns 0. | |
2832 | """ | |
54f9ee45 | 2833 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce RD |
2834 | |
2835 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2836 | """ |
2837 | HasOption(self, String name) -> bool | |
2838 | ||
2839 | Returns true if the given option is present. | |
2840 | """ | |
54f9ee45 | 2841 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
2842 | |
2843 | def CountColours(*args, **kwargs): | |
a95a7133 | 2844 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 2845 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
2846 | |
2847 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 2848 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 2849 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
2850 | |
2851 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2852 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 2853 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
2854 | |
2855 | AddHandler = staticmethod(AddHandler) | |
2856 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 2857 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 2858 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
2859 | |
2860 | InsertHandler = staticmethod(InsertHandler) | |
2861 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 2862 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 2863 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce RD |
2864 | |
2865 | RemoveHandler = staticmethod(RemoveHandler) | |
0085ce49 RD |
2866 | def GetHandlers(*args, **kwargs): |
2867 | """GetHandlers() -> PyObject""" | |
2868 | return _core_.Image_GetHandlers(*args, **kwargs) | |
2869 | ||
2870 | GetHandlers = staticmethod(GetHandlers) | |
e811c8ce | 2871 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
2872 | """ |
2873 | GetImageExtWildcard() -> String | |
2874 | ||
2875 | Iterates all registered wxImageHandler objects, and returns a string | |
2876 | containing file extension masks suitable for passing to file open/save | |
2877 | dialog boxes. | |
2878 | """ | |
54f9ee45 | 2879 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
2880 | |
2881 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2882 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 2883 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 2884 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
2885 | |
2886 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2887 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 2888 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce | 2889 | |
943e8dfd RD |
2890 | def RotateHue(*args, **kwargs): |
2891 | """ | |
2892 | RotateHue(self, double angle) | |
2893 | ||
2894 | Rotates the hue of each pixel of the image. Hue is a double in the | |
2895 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
2896 | """ | |
2897 | return _core_.Image_RotateHue(*args, **kwargs) | |
2898 | ||
2899 | def RGBtoHSV(*args, **kwargs): | |
2900 | """ | |
2901 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
2902 | ||
2903 | Converts a color in RGB color space to HSV color space. | |
2904 | """ | |
2905 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
2906 | ||
2907 | RGBtoHSV = staticmethod(RGBtoHSV) | |
2908 | def HSVtoRGB(*args, **kwargs): | |
2909 | """ | |
2910 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
2911 | ||
2912 | Converts a color in HSV color space to RGB color space. | |
2913 | """ | |
2914 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
2915 | ||
2916 | HSVtoRGB = staticmethod(HSVtoRGB) | |
e811c8ce | 2917 | def __nonzero__(self): return self.Ok() |
2131d850 | 2918 | _core_.Image_swigregister(Image) |
d14a1e28 RD |
2919 | |
2920 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
2921 | """ |
2922 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
2923 | ||
2924 | Loads an image from a file, using a MIME type string (such as | |
2925 | 'image/jpeg') to specify image type. | |
2926 | """ | |
54f9ee45 | 2927 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 RD |
2928 | return val |
2929 | ||
2930 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
2931 | """ |
2932 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2933 | ||
2934 | Loads an image from an input stream, or any readable Python file-like | |
2935 | object. | |
2936 | """ | |
54f9ee45 | 2937 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 RD |
2938 | return val |
2939 | ||
2940 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
2941 | """ |
2942 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
2943 | ||
2944 | Loads an image from an input stream, or any readable Python file-like | |
2945 | object, specifying the image format with a MIME type string. | |
2946 | """ | |
54f9ee45 | 2947 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
2948 | return val |
2949 | ||
66c033b4 | 2950 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
2951 | """ |
2952 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
2953 | ||
2954 | Construct an empty image of a given size, optionally setting all | |
2955 | pixels to black. | |
2956 | """ | |
66c033b4 | 2957 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
2958 | return val |
2959 | ||
2960 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
2961 | """ |
2962 | ImageFromBitmap(Bitmap bitmap) -> Image | |
2963 | ||
2964 | Construct an Image from a `wx.Bitmap`. | |
2965 | """ | |
54f9ee45 | 2966 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
2967 | return val |
2968 | ||
2969 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
2970 | """ |
2971 | ImageFromData(int width, int height, buffer data) -> Image | |
2972 | ||
2973 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
2974 | string or a buffer object holding the data and the length of the data | |
2975 | must be width*height*3. | |
2976 | """ | |
54f9ee45 | 2977 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
2978 | return val |
2979 | ||
1823fbb4 | 2980 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
2981 | """ |
2982 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
2983 | ||
2984 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
2985 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
2986 | length of the data must be width*height*3 bytes, and the length of the |
2987 | alpha data must be width*height bytes. | |
61d07ac7 | 2988 | """ |
1823fbb4 | 2989 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
1823fbb4 RD |
2990 | return val |
2991 | ||
e811c8ce | 2992 | def Image_CanRead(*args, **kwargs): |
0085ce49 | 2993 | """ |
7a27cf7c RD |
2994 | Image_CanRead(String filename) -> bool |
2995 | ||
2996 | Returns True if the image handlers can read this file. | |
2997 | """ | |
0085ce49 | 2998 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 2999 | |
e811c8ce | 3000 | def Image_GetImageCount(*args, **kwargs): |
0085ce49 | 3001 | """ |
7a27cf7c RD |
3002 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
3003 | ||
3004 | If the image file contains more than one image and the image handler | |
3005 | is capable of retrieving these individually, this function will return | |
3006 | the number of available images. | |
3007 | """ | |
0085ce49 | 3008 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 3009 | |
e811c8ce | 3010 | def Image_CanReadStream(*args, **kwargs): |
0085ce49 | 3011 | """ |
7a27cf7c RD |
3012 | Image_CanReadStream(InputStream stream) -> bool |
3013 | ||
3014 | Returns True if the image handlers can read an image file from the | |
3015 | data currently on the input stream, or a readable Python file-like | |
3016 | object. | |
3017 | """ | |
0085ce49 | 3018 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 3019 | |
e811c8ce | 3020 | def Image_AddHandler(*args, **kwargs): |
0085ce49 RD |
3021 | """Image_AddHandler(ImageHandler handler)""" |
3022 | return _core_.Image_AddHandler(*args, **kwargs) | |
d14a1e28 | 3023 | |
e811c8ce | 3024 | def Image_InsertHandler(*args, **kwargs): |
0085ce49 RD |
3025 | """Image_InsertHandler(ImageHandler handler)""" |
3026 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d14a1e28 | 3027 | |
e811c8ce | 3028 | def Image_RemoveHandler(*args, **kwargs): |
0085ce49 RD |
3029 | """Image_RemoveHandler(String name) -> bool""" |
3030 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d14a1e28 | 3031 | |
0085ce49 RD |
3032 | def Image_GetHandlers(*args): |
3033 | """Image_GetHandlers() -> PyObject""" | |
3034 | return _core_.Image_GetHandlers(*args) | |
3035 | ||
3036 | def Image_GetImageExtWildcard(*args): | |
3037 | """ | |
7a27cf7c RD |
3038 | Image_GetImageExtWildcard() -> String |
3039 | ||
3040 | Iterates all registered wxImageHandler objects, and returns a string | |
3041 | containing file extension masks suitable for passing to file open/save | |
3042 | dialog boxes. | |
3043 | """ | |
0085ce49 | 3044 | return _core_.Image_GetImageExtWildcard(*args) |
d14a1e28 | 3045 | |
943e8dfd | 3046 | def Image_RGBtoHSV(*args, **kwargs): |
0085ce49 | 3047 | """ |
943e8dfd RD |
3048 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3049 | ||
3050 | Converts a color in RGB color space to HSV color space. | |
3051 | """ | |
0085ce49 | 3052 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3053 | |
3054 | def Image_HSVtoRGB(*args, **kwargs): | |
0085ce49 | 3055 | """ |
943e8dfd RD |
3056 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3057 | ||
3058 | Converts a color in HSV color space to RGB color space. | |
3059 | """ | |
0085ce49 | 3060 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3061 | |
fc46b7f3 RD |
3062 | |
3063 | def _ImageFromBuffer(*args, **kwargs): | |
3064 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3065 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3066 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3067 | """ | |
3068 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
eec1c382 RD |
3069 | parameter must be a Python object that implements the buffer interface, |
3070 | such as a string, array, etc. The dataBuffer object is expected to | |
3071 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3072 | object can optionally be supplied for the image's alpha channel data, and | |
3073 | it is expected to be width*height bytes long. | |
fc46b7f3 RD |
3074 | |
3075 | The wx.Image will be created with its data and alpha pointers initialized | |
3076 | to the memory address pointed to by the buffer objects, thus saving the | |
3077 | time needed to copy the image data from the buffer object to the wx.Image. | |
3078 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3079 | risks associated with sharing a C pointer between two objects. | |
3080 | ||
3081 | To help alleviate the risk a reference to the data and alpha buffer | |
3082 | objects are kept with the wx.Image, so that they won't get deleted until | |
3083 | after the wx.Image is deleted. However please be aware that it is not | |
3084 | guaranteed that an object won't move its memory buffer to a new location | |
3085 | when it needs to resize its contents. If that happens then the wx.Image | |
3086 | will end up referring to an invalid memory location and could cause the | |
3087 | application to crash. Therefore care should be taken to not manipulate | |
3088 | the objects used for the data and alpha buffers in a way that would cause | |
3089 | them to change size. | |
3090 | """ | |
fc46b7f3 RD |
3091 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) |
3092 | image._buffer = dataBuffer | |
3093 | image._alpha = alphaBuffer | |
3094 | return image | |
3095 | ||
5e4ca4a8 RD |
3096 | def InitAllImageHandlers(): |
3097 | """ | |
3098 | The former functionality of InitAllImageHanders is now done internal to | |
3099 | the _core_ extension module and so this function has become a simple NOP. | |
3100 | """ | |
3101 | pass | |
d14a1e28 | 3102 | |
54f9ee45 RD |
3103 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3104 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3105 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3106 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3107 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
54f9ee45 RD |
3108 | BMP_24BPP = _core_.BMP_24BPP |
3109 | BMP_8BPP = _core_.BMP_8BPP | |
3110 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3111 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3112 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3113 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3114 | BMP_4BPP = _core_.BMP_4BPP | |
3115 | BMP_1BPP = _core_.BMP_1BPP | |
3116 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
d14a1e28 | 3117 | class BMPHandler(ImageHandler): |
27fb7603 | 3118 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
0085ce49 RD |
3119 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3120 | __repr__ = _swig_repr | |
3121 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3122 | """ |
3123 | __init__(self) -> BMPHandler | |
3124 | ||
3125 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3126 | """ | |
0085ce49 | 3127 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3128 | _core_.BMPHandler_swigregister(BMPHandler) |
d14a1e28 | 3129 | NullImage = cvar.NullImage |
0c243d93 | 3130 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 RD |
3131 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3132 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3133 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3134 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
0c243d93 RD |
3135 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3136 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3137 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3138 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 RD |
3139 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3140 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3141 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3142 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3143 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3144 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3145 | |
3146 | class ICOHandler(BMPHandler): | |
27fb7603 | 3147 | """A `wx.ImageHandler` for \*.ico icon files.""" |
0085ce49 RD |
3148 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3149 | __repr__ = _swig_repr | |
3150 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3151 | """ |
3152 | __init__(self) -> ICOHandler | |
3153 | ||
3154 | A `wx.ImageHandler` for \*.ico icon files. | |
3155 | """ | |
0085ce49 | 3156 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3157 | _core_.ICOHandler_swigregister(ICOHandler) |
d14a1e28 RD |
3158 | |
3159 | class CURHandler(ICOHandler): | |
27fb7603 | 3160 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
0085ce49 RD |
3161 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3162 | __repr__ = _swig_repr | |
3163 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3164 | """ |
3165 | __init__(self) -> CURHandler | |
3166 | ||
3167 | A `wx.ImageHandler` for \*.cur cursor files. | |
3168 | """ | |
0085ce49 | 3169 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3170 | _core_.CURHandler_swigregister(CURHandler) |
d14a1e28 RD |
3171 | |
3172 | class ANIHandler(CURHandler): | |
27fb7603 | 3173 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
0085ce49 RD |
3174 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3175 | __repr__ = _swig_repr | |
3176 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3177 | """ |
3178 | __init__(self) -> ANIHandler | |
3179 | ||
3180 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3181 | """ | |
0085ce49 | 3182 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3183 | _core_.ANIHandler_swigregister(ANIHandler) |
d14a1e28 RD |
3184 | |
3185 | class PNGHandler(ImageHandler): | |
27fb7603 | 3186 | """A `wx.ImageHandler` for PNG image files.""" |
0085ce49 RD |
3187 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3188 | __repr__ = _swig_repr | |
3189 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3190 | """ |
3191 | __init__(self) -> PNGHandler | |
3192 | ||
3193 | A `wx.ImageHandler` for PNG image files. | |
3194 | """ | |
0085ce49 | 3195 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3196 | _core_.PNGHandler_swigregister(PNGHandler) |
d14a1e28 RD |
3197 | |
3198 | class GIFHandler(ImageHandler): | |
27fb7603 | 3199 | """A `wx.ImageHandler` for GIF image files.""" |
0085ce49 RD |
3200 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3201 | __repr__ = _swig_repr | |
3202 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3203 | """ |
3204 | __init__(self) -> GIFHandler | |
3205 | ||
3206 | A `wx.ImageHandler` for GIF image files. | |
3207 | """ | |
0085ce49 | 3208 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3209 | _core_.GIFHandler_swigregister(GIFHandler) |
d14a1e28 RD |
3210 | |
3211 | class PCXHandler(ImageHandler): | |
27fb7603 | 3212 | """A `wx.ImageHandler` for PCX imager files.""" |
0085ce49 RD |
3213 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3214 | __repr__ = _swig_repr | |
3215 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3216 | """ |
3217 | __init__(self) -> PCXHandler | |
3218 | ||
3219 | A `wx.ImageHandler` for PCX imager files. | |
3220 | """ | |
0085ce49 | 3221 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3222 | _core_.PCXHandler_swigregister(PCXHandler) |
d14a1e28 RD |
3223 | |
3224 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3225 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
0085ce49 RD |
3226 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3227 | __repr__ = _swig_repr | |
3228 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3229 | """ |
3230 | __init__(self) -> JPEGHandler | |
3231 | ||
3232 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3233 | """ | |
0085ce49 | 3234 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3235 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d14a1e28 RD |
3236 | |
3237 | class PNMHandler(ImageHandler): | |
27fb7603 | 3238 | """A `wx.ImageHandler` for PNM image files.""" |
0085ce49 RD |
3239 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3240 | __repr__ = _swig_repr | |
3241 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3242 | """ |
3243 | __init__(self) -> PNMHandler | |
3244 | ||
3245 | A `wx.ImageHandler` for PNM image files. | |
3246 | """ | |
0085ce49 | 3247 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3248 | _core_.PNMHandler_swigregister(PNMHandler) |
d14a1e28 RD |
3249 | |
3250 | class XPMHandler(ImageHandler): | |
27fb7603 | 3251 | """A `wx.ImageHandler` for XPM image.""" |
0085ce49 RD |
3252 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3253 | __repr__ = _swig_repr | |
3254 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3255 | """ |
3256 | __init__(self) -> XPMHandler | |
3257 | ||
3258 | A `wx.ImageHandler` for XPM image. | |
3259 | """ | |
0085ce49 | 3260 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3261 | _core_.XPMHandler_swigregister(XPMHandler) |
d14a1e28 RD |
3262 | |
3263 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3264 | """A `wx.ImageHandler` for TIFF image files.""" |
0085ce49 RD |
3265 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3266 | __repr__ = _swig_repr | |
3267 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3268 | """ |
3269 | __init__(self) -> TIFFHandler | |
3270 | ||
3271 | A `wx.ImageHandler` for TIFF image files. | |
3272 | """ | |
0085ce49 | 3273 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3274 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d14a1e28 | 3275 | |
c0de73ae RD |
3276 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3277 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3278 | class Quantize(object): | |
3279 | """Performs quantization, or colour reduction, on a wxImage.""" | |
0085ce49 RD |
3280 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3281 | def __init__(self): raise AttributeError, "No constructor defined" | |
3282 | __repr__ = _swig_repr | |
c0de73ae RD |
3283 | def Quantize(*args, **kwargs): |
3284 | """ | |
3285 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3286 | ||
3287 | Reduce the colours in the source image and put the result into the | |
3288 | destination image, setting the palette in the destination if | |
3289 | needed. Both images may be the same, to overwrite the source image. | |
3290 | """ | |
3291 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3292 | ||
3293 | Quantize = staticmethod(Quantize) | |
2131d850 | 3294 | _core_.Quantize_swigregister(Quantize) |
c0de73ae RD |
3295 | |
3296 | def Quantize_Quantize(*args, **kwargs): | |
0085ce49 | 3297 | """ |
c0de73ae RD |
3298 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
3299 | ||
3300 | Reduce the colours in the source image and put the result into the | |
3301 | destination image, setting the palette in the destination if | |
3302 | needed. Both images may be the same, to overwrite the source image. | |
3303 | """ | |
0085ce49 | 3304 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3305 | |
d14a1e28 RD |
3306 | #--------------------------------------------------------------------------- |
3307 | ||
3308 | class EvtHandler(Object): | |
093d3ff1 | 3309 | """Proxy of C++ EvtHandler class""" |
0085ce49 RD |
3310 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3311 | __repr__ = _swig_repr | |
3312 | def __init__(self, *args, **kwargs): | |
a95a7133 | 3313 | """__init__(self) -> EvtHandler""" |
0085ce49 | 3314 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
e811c8ce | 3315 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3316 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3317 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3318 | |
3319 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3320 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3321 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3322 | |
3323 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3324 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3325 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3326 | |
3327 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3328 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3329 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3330 | |
3331 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3332 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3333 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3334 | |
3335 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3336 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3337 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3338 | |
3339 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3340 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3341 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3342 | |
3343 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3344 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3345 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3346 | |
3347 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3348 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3349 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3350 | |
3351 | def Connect(*args, **kwargs): | |
a95a7133 | 3352 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3353 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3354 | |
3355 | def Disconnect(*args, **kwargs): | |
2131d850 | 3356 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3357 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3358 | |
3359 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3360 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef RD |
3361 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3362 | args[0].thisown = 0 | |
3363 | return val | |
e811c8ce | 3364 | |
d14a1e28 RD |
3365 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3366 | """ | |
3367 | Bind an event to an event handler. | |
3368 | ||
db3e571a RD |
3369 | :param event: One of the EVT_* objects that specifies the |
3370 | type of event to bind, | |
d14a1e28 | 3371 | |
db3e571a RD |
3372 | :param handler: A callable object to be invoked when the |
3373 | event is delivered to self. Pass None to | |
3374 | disconnect an event handler. | |
d14a1e28 | 3375 | |
db3e571a RD |
3376 | :param source: Sometimes the event originates from a |
3377 | different window than self, but you still | |
3378 | want to catch it in self. (For example, a | |
3379 | button event delivered to a frame.) By | |
3380 | passing the source of the event, the event | |
3381 | handling system is able to differentiate | |
3382 | between the same event type from different | |
3383 | controls. | |
d14a1e28 | 3384 | |
db3e571a RD |
3385 | :param id: Used to spcify the event source by ID instead |
3386 | of instance. | |
3387 | ||
3388 | :param id2: Used when it is desirable to bind a handler | |
3389 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d14a1e28 RD |
3390 | """ |
3391 | if source is not None: | |
3392 | id = source.GetId() | |
3393 | event.Bind(self, id, id2, handler) | |
3394 | ||
66c033b4 RD |
3395 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3396 | """ | |
3397 | Disconencts the event handler binding for event from self. | |
3398 | Returns True if successful. | |
3399 | """ | |
3400 | if source is not None: | |
3401 | id = source.GetId() | |
3402 | return event.Unbind(self, id, id2) | |
d14a1e28 | 3403 | |
2131d850 | 3404 | _core_.EvtHandler_swigregister(EvtHandler) |
d14a1e28 RD |
3405 | |
3406 | #--------------------------------------------------------------------------- | |
3407 | ||
3408 | class PyEventBinder(object): | |
3409 | """ | |
3410 | Instances of this class are used to bind specific events to event | |
3411 | handlers. | |
3412 | """ | |
3413 | def __init__(self, evtType, expectedIDs=0): | |
3414 | if expectedIDs not in [0, 1, 2]: | |
3415 | raise ValueError, "Invalid number of expectedIDs" | |
3416 | self.expectedIDs = expectedIDs | |
3417 | ||
3418 | if type(evtType) == list or type(evtType) == tuple: | |
3419 | self.evtType = evtType | |
3420 | else: | |
3421 | self.evtType = [evtType] | |
3422 | ||
3423 | ||
3424 | def Bind(self, target, id1, id2, function): | |
3425 | """Bind this set of event types to target.""" | |
3426 | for et in self.evtType: | |
3427 | target.Connect(id1, id2, et, function) | |
3428 | ||
66c033b4 RD |
3429 | |
3430 | def Unbind(self, target, id1, id2): | |
3431 | """Remove an event binding.""" | |
3432 | success = 0 | |
3433 | for et in self.evtType: | |
3434 | success += target.Disconnect(id1, id2, et) | |
3435 | return success != 0 | |
3436 | ||
d14a1e28 RD |
3437 | |
3438 | def __call__(self, *args): | |
3439 | """ | |
3440 | For backwards compatibility with the old EVT_* functions. | |
3441 | Should be called with either (window, func), (window, ID, | |
3442 | func) or (window, ID1, ID2, func) parameters depending on the | |
3443 | type of the event. | |
3444 | """ | |
3445 | assert len(args) == 2 + self.expectedIDs | |
3446 | id1 = wx.ID_ANY | |
3447 | id2 = wx.ID_ANY | |
3448 | target = args[0] | |
3449 | if self.expectedIDs == 0: | |
3450 | func = args[1] | |
3451 | elif self.expectedIDs == 1: | |
3452 | id1 = args[1] | |
3453 | func = args[2] | |
3454 | elif self.expectedIDs == 2: | |
3455 | id1 = args[1] | |
3456 | id2 = args[2] | |
3457 | func = args[3] | |
3458 | else: | |
3459 | raise ValueError, "Unexpected number of IDs" | |
3460 | ||
3461 | self.Bind(target, id1, id2, func) | |
3462 | ||
3463 | ||
3464 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3465 | def EVT_COMMAND(win, id, cmd, func): | |
3466 | win.Connect(id, -1, cmd, func) | |
3467 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3468 | win.Connect(id1, id2, cmd, func) | |
3469 | ||
3470 | ||
3471 | #--------------------------------------------------------------------------- | |
3472 | ||
3473 | #--------------------------------------------------------------------------- | |
3474 | ||
54f9ee45 RD |
3475 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3476 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3477 | |
0085ce49 | 3478 | def NewEventType(*args): |
2131d850 | 3479 | """NewEventType() -> EventType""" |
0085ce49 | 3480 | return _core_.NewEventType(*args) |
54f9ee45 RD |
3481 | wxEVT_NULL = _core_.wxEVT_NULL |
3482 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3483 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3484 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3485 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3486 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3487 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3488 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3489 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3490 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3491 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3492 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3493 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3494 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3495 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3496 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3497 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3498 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3499 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3500 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3501 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3502 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3503 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3504 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3505 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3506 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3507 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3508 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3509 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3510 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3511 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3512 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3513 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3514 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3515 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3516 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3517 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3518 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3519 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3520 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3521 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3522 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3523 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3524 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3525 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3526 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3527 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3528 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3529 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3530 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3531 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3532 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3533 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3534 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3535 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3536 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3537 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3538 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3539 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3540 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3541 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3542 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3543 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3544 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
54f9ee45 RD |
3545 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3546 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3547 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3548 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3549 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3550 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3551 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3552 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3553 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3554 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3555 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3556 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3557 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3558 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
54f9ee45 RD |
3559 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
3560 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3561 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3562 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3563 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3564 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3565 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
34e0a3bb | 3566 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST |
54f9ee45 RD |
3567 | wxEVT_PAINT = _core_.wxEVT_PAINT |
3568 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3569 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3570 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3571 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3572 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3573 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3574 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3575 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3576 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3577 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3578 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3579 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3580 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3581 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3582 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3583 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3584 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3585 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3586 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3587 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3588 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3589 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
2131d850 RD |
3590 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
3591 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
3592 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
54f9ee45 RD |
3593 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3594 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3595 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3596 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3597 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3598 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3599 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
3600 | # |
3601 | # Create some event binders | |
3602 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3603 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3604 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3605 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3606 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3607 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3608 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3609 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3610 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3611 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3612 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3613 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3614 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 3615 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d14a1e28 RD |
3616 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
3617 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3618 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3619 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3620 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3621 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3622 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3623 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3624 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3625 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 3626 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
3627 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3628 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3629 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3630 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3631 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3632 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3633 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3634 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3635 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3636 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3637 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3638 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3639 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3640 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3641 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3642 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
34e0a3bb | 3643 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) |
d14a1e28 RD |
3644 | |
3645 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3646 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3647 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3648 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3649 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3650 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3651 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3652 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3653 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3654 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3655 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3656 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3657 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3658 | ||
3659 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3660 | wxEVT_LEFT_UP, | |
3661 | wxEVT_MIDDLE_DOWN, | |
3662 | wxEVT_MIDDLE_UP, | |
3663 | wxEVT_RIGHT_DOWN, | |
3664 | wxEVT_RIGHT_UP, | |
3665 | wxEVT_MOTION, | |
3666 | wxEVT_LEFT_DCLICK, | |
3667 | wxEVT_MIDDLE_DCLICK, | |
3668 | wxEVT_RIGHT_DCLICK, | |
3669 | wxEVT_ENTER_WINDOW, | |
3670 | wxEVT_LEAVE_WINDOW, | |
3671 | wxEVT_MOUSEWHEEL | |
3672 | ]) | |
3673 | ||
3674 | ||
3675 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 3676 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d14a1e28 RD |
3677 | wxEVT_SCROLLWIN_BOTTOM, |
3678 | wxEVT_SCROLLWIN_LINEUP, | |
3679 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 3680 | wxEVT_SCROLLWIN_PAGEUP, |
d14a1e28 RD |
3681 | wxEVT_SCROLLWIN_PAGEDOWN, |
3682 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3683 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3684 | ]) | |
3685 | ||
3686 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3687 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3688 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3689 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3690 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3691 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3692 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3693 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3694 | ||
27fb7603 | 3695 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
3696 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3697 | wxEVT_SCROLL_BOTTOM, | |
3698 | wxEVT_SCROLL_LINEUP, | |
3699 | wxEVT_SCROLL_LINEDOWN, | |
3700 | wxEVT_SCROLL_PAGEUP, | |
3701 | wxEVT_SCROLL_PAGEDOWN, | |
3702 | wxEVT_SCROLL_THUMBTRACK, | |
3703 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3704 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3705 | ]) |
3706 | ||
3707 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3708 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3709 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3710 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3711 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3712 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3713 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3714 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3715 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3716 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 3717 | |
27fb7603 | 3718 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
3719 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3720 | wxEVT_SCROLL_BOTTOM, | |
3721 | wxEVT_SCROLL_LINEUP, | |
3722 | wxEVT_SCROLL_LINEDOWN, | |
3723 | wxEVT_SCROLL_PAGEUP, | |
3724 | wxEVT_SCROLL_PAGEDOWN, | |
3725 | wxEVT_SCROLL_THUMBTRACK, | |
d14a1e28 | 3726 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 3727 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3728 | ], 1) |
3729 | ||
3730 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3731 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3732 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3733 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3734 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3735 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3736 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3737 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3738 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3739 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d14a1e28 | 3740 | |
d14a1e28 RD |
3741 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
3742 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3743 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3744 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3745 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3746 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3747 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3748 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3749 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3750 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3751 | ||
3752 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3753 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3754 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3755 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3756 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3757 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3758 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3759 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3760 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3761 | ||
3762 | ||
3763 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3764 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3765 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3766 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3767 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3768 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3769 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3770 | ||
3771 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3772 | ||
3773 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3774 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3775 | ||
3776 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3777 | ||
2131d850 RD |
3778 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
3779 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
3780 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d14a1e28 RD |
3781 | |
3782 | ||
3783 | #--------------------------------------------------------------------------- | |
3784 | ||
3785 | class Event(Object): | |
27fb7603 RD |
3786 | """ |
3787 | An event is a structure holding information about an event passed to a | |
3788 | callback or member function. wx.Event is an abstract base class for | |
3789 | other event classes | |
3790 | """ | |
0085ce49 RD |
3791 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3792 | def __init__(self): raise AttributeError, "No constructor defined" | |
3793 | __repr__ = _swig_repr | |
3794 | __swig_destroy__ = _core_.delete_Event | |
3795 | __del__ = lambda self : None; | |
e811c8ce | 3796 | def SetEventType(*args, **kwargs): |
27fb7603 | 3797 | """ |
2131d850 | 3798 | SetEventType(self, EventType typ) |
27fb7603 RD |
3799 | |
3800 | Sets the specific type of the event. | |
3801 | """ | |
54f9ee45 | 3802 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
3803 | |
3804 | def GetEventType(*args, **kwargs): | |
27fb7603 | 3805 | """ |
2131d850 | 3806 | GetEventType(self) -> EventType |
27fb7603 RD |
3807 | |
3808 | Returns the identifier of the given event type, such as | |
3809 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3810 | """ | |
54f9ee45 | 3811 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
3812 | |
3813 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3814 | """ |
3815 | GetEventObject(self) -> Object | |
3816 | ||
3817 | Returns the object (usually a window) associated with the event, if | |
3818 | any. | |
3819 | """ | |
54f9ee45 | 3820 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
3821 | |
3822 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3823 | """ |
3824 | SetEventObject(self, Object obj) | |
3825 | ||
3826 | Sets the originating object, or in other words, obj is normally the | |
3827 | object that is sending the event. | |
3828 | """ | |
54f9ee45 | 3829 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
3830 | |
3831 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 3832 | """GetTimestamp(self) -> long""" |
54f9ee45 | 3833 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
3834 | |
3835 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 3836 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 3837 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
3838 | |
3839 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3840 | """ |
3841 | GetId(self) -> int | |
3842 | ||
3843 | Returns the identifier associated with this event, such as a button | |
3844 | command id. | |
3845 | """ | |
54f9ee45 | 3846 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
3847 | |
3848 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3849 | """ |
3850 | SetId(self, int Id) | |
3851 | ||
3852 | Set's the ID for the event. This is usually the ID of the window that | |
3853 | is sending the event, but it can also be a command id from a menu | |
3854 | item, etc. | |
3855 | """ | |
54f9ee45 | 3856 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
3857 | |
3858 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3859 | """ |
3860 | IsCommandEvent(self) -> bool | |
3861 | ||
3862 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3863 | it returns false. Note: Exists only for optimization purposes. | |
3864 | """ | |
54f9ee45 | 3865 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
3866 | |
3867 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3868 | """ |
3869 | Skip(self, bool skip=True) | |
3870 | ||
3871 | Called by an event handler, it controls whether additional event | |
3872 | handlers bound to this event will be called after the current event | |
3873 | handler returns. Skip(false) (the default setting) will prevent | |
3874 | additional event handlers from being called and control will be | |
3875 | returned to the sender of the event immediately after the current | |
3876 | handler has finished. Skip(True) will cause the event processing | |
3877 | system to continue searching for a handler function for this event. | |
3878 | ||
3879 | """ | |
54f9ee45 | 3880 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
3881 | |
3882 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3883 | """ |
3884 | GetSkipped(self) -> bool | |
3885 | ||
3886 | Returns true if the event handler should be skipped, false otherwise. | |
3887 | :see: `Skip` | |
3888 | """ | |
54f9ee45 | 3889 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
3890 | |
3891 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3892 | """ |
3893 | ShouldPropagate(self) -> bool | |
3894 | ||
3895 | Test if this event should be propagated to the parent window or not, | |
3896 | i.e. if the propagation level is currently greater than 0. | |
3897 | """ | |
54f9ee45 | 3898 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
3899 | |
3900 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3901 | """ |
3902 | StopPropagation(self) -> int | |
3903 | ||
3904 | Stop the event from propagating to its parent window. Returns the old | |
3905 | propagation level value which may be later passed to | |
3906 | `ResumePropagation` to allow propagating the event again. | |
3907 | """ | |
54f9ee45 | 3908 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
3909 | |
3910 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3911 | """ |
3912 | ResumePropagation(self, int propagationLevel) | |
3913 | ||
3914 | Resume the event propagation by restoring the propagation level. (For | |
3915 | example, you can use the value returned by an earlier call to | |
3916 | `StopPropagation`.) | |
3917 | ||
3918 | """ | |
54f9ee45 | 3919 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
3920 | |
3921 | def Clone(*args, **kwargs): | |
a95a7133 | 3922 | """Clone(self) -> Event""" |
54f9ee45 | 3923 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 3924 | |
2131d850 | 3925 | _core_.Event_swigregister(Event) |
d14a1e28 RD |
3926 | |
3927 | #--------------------------------------------------------------------------- | |
3928 | ||
3929 | class PropagationDisabler(object): | |
27fb7603 RD |
3930 | """ |
3931 | Helper class to temporarily change an event not to propagate. Simply | |
3932 | create an instance of this class and then whe it is destroyed the | |
3933 | propogation of the event will be restored. | |
3934 | """ | |
0085ce49 RD |
3935 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3936 | __repr__ = _swig_repr | |
3937 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3938 | """ |
3939 | __init__(self, Event event) -> PropagationDisabler | |
3940 | ||
3941 | Helper class to temporarily change an event not to propagate. Simply | |
3942 | create an instance of this class and then whe it is destroyed the | |
3943 | propogation of the event will be restored. | |
3944 | """ | |
0085ce49 RD |
3945 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
3946 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
3947 | __del__ = lambda self : None; | |
2131d850 | 3948 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d14a1e28 RD |
3949 | |
3950 | class PropagateOnce(object): | |
27fb7603 RD |
3951 | """ |
3952 | A helper class that will temporarily lower propagation level of an | |
3953 | event. Simply create an instance of this class and then whe it is | |
3954 | destroyed the propogation of the event will be restored. | |
3955 | """ | |
0085ce49 RD |
3956 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3957 | __repr__ = _swig_repr | |
3958 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3959 | """ |
3960 | __init__(self, Event event) -> PropagateOnce | |
3961 | ||
3962 | A helper class that will temporarily lower propagation level of an | |
3963 | event. Simply create an instance of this class and then whe it is | |
3964 | destroyed the propogation of the event will be restored. | |
3965 | """ | |
0085ce49 RD |
3966 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
3967 | __swig_destroy__ = _core_.delete_PropagateOnce | |
3968 | __del__ = lambda self : None; | |
2131d850 | 3969 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d14a1e28 RD |
3970 | |
3971 | #--------------------------------------------------------------------------- | |
3972 | ||
3973 | class CommandEvent(Event): | |
27fb7603 RD |
3974 | """ |
3975 | This event class contains information about command events, which | |
3976 | originate from a variety of simple controls, as well as menus and | |
3977 | toolbars. | |
3978 | """ | |
0085ce49 RD |
3979 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3980 | __repr__ = _swig_repr | |
3981 | def __init__(self, *args, **kwargs): | |
27fb7603 | 3982 | """ |
2131d850 | 3983 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
3984 | |
3985 | This event class contains information about command events, which | |
3986 | originate from a variety of simple controls, as well as menus and | |
3987 | toolbars. | |
3988 | """ | |
0085ce49 | 3989 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
e811c8ce | 3990 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
3991 | """ |
3992 | GetSelection(self) -> int | |
3993 | ||
3994 | Returns item index for a listbox or choice selection event (not valid | |
3995 | for a deselection). | |
3996 | """ | |
54f9ee45 | 3997 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
3998 | |
3999 | def SetString(*args, **kwargs): | |
a95a7133 | 4000 | """SetString(self, String s)""" |
54f9ee45 | 4001 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
4002 | |
4003 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4004 | """ |
4005 | GetString(self) -> String | |
4006 | ||
4007 | Returns item string for a listbox or choice selection event (not valid | |
4008 | for a deselection). | |
4009 | """ | |
54f9ee45 | 4010 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
4011 | |
4012 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4013 | """ |
4014 | IsChecked(self) -> bool | |
4015 | ||
4016 | This method can be used with checkbox and menu events: for the | |
4017 | checkboxes, the method returns true for a selection event and false | |
4018 | for a deselection one. For the menu events, this method indicates if | |
4019 | the menu item just has become checked or unchecked (and thus only | |
4020 | makes sense for checkable menu items). | |
4021 | """ | |
54f9ee45 | 4022 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 4023 | |
242b7b46 | 4024 | Checked = IsChecked |
e811c8ce | 4025 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
4026 | """ |
4027 | IsSelection(self) -> bool | |
4028 | ||
4029 | For a listbox or similar event, returns true if it is a selection, | |
4030 | false if it is a deselection. | |
4031 | """ | |
54f9ee45 | 4032 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
4033 | |
4034 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 4035 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 4036 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
4037 | |
4038 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4039 | """ |
4040 | GetExtraLong(self) -> long | |
4041 | ||
5ba5649b RD |
4042 | Returns extra information dependant on the event objects type. If the |
4043 | event comes from a listbox selection, it is a boolean determining | |
4044 | whether the event was a selection (true) or a deselection (false). A | |
4045 | listbox deselection only occurs for multiple-selection boxes, and in | |
4046 | this case the index and string values are indeterminate and the | |
4047 | listbox must be examined by the application. | |
27fb7603 | 4048 | """ |
54f9ee45 | 4049 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
4050 | |
4051 | def SetInt(*args, **kwargs): | |
a95a7133 | 4052 | """SetInt(self, int i)""" |
54f9ee45 | 4053 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
4054 | |
4055 | def GetInt(*args, **kwargs): | |
27fb7603 | 4056 | """ |
01f6b6d3 | 4057 | GetInt(self) -> int |
27fb7603 | 4058 | |
5ba5649b RD |
4059 | Returns the integer identifier corresponding to a listbox, choice or |
4060 | radiobox selection (only if the event was a selection, not a | |
4061 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4062 | """ |
54f9ee45 | 4063 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce | 4064 | |
0085ce49 RD |
4065 | def GetClientData(*args, **kwargs): |
4066 | """ | |
4067 | GetClientData(self) -> PyObject | |
4068 | ||
4069 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4070 | """ | |
4071 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4072 | ||
4073 | def SetClientData(*args, **kwargs): | |
4074 | """ | |
4075 | SetClientData(self, PyObject clientData) | |
4076 | ||
4077 | Associate the given client data with the item at position n. | |
4078 | """ | |
4079 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4080 | ||
4081 | GetClientObject = GetClientData | |
4082 | SetClientObject = SetClientData | |
4083 | ||
e811c8ce | 4084 | def Clone(*args, **kwargs): |
a95a7133 | 4085 | """Clone(self) -> Event""" |
54f9ee45 | 4086 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4087 | |
2bf58437 RD |
4088 | ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`") |
4089 | ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`") | |
4090 | ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`") | |
4091 | Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`") | |
4092 | Selection = property(GetSelection,doc="See `GetSelection`") | |
4093 | String = property(GetString,SetString,doc="See `GetString` and `SetString`") | |
2131d850 | 4094 | _core_.CommandEvent_swigregister(CommandEvent) |
d14a1e28 RD |
4095 | |
4096 | #--------------------------------------------------------------------------- | |
4097 | ||
4098 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4099 | """ |
4100 | An instance of this class (or one of its derived classes) is sent from | |
4101 | a control when the control's state is being changed and the control | |
4102 | allows that change to be prevented from happening. The event handler | |
4103 | can call `Veto` or `Allow` to tell the control what to do. | |
4104 | """ | |
0085ce49 RD |
4105 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4106 | __repr__ = _swig_repr | |
4107 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4108 | """ |
2131d850 | 4109 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4110 | |
4111 | An instance of this class (or one of its derived classes) is sent from | |
4112 | a control when the control's state is being changed and the control | |
4113 | allows that change to be prevented from happening. The event handler | |
4114 | can call `Veto` or `Allow` to tell the control what to do. | |
4115 | """ | |
0085ce49 | 4116 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
e811c8ce | 4117 | def Veto(*args, **kwargs): |
27fb7603 RD |
4118 | """ |
4119 | Veto(self) | |
4120 | ||
4121 | Prevents the change announced by this event from happening. | |
4122 | ||
4123 | It is in general a good idea to notify the user about the reasons for | |
4124 | vetoing the change because otherwise the applications behaviour (which | |
4125 | just refuses to do what the user wants) might be quite surprising. | |
4126 | """ | |
54f9ee45 | 4127 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4128 | |
4129 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4130 | """ |
4131 | Allow(self) | |
4132 | ||
4133 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4134 | processed. For most events it is not necessary to call this method as | |
4135 | the events are allowed anyhow but some are forbidden by default (this | |
4136 | will be mentioned in the corresponding event description). | |
4137 | """ | |
54f9ee45 | 4138 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4139 | |
4140 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4141 | """ |
4142 | IsAllowed(self) -> bool | |
4143 | ||
4144 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4145 | false otherwise (if it was). | |
4146 | """ | |
54f9ee45 | 4147 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4148 | |
2131d850 | 4149 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d14a1e28 RD |
4150 | |
4151 | #--------------------------------------------------------------------------- | |
4152 | ||
4153 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4154 | """ |
4155 | A scroll event holds information about events sent from stand-alone | |
4156 | scrollbars and sliders. Note that scrolled windows do not send | |
4157 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4158 | instead. | |
4159 | """ | |
0085ce49 RD |
4160 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4161 | __repr__ = _swig_repr | |
4162 | def __init__(self, *args, **kwargs): | |
0df68c9f | 4163 | """ |
2131d850 | 4164 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4165 | int orient=0) -> ScrollEvent |
4166 | """ | |
0085ce49 | 4167 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
e811c8ce | 4168 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4169 | """ |
4170 | GetOrientation(self) -> int | |
4171 | ||
4172 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4173 | the scrollbar. | |
4174 | """ | |
54f9ee45 | 4175 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4176 | |
4177 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4178 | """ |
4179 | GetPosition(self) -> int | |
4180 | ||
4181 | Returns the position of the scrollbar. | |
4182 | """ | |
54f9ee45 | 4183 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4184 | |
4185 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4186 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4187 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4188 | |
4189 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4190 | """SetPosition(self, int pos)""" |
54f9ee45 | 4191 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4192 | |
2131d850 | 4193 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d14a1e28 RD |
4194 | |
4195 | #--------------------------------------------------------------------------- | |
4196 | ||
4197 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4198 | """ |
4199 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4200 | scrolling windows. | |
4201 | """ | |
0085ce49 RD |
4202 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4203 | __repr__ = _swig_repr | |
4204 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4205 | """ |
2131d850 | 4206 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4207 | |
4208 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4209 | scrolling windows. | |
4210 | """ | |
0085ce49 | 4211 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
e811c8ce | 4212 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4213 | """ |
4214 | GetOrientation(self) -> int | |
4215 | ||
4216 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4217 | the scrollbar. | |
4218 | """ | |
54f9ee45 | 4219 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4220 | |
4221 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4222 | """ |
4223 | GetPosition(self) -> int | |
4224 | ||
4225 | Returns the position of the scrollbar for the thumb track and release | |
4226 | events. Note that this field can't be used for the other events, you | |
4227 | need to query the window itself for the current position in that case. | |
4228 | """ | |
54f9ee45 | 4229 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4230 | |
4231 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4232 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4233 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4234 | |
4235 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4236 | """SetPosition(self, int pos)""" |
54f9ee45 | 4237 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4238 | |
2131d850 | 4239 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d14a1e28 RD |
4240 | |
4241 | #--------------------------------------------------------------------------- | |
4242 | ||
54f9ee45 RD |
4243 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4244 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4245 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4246 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4247 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4248 | class MouseEvent(Event): |
27fb7603 RD |
4249 | """ |
4250 | This event class contains information about the events generated by | |
4251 | the mouse: they include mouse buttons press and release events and | |
4252 | mouse move events. | |
4253 | ||
4254 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4255 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4256 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4257 | a middle button so a portable application should avoid relying on the | |
4258 | events from it. | |
4259 | ||
4260 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4261 | the former returns true when the event corresponds to the left mouse | |
4262 | button click while the latter returns true if the left mouse button is | |
4263 | currently being pressed. For example, when the user is dragging the | |
4264 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4265 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4266 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4267 | underlying GUI behaviour is (which is platform-dependent). The same | |
4268 | applies, of course, to other mouse buttons as well. | |
4269 | """ | |
0085ce49 RD |
4270 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4271 | __repr__ = _swig_repr | |
4272 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4273 | """ |
2131d850 | 4274 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4275 | |
4276 | Constructs a wx.MouseEvent. Valid event types are: | |
4277 | ||
4278 | * wxEVT_ENTER_WINDOW | |
4279 | * wxEVT_LEAVE_WINDOW | |
4280 | * wxEVT_LEFT_DOWN | |
4281 | * wxEVT_LEFT_UP | |
4282 | * wxEVT_LEFT_DCLICK | |
4283 | * wxEVT_MIDDLE_DOWN | |
4284 | * wxEVT_MIDDLE_UP | |
4285 | * wxEVT_MIDDLE_DCLICK | |
4286 | * wxEVT_RIGHT_DOWN | |
4287 | * wxEVT_RIGHT_UP | |
4288 | * wxEVT_RIGHT_DCLICK | |
4289 | * wxEVT_MOTION | |
4290 | * wxEVT_MOUSEWHEEL | |
4291 | """ | |
0085ce49 | 4292 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
e811c8ce | 4293 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4294 | """ |
4295 | IsButton(self) -> bool | |
4296 | ||
4297 | Returns true if the event was a mouse button event (not necessarily a | |
4298 | button down event - that may be tested using `ButtonDown`). | |
4299 | """ | |
54f9ee45 | 4300 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4301 | |
4302 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4303 | """ |
4304 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4305 | ||
5ba5649b RD |
4306 | If the argument is omitted, this returns true if the event was any |
4307 | mouse button down event. Otherwise the argument specifies which | |
4308 | button-down event shold be checked for (see `Button` for the possible | |
4309 | values). | |
27fb7603 | 4310 | """ |
54f9ee45 | 4311 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4312 | |
4313 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4314 | """ |
4315 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4316 | ||
4317 | If the argument is omitted, this returns true if the event was any | |
4318 | mouse double click event. Otherwise the argument specifies which | |
4319 | double click event to check for (see `Button` for the possible | |
4320 | values). | |
4321 | """ | |
54f9ee45 | 4322 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4323 | |
4324 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4325 | """ |
4326 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4327 | ||
4328 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4329 | mouse button up event. Otherwise the argument specifies which button |
4330 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4331 | """ |
54f9ee45 | 4332 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4333 | |
4334 | def Button(*args, **kwargs): | |
27fb7603 RD |
4335 | """ |
4336 | Button(self, int button) -> bool | |
4337 | ||
4338 | Returns true if the identified mouse button is changing state. Valid | |
4339 | values of button are: | |
4340 | ||
4341 | ==================== ===================================== | |
4342 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4343 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4344 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4345 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4346 | ==================== ===================================== | |
4347 | ||
4348 | """ | |
54f9ee45 | 4349 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4350 | |
4351 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4352 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4353 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4354 | |
4355 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4356 | """ |
4357 | GetButton(self) -> int | |
4358 | ||
4359 | Returns the mouse button which generated this event or | |
4360 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4361 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4362 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4363 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4364 | right buttons respectively. | |
4365 | """ | |
54f9ee45 | 4366 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4367 | |
4368 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4369 | """ |
4370 | ControlDown(self) -> bool | |
4371 | ||
4372 | Returns true if the control key was down at the time of the event. | |
4373 | """ | |
54f9ee45 | 4374 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4375 | |
4376 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4377 | """ |
4378 | MetaDown(self) -> bool | |
4379 | ||
4380 | Returns true if the Meta key was down at the time of the event. | |
4381 | """ | |
54f9ee45 | 4382 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4383 | |
4384 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4385 | """ |
4386 | AltDown(self) -> bool | |
4387 | ||
4388 | Returns true if the Alt key was down at the time of the event. | |
4389 | """ | |
54f9ee45 | 4390 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4391 | |
4392 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4393 | """ |
4394 | ShiftDown(self) -> bool | |
4395 | ||
4396 | Returns true if the Shift key was down at the time of the event. | |
4397 | """ | |
54f9ee45 | 4398 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4399 | |
412d302d RD |
4400 | def CmdDown(*args, **kwargs): |
4401 | """ | |
4402 | CmdDown(self) -> bool | |
4403 | ||
4404 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4405 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4406 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4407 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4408 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4409 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4410 | and Macs this is the same as `MetaDown`. | |
4411 | """ | |
4412 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4413 | ||
e811c8ce | 4414 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4415 | """ |
4416 | LeftDown(self) -> bool | |
4417 | ||
4418 | Returns true if the left mouse button state changed to down. | |
4419 | """ | |
54f9ee45 | 4420 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4421 | |
4422 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4423 | """ |
4424 | MiddleDown(self) -> bool | |
4425 | ||
4426 | Returns true if the middle mouse button state changed to down. | |
4427 | """ | |
54f9ee45 | 4428 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4429 | |
4430 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4431 | """ |
4432 | RightDown(self) -> bool | |
4433 | ||
4434 | Returns true if the right mouse button state changed to down. | |
4435 | """ | |
54f9ee45 | 4436 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4437 | |
4438 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4439 | """ |
4440 | LeftUp(self) -> bool | |
4441 | ||
4442 | Returns true if the left mouse button state changed to up. | |
4443 | """ | |
54f9ee45 | 4444 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4445 | |
4446 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4447 | """ |
4448 | MiddleUp(self) -> bool | |
4449 | ||
4450 | Returns true if the middle mouse button state changed to up. | |
4451 | """ | |
54f9ee45 | 4452 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4453 | |
4454 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4455 | """ |
4456 | RightUp(self) -> bool | |
4457 | ||
4458 | Returns true if the right mouse button state changed to up. | |
4459 | """ | |
54f9ee45 | 4460 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4461 | |
4462 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4463 | """ |
4464 | LeftDClick(self) -> bool | |
4465 | ||
4466 | Returns true if the event was a left button double click. | |
4467 | """ | |
54f9ee45 | 4468 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4469 | |
4470 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4471 | """ |
4472 | MiddleDClick(self) -> bool | |
4473 | ||
4474 | Returns true if the event was a middle button double click. | |
4475 | """ | |
54f9ee45 | 4476 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4477 | |
4478 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4479 | """ |
4480 | RightDClick(self) -> bool | |
4481 | ||
4482 | Returns true if the event was a right button double click. | |
4483 | """ | |
54f9ee45 | 4484 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4485 | |
4486 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4487 | """ |
4488 | LeftIsDown(self) -> bool | |
4489 | ||
4490 | Returns true if the left mouse button is currently down, independent | |
4491 | of the current event type. | |
4492 | ||
4493 | Please notice that it is not the same as LeftDown which returns true | |
4494 | if the left mouse button was just pressed. Rather, it describes the | |
4495 | state of the mouse button before the event happened. | |
4496 | ||
4497 | This event is usually used in the mouse event handlers which process | |
4498 | "move mouse" messages to determine whether the user is (still) | |
4499 | dragging the mouse. | |
4500 | """ | |
54f9ee45 | 4501 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4502 | |
4503 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4504 | """ |
4505 | MiddleIsDown(self) -> bool | |
4506 | ||
4507 | Returns true if the middle mouse button is currently down, independent | |
4508 | of the current event type. | |
4509 | """ | |
54f9ee45 | 4510 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
4511 | |
4512 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4513 | """ |
4514 | RightIsDown(self) -> bool | |
4515 | ||
4516 | Returns true if the right mouse button is currently down, independent | |
4517 | of the current event type. | |
4518 | """ | |
54f9ee45 | 4519 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
4520 | |
4521 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4522 | """ |
4523 | Dragging(self) -> bool | |
4524 | ||
4525 | Returns true if this was a dragging event (motion while a button is | |
4526 | depressed). | |
4527 | """ | |
54f9ee45 | 4528 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
4529 | |
4530 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4531 | """ |
4532 | Moving(self) -> bool | |
4533 | ||
4534 | Returns true if this was a motion event and no mouse buttons were | |
4535 | pressed. If any mouse button is held pressed, then this method returns | |
4536 | false and Dragging returns true. | |
4537 | """ | |
54f9ee45 | 4538 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
4539 | |
4540 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4541 | """ |
4542 | Entering(self) -> bool | |
4543 | ||
4544 | Returns true if the mouse was entering the window. | |
4545 | """ | |
54f9ee45 | 4546 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
4547 | |
4548 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4549 | """ |
4550 | Leaving(self) -> bool | |
4551 | ||
4552 | Returns true if the mouse was leaving the window. | |
4553 | """ | |
54f9ee45 | 4554 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
4555 | |
4556 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4557 | """ |
a95a7133 | 4558 | GetPosition(self) -> Point |
e811c8ce | 4559 | |
27fb7603 RD |
4560 | Returns the pixel position of the mouse in window coordinates when the |
4561 | event happened. | |
0df68c9f | 4562 | """ |
54f9ee45 | 4563 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4564 | |
4565 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4566 | """ |
4567 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4568 | |
27fb7603 RD |
4569 | Returns the pixel position of the mouse in window coordinates when the |
4570 | event happened. | |
0df68c9f | 4571 | """ |
54f9ee45 | 4572 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4573 | |
4574 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4575 | """ |
4576 | GetLogicalPosition(self, DC dc) -> Point | |
4577 | ||
4578 | Returns the logical mouse position in pixels (i.e. translated | |
4579 | according to the translation set for the DC, which usually indicates | |
4580 | that the window has been scrolled). | |
4581 | """ | |
54f9ee45 | 4582 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
4583 | |
4584 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4585 | """ |
4586 | GetX(self) -> int | |
4587 | ||
4588 | Returns X coordinate of the physical mouse event position. | |
4589 | """ | |
54f9ee45 | 4590 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4591 | |
4592 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4593 | """ |
4594 | GetY(self) -> int | |
4595 | ||
4596 | Returns Y coordinate of the physical mouse event position. | |
4597 | """ | |
54f9ee45 | 4598 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4599 | |
4600 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4601 | """ |
4602 | GetWheelRotation(self) -> int | |
4603 | ||
4604 | Get wheel rotation, positive or negative indicates direction of | |
4605 | rotation. Current devices all send an event when rotation is equal to | |
4606 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4607 | created in the future. Because of this you shouldn't assume that one | |
4608 | event is equal to 1 line or whatever, but you should be able to either | |
4609 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4610 | have been accumulated before scrolling. | |
4611 | """ | |
54f9ee45 | 4612 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
4613 | |
4614 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4615 | """ |
4616 | GetWheelDelta(self) -> int | |
4617 | ||
4618 | Get wheel delta, normally 120. This is the threshold for action to be | |
4619 | taken, and one such action (for example, scrolling one increment) | |
4620 | should occur for each delta. | |
4621 | """ | |
54f9ee45 | 4622 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce RD |
4623 | |
4624 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4625 | """ |
4626 | GetLinesPerAction(self) -> int | |
4627 | ||
4628 | Returns the configured number of lines (or whatever) to be scrolled | |
4629 | per wheel action. Defaults to three. | |
4630 | """ | |
54f9ee45 | 4631 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
4632 | |
4633 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4634 | """ |
4635 | IsPageScroll(self) -> bool | |
4636 | ||
4637 | Returns true if the system has been setup to do page scrolling with | |
4638 | the mouse wheel instead of line scrolling. | |
4639 | """ | |
54f9ee45 RD |
4640 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4641 | ||
4642 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4643 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4644 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4645 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4646 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4647 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4648 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4649 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4650 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4651 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4652 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4653 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
2131d850 | 4654 | _core_.MouseEvent_swigregister(MouseEvent) |
d14a1e28 RD |
4655 | |
4656 | #--------------------------------------------------------------------------- | |
4657 | ||
4658 | class SetCursorEvent(Event): | |
5ba5649b RD |
4659 | """ |
4660 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4661 | as a result of mouse motion. This event gives the application the | |
4662 | chance to perform specific mouse cursor processing based on the | |
4663 | current position of the mouse within the window. Use the `SetCursor` | |
4664 | method to specify the cursor you want to be displayed. | |
4665 | """ | |
0085ce49 RD |
4666 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4667 | __repr__ = _swig_repr | |
4668 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4669 | """ |
4670 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4671 | ||
4672 | Construct a new `wx.SetCursorEvent`. | |
4673 | """ | |
0085ce49 | 4674 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
e811c8ce | 4675 | def GetX(*args, **kwargs): |
5ba5649b RD |
4676 | """ |
4677 | GetX(self) -> int | |
4678 | ||
4679 | Returns the X coordinate of the mouse in client coordinates. | |
4680 | """ | |
54f9ee45 | 4681 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4682 | |
4683 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4684 | """ |
4685 | GetY(self) -> int | |
4686 | ||
4687 | Returns the Y coordinate of the mouse in client coordinates. | |
4688 | """ | |
54f9ee45 | 4689 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4690 | |
4691 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4692 | """ |
4693 | SetCursor(self, Cursor cursor) | |
4694 | ||
4695 | Sets the cursor associated with this event. | |
4696 | """ | |
54f9ee45 | 4697 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
4698 | |
4699 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4700 | """ |
4701 | GetCursor(self) -> Cursor | |
4702 | ||
4703 | Returns a reference to the cursor specified by this event. | |
4704 | """ | |
54f9ee45 | 4705 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
4706 | |
4707 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4708 | """ |
4709 | HasCursor(self) -> bool | |
4710 | ||
4711 | Returns true if the cursor specified by this event is a valid cursor. | |
4712 | """ | |
54f9ee45 | 4713 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 4714 | |
2131d850 | 4715 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d14a1e28 RD |
4716 | |
4717 | #--------------------------------------------------------------------------- | |
4718 | ||
4719 | class KeyEvent(Event): | |
5ba5649b RD |
4720 | """ |
4721 | This event class contains information about keypress and character | |
4722 | events. These events are only sent to the widget that currently has | |
4723 | the keyboard focus. | |
4724 | ||
4725 | Notice that there are three different kinds of keyboard events in | |
4726 | wxWidgets: key down and up events and char events. The difference | |
4727 | between the first two is clear - the first corresponds to a key press | |
4728 | and the second to a key release - otherwise they are identical. Just | |
4729 | note that if the key is maintained in a pressed state you will | |
4730 | typically get a lot of (automatically generated) down events but only | |
4731 | one up so it is wrong to assume that there is one up event | |
4732 | corresponding to each down one. | |
4733 | ||
4734 | Both key events provide untranslated key codes while the char event | |
4735 | carries the translated one. The untranslated code for alphanumeric | |
4736 | keys is always an upper case value. For the other keys it is one of | |
4737 | WXK_XXX values from the keycodes table. The translated key is, in | |
4738 | general, the character the user expects to appear as the result of the | |
4739 | key combination when typing the text into a text entry zone, for | |
4740 | example. | |
4741 | ||
4742 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4743 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4744 | down event key code is equal to ASCII A == 65. But the char event key | |
4745 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4746 | 'A' keys simultaneously , the key code in key down event will still be | |
4747 | just 'A' while the char event key code parameter will now be 'A' as | |
4748 | well. | |
4749 | ||
4750 | Although in this simple case it is clear that the correct key code | |
4751 | could be found in the key down event handler by checking the value | |
4752 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4753 | as for non alphanumeric keys or non-US keyboard layouts the | |
4754 | translation is keyboard-layout dependent and can only be done properly | |
4755 | by the system itself. | |
4756 | ||
4757 | Another kind of translation is done when the control key is pressed: | |
4758 | for example, for CTRL-A key press the key down event still carries the | |
4759 | same key code 'A' as usual but the char event will have key code of 1, | |
4760 | the ASCII value of this key combination. | |
4761 | ||
4762 | You may discover how the other keys on your system behave | |
4763 | interactively by running the KeyEvents sample in the wxPython demo and | |
4764 | pressing some keys while the blue box at the top has the keyboard | |
4765 | focus. | |
4766 | ||
4767 | **Note**: If a key down event is caught and the event handler does not | |
4768 | call event.Skip() then the coresponding char event will not | |
4769 | happen. This is by design and enables the programs that handle both | |
4770 | types of events to be a bit simpler. | |
4771 | ||
4772 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4773 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4774 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4775 | event in wxWidgets (unless it is used as an accelerator). | |
4776 | ||
4777 | **Tip**: be sure to call event.Skip() for events that you don't | |
4778 | process in key event function, otherwise menu shortcuts may cease to | |
4779 | work under Windows. | |
4780 | ||
4781 | """ | |
0085ce49 RD |
4782 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4783 | __repr__ = _swig_repr | |
4784 | def __init__(self, *args, **kwargs): | |
5ba5649b | 4785 | """ |
2131d850 | 4786 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
4787 | |
4788 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4789 | * | |
4790 | """ | |
0085ce49 | 4791 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
4792 | def GetModifiers(*args, **kwargs): |
4793 | """ | |
4794 | GetModifiers(self) -> int | |
4795 | ||
4796 | Returns a bitmask of the current modifier settings. Can be used to | |
4797 | check if the key event has exactly the given modifiers without having | |
4798 | to explicitly check that the other modifiers are not down. For | |
4799 | example:: | |
4800 | ||
4801 | if event.GetModifers() == wx.MOD_CONTROL: | |
4802 | DoSomething() | |
4803 | ||
4804 | """ | |
4805 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
4806 | ||
e811c8ce | 4807 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4808 | """ |
4809 | ControlDown(self) -> bool | |
4810 | ||
4811 | Returns ``True`` if the Control key was down at the time of the event. | |
4812 | """ | |
54f9ee45 | 4813 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4814 | |
4815 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4816 | """ |
4817 | MetaDown(self) -> bool | |
4818 | ||
4819 | Returns ``True`` if the Meta key was down at the time of the event. | |
4820 | """ | |
54f9ee45 | 4821 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4822 | |
4823 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4824 | """ |
4825 | AltDown(self) -> bool | |
4826 | ||
4827 | Returns ``True`` if the Alt key was down at the time of the event. | |
4828 | """ | |
54f9ee45 | 4829 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4830 | |
4831 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4832 | """ |
4833 | ShiftDown(self) -> bool | |
4834 | ||
4835 | Returns ``True`` if the Shift key was down at the time of the event. | |
4836 | """ | |
54f9ee45 | 4837 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4838 | |
412d302d RD |
4839 | def CmdDown(*args, **kwargs): |
4840 | """ | |
4841 | CmdDown(self) -> bool | |
4842 | ||
4843 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4844 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4845 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4846 | because Cmd key is used for the same thing under Mac as Ctrl |
4847 | elsewhere. The Ctrl still exists, it's just not used for this | |
4848 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4849 | and Macs this is the same as `MetaDown`. | |
4850 | """ | |
4851 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
4852 | ||
e811c8ce | 4853 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4854 | """ |
4855 | HasModifiers(self) -> bool | |
4856 | ||
4857 | Returns true if either CTRL or ALT keys was down at the time of the | |
4858 | key event. Note that this function does not take into account neither | |
4859 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4860 | it is common for NUMLOCK key to be configured as META under X but the | |
4861 | key presses even while NUMLOCK is on should be still processed | |
4862 | normally). | |
4863 | """ | |
54f9ee45 | 4864 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
4865 | |
4866 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4867 | """ |
4868 | GetKeyCode(self) -> int | |
4869 | ||
4870 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4871 | while non-ASCII events return values such as WXK_LEFT for the left | |
4872 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4873 | codes. | |
4874 | ||
4875 | Note that in Unicode build, the returned value is meaningful only if | |
4876 | the user entered a character that can be represented in current | |
4877 | locale's default charset. You can obtain the corresponding Unicode | |
4878 | character using `GetUnicodeKey`. | |
4879 | """ | |
54f9ee45 | 4880 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 4881 | |
d14a1e28 | 4882 | KeyCode = GetKeyCode |
19272049 | 4883 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4884 | """ |
4885 | GetUnicodeKey(self) -> int | |
4886 | ||
4887 | Returns the Unicode character corresponding to this key event. This | |
4888 | function is only meaningfule in a Unicode build of wxPython. | |
4889 | """ | |
19272049 | 4890 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 4891 | |
19272049 | 4892 | GetUniChar = GetUnicodeKey |
b850e7f3 RD |
4893 | def SetUnicodeKey(*args, **kwargs): |
4894 | """ | |
4895 | SetUnicodeKey(self, int uniChar) | |
4896 | ||
4897 | Set the Unicode value of the key event, but only if this is a Unicode | |
4898 | build of wxPython. | |
4899 | """ | |
4900 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
4901 | ||
e811c8ce | 4902 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4903 | """ |
4904 | GetRawKeyCode(self) -> unsigned int | |
4905 | ||
4906 | Returns the raw key code for this event. This is a platform-dependent | |
4907 | scan code which should only be used in advanced | |
4908 | applications. Currently the raw key codes are not supported by all | |
4909 | ports. | |
4910 | """ | |
54f9ee45 | 4911 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
4912 | |
4913 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
4914 | """ |
4915 | GetRawKeyFlags(self) -> unsigned int | |
4916 | ||
4917 | Returns the low level key flags for this event. The flags are | |
4918 | platform-dependent and should only be used in advanced applications. | |
4919 | Currently the raw key flags are not supported by all ports. | |
4920 | """ | |
54f9ee45 | 4921 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
4922 | |
4923 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4924 | """ |
a95a7133 | 4925 | GetPosition(self) -> Point |
e811c8ce | 4926 | |
5ba5649b | 4927 | Find the position of the event, if applicable. |
0df68c9f | 4928 | """ |
54f9ee45 | 4929 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4930 | |
4931 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4932 | """ |
4933 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4934 | |
5ba5649b | 4935 | Find the position of the event, if applicable. |
0df68c9f | 4936 | """ |
54f9ee45 | 4937 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4938 | |
4939 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4940 | """ |
4941 | GetX(self) -> int | |
4942 | ||
4943 | Returns the X position (in client coordinates) of the event, if | |
4944 | applicable. | |
4945 | """ | |
54f9ee45 | 4946 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4947 | |
4948 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4949 | """ |
4950 | GetY(self) -> int | |
4951 | ||
4952 | Returns the Y position (in client coordinates) of the event, if | |
4953 | applicable. | |
4954 | """ | |
54f9ee45 RD |
4955 | return _core_.KeyEvent_GetY(*args, **kwargs) |
4956 | ||
4957 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
4958 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
4959 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
4960 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
4961 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
4962 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
4963 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
4964 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
4965 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
4966 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
2131d850 | 4967 | _core_.KeyEvent_swigregister(KeyEvent) |
d14a1e28 RD |
4968 | |
4969 | #--------------------------------------------------------------------------- | |
4970 | ||
4971 | class SizeEvent(Event): | |
5ba5649b RD |
4972 | """ |
4973 | A size event holds information about size change events. The EVT_SIZE | |
4974 | handler function will be called when the window it is bound to has | |
4975 | been resized. | |
4976 | ||
4977 | Note that the size passed is of the whole window: call | |
4978 | `wx.Window.GetClientSize` for the area which may be used by the | |
4979 | application. | |
4980 | ||
4981 | When a window is resized, usually only a small part of the window is | |
4982 | damaged and and that area is all that is in the update region for the | |
4983 | next paint event. However, if your drawing depends on the size of the | |
4984 | window, you may need to clear the DC explicitly and repaint the whole | |
4985 | window. In which case, you may need to call `wx.Window.Refresh` to | |
4986 | invalidate the entire window. | |
4987 | ||
4988 | """ | |
0085ce49 RD |
4989 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4990 | __repr__ = _swig_repr | |
4991 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4992 | """ |
4993 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
4994 | ||
4995 | Construct a new ``wx.SizeEvent``. | |
4996 | """ | |
0085ce49 | 4997 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
e811c8ce | 4998 | def GetSize(*args, **kwargs): |
5ba5649b RD |
4999 | """ |
5000 | GetSize(self) -> Size | |
5001 | ||
5002 | Returns the entire size of the window generating the size change | |
5003 | event. | |
5004 | """ | |
54f9ee45 | 5005 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
5006 | |
5007 | def GetRect(*args, **kwargs): | |
a95a7133 | 5008 | """GetRect(self) -> Rect""" |
54f9ee45 | 5009 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5010 | |
5011 | def SetRect(*args, **kwargs): | |
a95a7133 | 5012 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5013 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5014 | |
5015 | def SetSize(*args, **kwargs): | |
a95a7133 | 5016 | """SetSize(self, Size size)""" |
54f9ee45 | 5017 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 5018 | |
54f9ee45 RD |
5019 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5020 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
2131d850 | 5021 | _core_.SizeEvent_swigregister(SizeEvent) |
d14a1e28 RD |
5022 | |
5023 | #--------------------------------------------------------------------------- | |
5024 | ||
5025 | class MoveEvent(Event): | |
5ba5649b RD |
5026 | """ |
5027 | This event object is sent for EVT_MOVE event bindings when a window is | |
5028 | moved to a new position. | |
5029 | """ | |
0085ce49 RD |
5030 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5031 | __repr__ = _swig_repr | |
5032 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5033 | """ |
5034 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5035 | ||
5036 | Constructor. | |
5037 | """ | |
0085ce49 | 5038 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
e811c8ce | 5039 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5040 | """ |
5041 | GetPosition(self) -> Point | |
5042 | ||
5043 | Returns the position of the window generating the move change event. | |
5044 | """ | |
54f9ee45 | 5045 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5046 | |
5047 | def GetRect(*args, **kwargs): | |
a95a7133 | 5048 | """GetRect(self) -> Rect""" |
54f9ee45 | 5049 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5050 | |
5051 | def SetRect(*args, **kwargs): | |
a95a7133 | 5052 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5053 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5054 | |
5055 | def SetPosition(*args, **kwargs): | |
a95a7133 | 5056 | """SetPosition(self, Point pos)""" |
54f9ee45 | 5057 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 5058 | |
7557b9b5 RD |
5059 | m_pos = property(GetPosition, SetPosition) |
5060 | m_rect = property(GetRect, SetRect) | |
5061 | ||
2131d850 | 5062 | _core_.MoveEvent_swigregister(MoveEvent) |
d14a1e28 RD |
5063 | |
5064 | #--------------------------------------------------------------------------- | |
5065 | ||
5066 | class PaintEvent(Event): | |
5ba5649b RD |
5067 | """ |
5068 | A paint event is sent when a window's contents needs to be repainted. | |
5069 | Note that in an EVT_PAINT handler the application must *always* create | |
5070 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5071 | Windows assumes that the window has not been painted yet and will send | |
5072 | the event again, causing endless refreshes. | |
5073 | ||
5074 | You can optimize painting by retrieving the rectangles that have been | |
5075 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5076 | and only repainting these rectangles. The rectangles are in terms of | |
5077 | the client area, and are unscrolled, so you will need to do some | |
5078 | calculations using the current view position to obtain logical, | |
5079 | scrolled units. | |
5080 | ||
5081 | """ | |
0085ce49 RD |
5082 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5083 | __repr__ = _swig_repr | |
5084 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5085 | """__init__(self, int Id=0) -> PaintEvent""" |
0085ce49 | 5086 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5087 | _core_.PaintEvent_swigregister(PaintEvent) |
d14a1e28 RD |
5088 | |
5089 | class NcPaintEvent(Event): | |
093d3ff1 | 5090 | """Proxy of C++ NcPaintEvent class""" |
0085ce49 RD |
5091 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5092 | __repr__ = _swig_repr | |
5093 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5094 | """__init__(self, int winid=0) -> NcPaintEvent""" |
0085ce49 | 5095 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5096 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d14a1e28 RD |
5097 | |
5098 | #--------------------------------------------------------------------------- | |
5099 | ||
5100 | class EraseEvent(Event): | |
5ba5649b RD |
5101 | """ |
5102 | An erase event is sent whenever the background of a window needs to be | |
5103 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5104 | binder. On some platforms, such as GTK+, this event is simulated | |
5105 | (simply generated just before the paint event) and may cause flicker. | |
5106 | ||
5107 | To paint a custom background use the `GetDC` method and use the returned | |
5108 | device context if it is not ``None``, otherwise create a temporary | |
5109 | `wx.ClientDC` and draw on that. | |
5110 | ||
5111 | """ | |
0085ce49 RD |
5112 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5113 | __repr__ = _swig_repr | |
5114 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5115 | """ |
5116 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5117 | ||
5118 | Constructor | |
5119 | """ | |
0085ce49 | 5120 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
e811c8ce | 5121 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5122 | """ |
5123 | GetDC(self) -> DC | |
5124 | ||
5125 | Returns the device context the event handler should draw upon. If | |
5126 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5127 | that instead. | |
5128 | """ | |
54f9ee45 | 5129 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5130 | |
2131d850 | 5131 | _core_.EraseEvent_swigregister(EraseEvent) |
d14a1e28 RD |
5132 | |
5133 | #--------------------------------------------------------------------------- | |
5134 | ||
5135 | class FocusEvent(Event): | |
5ba5649b RD |
5136 | """ |
5137 | A focus event is sent when a window's focus changes. The window losing | |
5138 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5139 | gets an EVT_SET_FOCUS event. | |
5140 | ||
5141 | Notice that the set focus event happens both when the user gives focus | |
5142 | to the window (whether using the mouse or keyboard) and when it is | |
5143 | done from the program itself using `wx.Window.SetFocus`. | |
5144 | ||
5145 | """ | |
0085ce49 RD |
5146 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5147 | __repr__ = _swig_repr | |
5148 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5149 | """ |
2131d850 | 5150 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5151 | |
5152 | Constructor | |
5153 | """ | |
0085ce49 | 5154 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
e811c8ce | 5155 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5156 | """ |
5157 | GetWindow(self) -> Window | |
5158 | ||
5159 | Returns the other window associated with this event, that is the | |
5160 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5161 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5162 | ||
5163 | Warning: the window returned may be None! | |
5164 | """ | |
54f9ee45 | 5165 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5166 | |
5167 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5168 | """SetWindow(self, Window win)""" |
54f9ee45 | 5169 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5170 | |
2131d850 | 5171 | _core_.FocusEvent_swigregister(FocusEvent) |
d14a1e28 RD |
5172 | |
5173 | #--------------------------------------------------------------------------- | |
5174 | ||
5175 | class ChildFocusEvent(CommandEvent): | |
5ba5649b RD |
5176 | """ |
5177 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5178 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5179 | heirarchy. | |
5180 | """ | |
0085ce49 RD |
5181 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5182 | __repr__ = _swig_repr | |
5183 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5184 | """ |
5185 | __init__(self, Window win=None) -> ChildFocusEvent | |
5186 | ||
5187 | Constructor | |
5188 | """ | |
0085ce49 | 5189 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
e811c8ce | 5190 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5191 | """ |
5192 | GetWindow(self) -> Window | |
5193 | ||
5194 | The window which has just received the focus. | |
5195 | """ | |
54f9ee45 | 5196 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5197 | |
2bf58437 | 5198 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 5199 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d14a1e28 RD |
5200 | |
5201 | #--------------------------------------------------------------------------- | |
5202 | ||
5203 | class ActivateEvent(Event): | |
5ba5649b RD |
5204 | """ |
5205 | An activate event is sent when a top-level window or the entire | |
5206 | application is being activated or deactivated. | |
5207 | ||
5208 | A top-level window (a dialog or frame) receives an activate event when | |
5209 | is being activated or deactivated. This is indicated visually by the | |
5210 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5211 | An application is activated or deactivated when one of its frames | |
5212 | becomes activated, or a frame becomes inactivate resulting in all | |
5213 | application frames being inactive. | |
5214 | ||
5215 | Please note that usually you should call event.Skip() in your handlers | |
5216 | for these events so the default handlers will still be called, as not | |
5217 | doing so can result in strange effects. | |
5218 | ||
5219 | """ | |
0085ce49 RD |
5220 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5221 | __repr__ = _swig_repr | |
5222 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5223 | """ |
2131d850 | 5224 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5225 | |
5226 | Constructor | |
5227 | """ | |
0085ce49 | 5228 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
e811c8ce | 5229 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5230 | """ |
5231 | GetActive(self) -> bool | |
5232 | ||
5233 | Returns true if the application or window is being activated, false | |
5234 | otherwise. | |
5235 | """ | |
54f9ee45 | 5236 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5237 | |
2bf58437 | 5238 | Active = property(GetActive,doc="See `GetActive`") |
2131d850 | 5239 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d14a1e28 RD |
5240 | |
5241 | #--------------------------------------------------------------------------- | |
5242 | ||
5243 | class InitDialogEvent(Event): | |
5ba5649b RD |
5244 | """ |
5245 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5246 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5247 | event can transfer data to the window, or anything else that should be | |
5248 | done before the user begins editing the form. The default handler | |
5249 | calls `wx.Window.TransferDataToWindow`. | |
5250 | """ | |
0085ce49 RD |
5251 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5252 | __repr__ = _swig_repr | |
5253 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5254 | """ |
5255 | __init__(self, int Id=0) -> InitDialogEvent | |
5256 | ||
5257 | Constructor | |
5258 | """ | |
0085ce49 | 5259 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5260 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d14a1e28 RD |
5261 | |
5262 | #--------------------------------------------------------------------------- | |
5263 | ||
5264 | class MenuEvent(Event): | |
5ba5649b RD |
5265 | """ |
5266 | This class is used for a variety of menu-related events. Note that | |
5267 | these do not include menu command events, which are handled by sending | |
5268 | `wx.CommandEvent` objects. | |
5269 | ||
5270 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5271 | text in the first field of the status bar. | |
5272 | """ | |
0085ce49 RD |
5273 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5274 | __repr__ = _swig_repr | |
5275 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5276 | """ |
2131d850 | 5277 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5278 | |
5279 | Constructor | |
5280 | """ | |
0085ce49 | 5281 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
e811c8ce | 5282 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5283 | """ |
5284 | GetMenuId(self) -> int | |
5285 | ||
5286 | Returns the menu identifier associated with the event. This method | |
5287 | should be only used with the HIGHLIGHT events. | |
5288 | """ | |
54f9ee45 | 5289 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5290 | |
5291 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5292 | """ |
5293 | IsPopup(self) -> bool | |
5294 | ||
5295 | Returns ``True`` if the menu which is being opened or closed is a | |
5296 | popup menu, ``False`` if it is a normal one. This method should only | |
5297 | be used with the OPEN and CLOSE events. | |
5298 | """ | |
54f9ee45 | 5299 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5300 | |
5301 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5302 | """ |
5303 | GetMenu(self) -> Menu | |
5304 | ||
5305 | Returns the menu which is being opened or closed. This method should | |
5306 | only be used with the OPEN and CLOSE events. | |
5307 | """ | |
54f9ee45 | 5308 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5309 | |
2131d850 | 5310 | _core_.MenuEvent_swigregister(MenuEvent) |
d14a1e28 RD |
5311 | |
5312 | #--------------------------------------------------------------------------- | |
5313 | ||
5314 | class CloseEvent(Event): | |
5ba5649b RD |
5315 | """ |
5316 | This event class contains information about window and session close | |
5317 | events. | |
5318 | ||
5319 | The handler function for EVT_CLOSE is called when the user has tried | |
5320 | to close a a frame or dialog box using the window manager controls or | |
5321 | the system menu. It can also be invoked by the application itself | |
5322 | programmatically, for example by calling the `wx.Window.Close` | |
5323 | function. | |
5324 | ||
5325 | You should check whether the application is forcing the deletion of | |
5326 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5327 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5328 | it is up to you whether you respond by destroying the window or not. | |
5329 | For example you may wish to display a message dialog prompting to save | |
5330 | files or to cancel the close. | |
5331 | ||
5332 | If you don't destroy the window, you should call `Veto` to let the | |
5333 | calling code know that you did not destroy the window. This allows the | |
5334 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5335 | on whether the close instruction was honored or not. | |
5336 | """ | |
0085ce49 RD |
5337 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5338 | __repr__ = _swig_repr | |
5339 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5340 | """ |
2131d850 | 5341 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5342 | |
5343 | Constructor. | |
5344 | """ | |
0085ce49 | 5345 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
e811c8ce | 5346 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5347 | """ |
5348 | SetLoggingOff(self, bool logOff) | |
5349 | ||
5350 | Sets the 'logging off' flag. | |
5351 | """ | |
54f9ee45 | 5352 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5353 | |
5354 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5355 | """ |
5356 | GetLoggingOff(self) -> bool | |
5357 | ||
6c75a4cf RD |
5358 | Returns ``True`` if the user is logging off or ``False`` if the |
5359 | system is shutting down. This method can only be called for end | |
5360 | session and query end session events, it doesn't make sense for close | |
5361 | window event. | |
5ba5649b | 5362 | """ |
54f9ee45 | 5363 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5364 | |
5365 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5366 | """ |
5367 | Veto(self, bool veto=True) | |
5368 | ||
5369 | Call this from your event handler to veto a system shutdown or to | |
5370 | signal to the calling application that a window close did not happen. | |
5371 | ||
5372 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5373 | """ | |
54f9ee45 | 5374 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5375 | |
5ba5649b RD |
5376 | def GetVeto(*args, **kwargs): |
5377 | """GetVeto(self) -> bool""" | |
5378 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5379 | ||
e811c8ce | 5380 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5381 | """ |
5382 | SetCanVeto(self, bool canVeto) | |
5383 | ||
5384 | Sets the 'can veto' flag. | |
5385 | """ | |
54f9ee45 | 5386 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5387 | |
5388 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5389 | """ |
5390 | CanVeto(self) -> bool | |
e811c8ce | 5391 | |
5ba5649b RD |
5392 | Returns true if you can veto a system shutdown or a window close |
5393 | event. Vetoing a window close event is not possible if the calling | |
5394 | code wishes to force the application to exit, and so this function | |
5395 | must be called to check this. | |
5396 | """ | |
5397 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5398 | |
2bf58437 RD |
5399 | LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`") |
5400 | Veto = property(GetVeto,doc="See `GetVeto`") | |
2131d850 | 5401 | _core_.CloseEvent_swigregister(CloseEvent) |
d14a1e28 RD |
5402 | |
5403 | #--------------------------------------------------------------------------- | |
5404 | ||
5405 | class ShowEvent(Event): | |
5ba5649b | 5406 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
0085ce49 RD |
5407 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5408 | __repr__ = _swig_repr | |
5409 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5410 | """ |
5411 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5412 | ||
5413 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5414 | """ | |
0085ce49 | 5415 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
e811c8ce | 5416 | def SetShow(*args, **kwargs): |
a95a7133 | 5417 | """SetShow(self, bool show)""" |
54f9ee45 | 5418 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5419 | |
5420 | def GetShow(*args, **kwargs): | |
a95a7133 | 5421 | """GetShow(self) -> bool""" |
54f9ee45 | 5422 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5423 | |
2131d850 | 5424 | _core_.ShowEvent_swigregister(ShowEvent) |
d14a1e28 RD |
5425 | |
5426 | #--------------------------------------------------------------------------- | |
5427 | ||
5428 | class IconizeEvent(Event): | |
5ba5649b RD |
5429 | """ |
5430 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5431 | restored. | |
5432 | """ | |
0085ce49 RD |
5433 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5434 | __repr__ = _swig_repr | |
5435 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5436 | """ |
5437 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5438 | ||
5439 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5440 | restored. | |
5441 | """ | |
0085ce49 | 5442 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
e811c8ce | 5443 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5444 | """ |
5445 | Iconized(self) -> bool | |
5446 | ||
5447 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5448 | been restored. | |
5449 | """ | |
54f9ee45 | 5450 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5451 | |
2131d850 | 5452 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d14a1e28 RD |
5453 | |
5454 | #--------------------------------------------------------------------------- | |
5455 | ||
5456 | class MaximizeEvent(Event): | |
5ba5649b | 5457 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
0085ce49 RD |
5458 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5459 | __repr__ = _swig_repr | |
5460 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5461 | """ |
5462 | __init__(self, int id=0) -> MaximizeEvent | |
5463 | ||
5464 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5465 | """ | |
0085ce49 | 5466 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 5467 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d14a1e28 RD |
5468 | |
5469 | #--------------------------------------------------------------------------- | |
5470 | ||
5471 | class DropFilesEvent(Event): | |
5ba5649b RD |
5472 | """ |
5473 | This class is used for drop files events, that is, when files have | |
5474 | been dropped onto the window. This functionality is only available | |
5475 | under Windows. The window must have previously been enabled for | |
5476 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5477 | ||
5478 | Important note: this is a separate implementation to the more general | |
5479 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5480 | implementation uses the older, Windows message-based approach of | |
5481 | dropping files. | |
5482 | ||
5483 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5484 | events. | |
5485 | ||
5486 | """ | |
0085ce49 RD |
5487 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5488 | def __init__(self): raise AttributeError, "No constructor defined" | |
5489 | __repr__ = _swig_repr | |
e811c8ce | 5490 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5491 | """ |
5492 | GetPosition(self) -> Point | |
5493 | ||
5494 | Returns the position at which the files were dropped. | |
5495 | """ | |
54f9ee45 | 5496 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5497 | |
5498 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5499 | """ |
5500 | GetNumberOfFiles(self) -> int | |
5501 | ||
5502 | Returns the number of files dropped. | |
5503 | """ | |
54f9ee45 | 5504 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
5505 | |
5506 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5507 | """ |
5508 | GetFiles(self) -> PyObject | |
5509 | ||
5510 | Returns a list of the filenames that were dropped. | |
5511 | """ | |
54f9ee45 | 5512 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 5513 | |
2bf58437 RD |
5514 | Files = property(GetFiles,doc="See `GetFiles`") |
5515 | NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`") | |
5516 | Position = property(GetPosition,doc="See `GetPosition`") | |
2131d850 | 5517 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d14a1e28 RD |
5518 | |
5519 | #--------------------------------------------------------------------------- | |
5520 | ||
54f9ee45 RD |
5521 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5522 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 5523 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
5524 | """ |
5525 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5526 | wxWidgets to give an application the chance to update various user | |
5527 | interface elements. | |
5528 | ||
5529 | Without update UI events, an application has to work hard to | |
5530 | check/uncheck, enable/disable, and set the text for elements such as | |
5531 | menu items and toolbar buttons. The code for doing this has to be | |
5532 | mixed up with the code that is invoked when an action is invoked for a | |
5533 | menu item or button. | |
5534 | ||
5535 | With update UI events, you define an event handler to look at the | |
5536 | state of the application and change UI elements accordingly. wxWidgets | |
5537 | will call your handler functions in idle time, so you don't have to | |
5538 | worry where to call this code. In addition to being a clearer and more | |
5539 | declarative method, it also means you don't have to worry whether | |
5540 | you're updating a toolbar or menubar identifier. The same handler can | |
5541 | update a menu item and toolbar button, if the ID values are the same. | |
5542 | ||
5543 | Instead of directly manipulating the menu or button, you call | |
5544 | functions in the event object, such as `Check`. wxWidgets will | |
5545 | determine whether such a call has been made, and which UI element to | |
5546 | update. | |
5547 | ||
5548 | These events will work for popup menus as well as menubars. Just | |
5549 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5550 | any UI events for the window that owns the menu. | |
5551 | ||
5552 | If you find that the overhead of UI update processing is affecting | |
5553 | your application, you can do one or both of the following: | |
5554 | ||
5555 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5556 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5557 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5558 | receive update events. No other windows will receive update | |
5559 | events. | |
5560 | ||
5561 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5562 | value to set the delay between updates. You may need to call | |
5563 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5564 | a dialog is about to be shown, in case the user sees a slight | |
5565 | delay before windows are updated. | |
5566 | ||
5567 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5568 | handler for a window does not affect this because the events are sent | |
5569 | from an internal idle handler. | |
5570 | ||
5571 | wxWidgets tries to optimize update events on some platforms. On | |
5572 | Windows and GTK+, events for menubar items are only sent when the menu | |
5573 | is about to be shown, and not in idle time. | |
5574 | ||
5575 | """ | |
0085ce49 RD |
5576 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5577 | __repr__ = _swig_repr | |
5578 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5579 | """ |
5580 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5581 | ||
5582 | Constructor | |
5583 | """ | |
0085ce49 | 5584 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
e811c8ce | 5585 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5586 | """ |
5587 | GetChecked(self) -> bool | |
5588 | ||
5589 | Returns ``True`` if the UI element should be checked. | |
5590 | """ | |
54f9ee45 | 5591 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
5592 | |
5593 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5594 | """ |
5595 | GetEnabled(self) -> bool | |
5596 | ||
5597 | Returns ``True`` if the UI element should be enabled. | |
5598 | """ | |
54f9ee45 | 5599 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce | 5600 | |
b1fcee84 RD |
5601 | def GetShown(*args, **kwargs): |
5602 | """ | |
5603 | GetShown(self) -> bool | |
5604 | ||
5605 | Returns ``True`` if the UI element should be shown. | |
5606 | """ | |
5607 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
5608 | ||
e811c8ce | 5609 | def GetText(*args, **kwargs): |
5ba5649b RD |
5610 | """ |
5611 | GetText(self) -> String | |
5612 | ||
5613 | Returns the text that should be set for the UI element. | |
5614 | """ | |
54f9ee45 | 5615 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
5616 | |
5617 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5618 | """ |
5619 | GetSetText(self) -> bool | |
5620 | ||
5621 | Returns ``True`` if the application has called `SetText`. For | |
5622 | wxWidgets internal use only. | |
5623 | """ | |
54f9ee45 | 5624 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
5625 | |
5626 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5627 | """ |
5628 | GetSetChecked(self) -> bool | |
5629 | ||
5630 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5631 | internal use only. | |
5632 | """ | |
54f9ee45 | 5633 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
5634 | |
5635 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5636 | """ |
5637 | GetSetEnabled(self) -> bool | |
5638 | ||
5639 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5640 | internal use only. | |
5641 | """ | |
54f9ee45 | 5642 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce | 5643 | |
b1fcee84 RD |
5644 | def GetSetShown(*args, **kwargs): |
5645 | """ | |
5646 | GetSetShown(self) -> bool | |
5647 | ||
5648 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
5649 | internal use only. | |
5650 | """ | |
5651 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
5652 | ||
e811c8ce | 5653 | def Check(*args, **kwargs): |
5ba5649b RD |
5654 | """ |
5655 | Check(self, bool check) | |
5656 | ||
5657 | Check or uncheck the UI element. | |
5658 | """ | |
54f9ee45 | 5659 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
5660 | |
5661 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5662 | """ |
5663 | Enable(self, bool enable) | |
5664 | ||
5665 | Enable or disable the UI element. | |
5666 | """ | |
54f9ee45 | 5667 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce | 5668 | |
b1fcee84 RD |
5669 | def Show(*args, **kwargs): |
5670 | """ | |
5671 | Show(self, bool show) | |
5672 | ||
5673 | Show or hide the UI element. | |
5674 | """ | |
5675 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
5676 | ||
e811c8ce | 5677 | def SetText(*args, **kwargs): |
5ba5649b RD |
5678 | """ |
5679 | SetText(self, String text) | |
5680 | ||
5681 | Sets the text for this UI element. | |
5682 | """ | |
54f9ee45 | 5683 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
5684 | |
5685 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5686 | """ |
5687 | SetUpdateInterval(long updateInterval) | |
5688 | ||
5689 | Sets the interval between updates in milliseconds. Set to -1 to | |
5690 | disable updates, or to 0 to update as frequently as possible. The | |
5691 | default is 0. | |
5692 | ||
5693 | Use this to reduce the overhead of UI update events if your | |
5694 | application has a lot of windows. If you set the value to -1 or | |
5695 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5696 | at appropriate points in your application, such as when a dialog is | |
5697 | about to be shown. | |
5698 | """ | |
54f9ee45 | 5699 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5700 | |
5701 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5702 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5703 | """ |
5704 | GetUpdateInterval() -> long | |
5705 | ||
5706 | Returns the current interval between updates in milliseconds. -1 | |
5707 | disables updates, 0 updates as frequently as possible. | |
5708 | """ | |
54f9ee45 | 5709 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5710 | |
5711 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5712 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5713 | """ |
5714 | CanUpdate(Window win) -> bool | |
5715 | ||
5716 | Returns ``True`` if it is appropriate to update (send UI update events | |
5717 | to) this window. | |
5718 | ||
5719 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5720 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5721 | events were last sent in idle time, and the update interval, to | |
5722 | determine whether events should be sent to this window now. By default | |
5723 | this will always return true because the update mode is initially | |
5724 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5725 | events will be sent as often as possible. You can reduce the frequency | |
5726 | that events are sent by changing the mode and/or setting an update | |
5727 | interval. | |
5728 | ||
5729 | """ | |
54f9ee45 | 5730 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
5731 | |
5732 | CanUpdate = staticmethod(CanUpdate) | |
5733 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5734 | """ |
5735 | ResetUpdateTime() | |
5736 | ||
5737 | Used internally to reset the last-updated time to the current time. It | |
5738 | is assumed that update events are normally sent in idle time, so this | |
5739 | is called at the end of idle processing. | |
5740 | """ | |
54f9ee45 | 5741 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
5742 | |
5743 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5744 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5745 | """ |
5746 | SetMode(int mode) | |
5747 | ||
5748 | Specify how wxWidgets will send update events: to all windows, or only | |
5749 | to those which specify that they will process the events. | |
5750 | ||
5751 | The mode may be one of the following values: | |
5752 | ||
5753 | ============================= ========================================== | |
5754 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5755 | is the default setting. | |
5756 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5757 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5758 | style set. | |
5759 | ============================= ========================================== | |
5760 | ||
5761 | """ | |
54f9ee45 | 5762 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
5763 | |
5764 | SetMode = staticmethod(SetMode) | |
5765 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5766 | """ |
5767 | GetMode() -> int | |
5768 | ||
5769 | Returns a value specifying how wxWidgets will send update events: to | |
5770 | all windows, or only to those which specify that they will process the | |
5771 | events. | |
5772 | """ | |
54f9ee45 | 5773 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
5774 | |
5775 | GetMode = staticmethod(GetMode) | |
2131d850 | 5776 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d14a1e28 | 5777 | |
e811c8ce | 5778 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
0085ce49 | 5779 | """ |
5ba5649b RD |
5780 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
5781 | ||
5782 | Sets the interval between updates in milliseconds. Set to -1 to | |
5783 | disable updates, or to 0 to update as frequently as possible. The | |
5784 | default is 0. | |
5785 | ||
5786 | Use this to reduce the overhead of UI update events if your | |
5787 | application has a lot of windows. If you set the value to -1 or | |
5788 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5789 | at appropriate points in your application, such as when a dialog is | |
5790 | about to be shown. | |
5791 | """ | |
0085ce49 | 5792 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 5793 | |
0085ce49 RD |
5794 | def UpdateUIEvent_GetUpdateInterval(*args): |
5795 | """ | |
5ba5649b RD |
5796 | UpdateUIEvent_GetUpdateInterval() -> long |
5797 | ||
5798 | Returns the current interval between updates in milliseconds. -1 | |
5799 | disables updates, 0 updates as frequently as possible. | |
5800 | """ | |
0085ce49 | 5801 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d14a1e28 | 5802 | |
e811c8ce | 5803 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
0085ce49 | 5804 | """ |
5ba5649b RD |
5805 | UpdateUIEvent_CanUpdate(Window win) -> bool |
5806 | ||
5807 | Returns ``True`` if it is appropriate to update (send UI update events | |
5808 | to) this window. | |
5809 | ||
5810 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5811 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5812 | events were last sent in idle time, and the update interval, to | |
5813 | determine whether events should be sent to this window now. By default | |
5814 | this will always return true because the update mode is initially | |
5815 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5816 | events will be sent as often as possible. You can reduce the frequency | |
5817 | that events are sent by changing the mode and/or setting an update | |
5818 | interval. | |
5819 | ||
5820 | """ | |
0085ce49 | 5821 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 5822 | |
0085ce49 RD |
5823 | def UpdateUIEvent_ResetUpdateTime(*args): |
5824 | """ | |
5ba5649b RD |
5825 | UpdateUIEvent_ResetUpdateTime() |
5826 | ||
5827 | Used internally to reset the last-updated time to the current time. It | |
5828 | is assumed that update events are normally sent in idle time, so this | |
5829 | is called at the end of idle processing. | |
5830 | """ | |
0085ce49 | 5831 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d14a1e28 | 5832 | |
e811c8ce | 5833 | def UpdateUIEvent_SetMode(*args, **kwargs): |
0085ce49 | 5834 | """ |
5ba5649b RD |
5835 | UpdateUIEvent_SetMode(int mode) |
5836 | ||
5837 | Specify how wxWidgets will send update events: to all windows, or only | |
5838 | to those which specify that they will process the events. | |
5839 | ||
5840 | The mode may be one of the following values: | |
5841 | ||
5842 | ============================= ========================================== | |
5843 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5844 | is the default setting. | |
5845 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5846 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5847 | style set. | |
5848 | ============================= ========================================== | |
5849 | ||
5850 | """ | |
0085ce49 | 5851 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 5852 | |
0085ce49 RD |
5853 | def UpdateUIEvent_GetMode(*args): |
5854 | """ | |
5ba5649b RD |
5855 | UpdateUIEvent_GetMode() -> int |
5856 | ||
5857 | Returns a value specifying how wxWidgets will send update events: to | |
5858 | all windows, or only to those which specify that they will process the | |
5859 | events. | |
5860 | """ | |
0085ce49 | 5861 | return _core_.UpdateUIEvent_GetMode(*args) |
d14a1e28 RD |
5862 | |
5863 | #--------------------------------------------------------------------------- | |
5864 | ||
5865 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
5866 | """ |
5867 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
5868 | when the user changes the colour settings using the control | |
5869 | panel. This is only applicable under Windows. | |
5870 | ||
5871 | The default event handler for this event propagates the event to child | |
5872 | windows, since Windows only sends the events to top-level windows. If | |
5873 | intercepting this event for a top-level window, remember to call | |
5874 | `Skip` so the the base class handler will still be executed, or to | |
5875 | pass the event on to the window's children explicitly. | |
5876 | ||
5877 | """ | |
0085ce49 RD |
5878 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5879 | __repr__ = _swig_repr | |
5880 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5881 | """ |
5882 | __init__(self) -> SysColourChangedEvent | |
5883 | ||
5884 | Constructor | |
5885 | """ | |
0085ce49 | 5886 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 5887 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d14a1e28 RD |
5888 | |
5889 | #--------------------------------------------------------------------------- | |
5890 | ||
5891 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
5892 | """ |
5893 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
5894 | a window that loses its mouse capture. This is called even if | |
5895 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
5896 | this event allows an application to cater for unexpected capture | |
5897 | releases which might otherwise confuse mouse handling code. | |
5898 | ||
5899 | This event is implemented under Windows only. | |
5900 | """ | |
0085ce49 RD |
5901 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5902 | __repr__ = _swig_repr | |
5903 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5904 | """ |
5905 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
5906 | ||
5907 | Constructor | |
5908 | """ | |
0085ce49 | 5909 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
e811c8ce | 5910 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
5911 | """ |
5912 | GetCapturedWindow(self) -> Window | |
5913 | ||
5914 | Returns the window that gained the capture, or ``None`` if it was a | |
5915 | non-wxWidgets window. | |
5916 | """ | |
54f9ee45 | 5917 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 5918 | |
2131d850 | 5919 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d14a1e28 RD |
5920 | |
5921 | #--------------------------------------------------------------------------- | |
5922 | ||
34e0a3bb RD |
5923 | class MouseCaptureLostEvent(Event): |
5924 | """ | |
5925 | A mouse capture lost event is sent to a window that obtained mouse | |
5926 | capture, which was subsequently loss due to "external" event, for | |
5927 | example when a dialog box is shown or if another application captures | |
5928 | the mouse. | |
5929 | ||
5930 | If this happens, this event is sent to all windows that are on the | |
5931 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
5932 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
5933 | if the capture changes because of a call to CaptureMouse or | |
5934 | ReleaseMouse. | |
5935 | ||
5936 | This event is currently emitted under Windows only. | |
5937 | ||
5938 | """ | |
5939 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5940 | __repr__ = _swig_repr | |
5941 | def __init__(self, *args, **kwargs): | |
5942 | """ | |
5943 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
5944 | ||
5945 | A mouse capture lost event is sent to a window that obtained mouse | |
5946 | capture, which was subsequently loss due to "external" event, for | |
5947 | example when a dialog box is shown or if another application captures | |
5948 | the mouse. | |
5949 | ||
5950 | If this happens, this event is sent to all windows that are on the | |
5951 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
5952 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
5953 | if the capture changes because of a call to CaptureMouse or | |
5954 | ReleaseMouse. | |
5955 | ||
5956 | This event is currently emitted under Windows only. | |
5957 | ||
5958 | """ | |
5959 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
5960 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
5961 | ||
5962 | #--------------------------------------------------------------------------- | |
5963 | ||
d14a1e28 | 5964 | class DisplayChangedEvent(Event): |
5ba5649b RD |
5965 | """ |
5966 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
5967 | resolution has changed. | |
5968 | ||
5969 | This event is implemented under Windows only. | |
5970 | """ | |
0085ce49 RD |
5971 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5972 | __repr__ = _swig_repr | |
5973 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5974 | """__init__(self) -> DisplayChangedEvent""" |
0085ce49 | 5975 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 5976 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d14a1e28 RD |
5977 | |
5978 | #--------------------------------------------------------------------------- | |
5979 | ||
5980 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
5981 | """ |
5982 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5983 | changed, thereby giving each window a chance to redo their own to | |
5984 | match. | |
5985 | ||
5986 | This event is implemented under Windows only. | |
5987 | """ | |
0085ce49 RD |
5988 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5989 | __repr__ = _swig_repr | |
5990 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5991 | """ |
5992 | __init__(self, int id=0) -> PaletteChangedEvent | |
5993 | ||
5994 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5995 | changed, thereby giving each window a chance to redo their own to | |
5996 | match. | |
5997 | ||
5998 | This event is implemented under Windows only. | |
5999 | """ | |
0085ce49 | 6000 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
e811c8ce | 6001 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 6002 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 6003 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
6004 | |
6005 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 6006 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 6007 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 6008 | |
2131d850 | 6009 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d14a1e28 RD |
6010 | |
6011 | #--------------------------------------------------------------------------- | |
6012 | ||
6013 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6014 | """ |
6015 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6016 | focus and should re-do its palette. | |
6017 | ||
6018 | This event is implemented under Windows only. | |
6019 | """ | |
0085ce49 RD |
6020 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6021 | __repr__ = _swig_repr | |
6022 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6023 | """ |
6024 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6025 | ||
6026 | Constructor. | |
6027 | """ | |
0085ce49 | 6028 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
e811c8ce | 6029 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6030 | """ |
6031 | SetPaletteRealized(self, bool realized) | |
6032 | ||
6033 | App should set this if it changes the palette. | |
6034 | """ | |
54f9ee45 | 6035 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
6036 | |
6037 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 6038 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 6039 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 6040 | |
2131d850 | 6041 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d14a1e28 RD |
6042 | |
6043 | #--------------------------------------------------------------------------- | |
6044 | ||
6045 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6046 | """ |
6047 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6048 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6049 | catch navigation events in applications as there are already | |
6050 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6051 | it useful to send navigation events in certain situations to change | |
6052 | the focus in certain ways, although it's probably easier to just call | |
6053 | `wx.Window.Navigate`. | |
6054 | """ | |
0085ce49 RD |
6055 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6056 | __repr__ = _swig_repr | |
6057 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6058 | """__init__(self) -> NavigationKeyEvent""" |
0085ce49 | 6059 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
e811c8ce | 6060 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6061 | """ |
6062 | GetDirection(self) -> bool | |
6063 | ||
6064 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6065 | """ | |
54f9ee45 | 6066 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
6067 | |
6068 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6069 | """ |
6070 | SetDirection(self, bool forward) | |
6071 | ||
6072 | Specify the direction that the navigation should take. Usually the | |
6073 | difference between using Tab and Shift-Tab. | |
6074 | """ | |
54f9ee45 | 6075 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
6076 | |
6077 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6078 | """ |
6079 | IsWindowChange(self) -> bool | |
6080 | ||
6081 | Returns ``True`` if window change is allowed. | |
6082 | """ | |
54f9ee45 | 6083 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
6084 | |
6085 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6086 | """ |
6087 | SetWindowChange(self, bool ischange) | |
6088 | ||
6089 | Specify if the navigation should be able to change parent windows. | |
6090 | For example, changing notebook pages, etc. This is usually implemented | |
6091 | by using Control-Tab. | |
6092 | """ | |
54f9ee45 | 6093 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 6094 | |
68350608 | 6095 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6096 | """ |
6097 | IsFromTab(self) -> bool | |
6098 | ||
6099 | Returns ``True`` if the navigation event is originated from the Tab | |
6100 | key. | |
6101 | """ | |
68350608 RD |
6102 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6103 | ||
6104 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6105 | """ |
6106 | SetFromTab(self, bool bIs) | |
6107 | ||
6108 | Set to true under MSW if the event was generated using the tab key. | |
6109 | This is required for proper navogation over radio buttons. | |
6110 | """ | |
68350608 RD |
6111 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6112 | ||
908b74cd | 6113 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6114 | """ |
6115 | SetFlags(self, long flags) | |
6116 | ||
6117 | Set the navigation flags to a combination of the following: | |
6118 | ||
6119 | * wx.NavigationKeyEvent.IsBackward | |
6120 | * wx.NavigationKeyEvent.IsForward | |
6121 | * wx.NavigationKeyEvent.WinChange | |
6122 | * wx.NavigationKeyEvent.FromTab | |
6123 | ||
6124 | """ | |
908b74cd RD |
6125 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6126 | ||
e811c8ce | 6127 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6128 | """ |
6129 | GetCurrentFocus(self) -> Window | |
6130 | ||
6131 | Returns the child window which currenty has the focus. May be | |
6132 | ``None``. | |
6133 | """ | |
54f9ee45 | 6134 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6135 | |
6136 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6137 | """ |
6138 | SetCurrentFocus(self, Window win) | |
6139 | ||
6140 | Set the window that has the focus. | |
6141 | """ | |
54f9ee45 | 6142 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6143 | |
b0f7404b | 6144 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6145 | IsForward = _core_.NavigationKeyEvent_IsForward |
6146 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6147 | FromTab = _core_.NavigationKeyEvent_FromTab |
2131d850 | 6148 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d14a1e28 RD |
6149 | |
6150 | #--------------------------------------------------------------------------- | |
6151 | ||
6152 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6153 | """ |
6154 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6155 | underlying GUI object) exists. | |
6156 | """ | |
0085ce49 RD |
6157 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6158 | __repr__ = _swig_repr | |
6159 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6160 | """ |
6161 | __init__(self, Window win=None) -> WindowCreateEvent | |
6162 | ||
6163 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6164 | underlying GUI object) exists. | |
6165 | """ | |
0085ce49 | 6166 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
e811c8ce | 6167 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6168 | """ |
6169 | GetWindow(self) -> Window | |
6170 | ||
6171 | Returns the window that this event refers to. | |
6172 | """ | |
54f9ee45 | 6173 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6174 | |
2131d850 | 6175 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d14a1e28 RD |
6176 | |
6177 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6178 | """ |
943e8dfd RD |
6179 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6180 | when the GUI window is destroyed. | |
6181 | ||
6182 | When a class derived from `wx.Window` is destroyed its destructor will | |
6183 | have already run by the time this event is sent. Therefore this event | |
6184 | will not usually be received at all by the window itself. Since it is | |
6185 | received after the destructor has run, an object should not try to | |
6186 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6187 | notification of the destruction of another window. | |
5ba5649b | 6188 | """ |
0085ce49 RD |
6189 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6190 | __repr__ = _swig_repr | |
6191 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6192 | """ |
6193 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6194 | ||
943e8dfd RD |
6195 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6196 | when the GUI window is destroyed. | |
6197 | ||
6198 | When a class derived from `wx.Window` is destroyed its destructor will | |
6199 | have already run by the time this event is sent. Therefore this event | |
6200 | will not usually be received at all by the window itself. Since it is | |
6201 | received after the destructor has run, an object should not try to | |
6202 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6203 | notification of the destruction of another window. | |
5ba5649b | 6204 | """ |
0085ce49 | 6205 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
e811c8ce | 6206 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6207 | """ |
6208 | GetWindow(self) -> Window | |
6209 | ||
6210 | Returns the window that this event refers to. | |
6211 | """ | |
54f9ee45 | 6212 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6213 | |
2131d850 | 6214 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d14a1e28 RD |
6215 | |
6216 | #--------------------------------------------------------------------------- | |
6217 | ||
6218 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6219 | """ |
6220 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6221 | give the application a chance to show a context (popup) menu. | |
6222 | """ | |
0085ce49 RD |
6223 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6224 | __repr__ = _swig_repr | |
6225 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6226 | """ |
2131d850 | 6227 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6228 | |
6229 | Constructor. | |
6230 | """ | |
0085ce49 | 6231 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
e811c8ce | 6232 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6233 | """ |
6234 | GetPosition(self) -> Point | |
6235 | ||
6236 | Returns the position (in screen coordinants) at which the menu should | |
6237 | be shown. | |
6238 | """ | |
54f9ee45 | 6239 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6240 | |
6241 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6242 | """ |
6243 | SetPosition(self, Point pos) | |
6244 | ||
6245 | Sets the position at which the menu should be shown. | |
6246 | """ | |
54f9ee45 | 6247 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6248 | |
2bf58437 | 6249 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
2131d850 | 6250 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d14a1e28 RD |
6251 | |
6252 | #--------------------------------------------------------------------------- | |
6253 | ||
54f9ee45 RD |
6254 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6255 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6256 | class IdleEvent(Event): |
5ba5649b RD |
6257 | """ |
6258 | This class is used for EVT_IDLE events, which are generated and sent | |
6259 | when the application *becomes* idle. In other words, the when the | |
6260 | event queue becomes empty then idle events are sent to all windows (by | |
6261 | default) and as long as none of them call `RequestMore` then there are | |
6262 | no more idle events until after the system event queue has some normal | |
6263 | events and then becomes empty again. | |
6264 | ||
6265 | By default, idle events are sent to all windows. If this is causing a | |
6266 | significant overhead in your application, you can call | |
6267 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6268 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6269 | which should receive idle events. Then idle events will only be sent | |
6270 | to those windows and not to any others. | |
6271 | """ | |
0085ce49 RD |
6272 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6273 | __repr__ = _swig_repr | |
6274 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6275 | """ |
6276 | __init__(self) -> IdleEvent | |
6277 | ||
6278 | Constructor | |
6279 | """ | |
0085ce49 | 6280 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
e811c8ce | 6281 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6282 | """ |
6283 | RequestMore(self, bool needMore=True) | |
6284 | ||
6285 | Tells wxWidgets that more processing is required. This function can be | |
6286 | called by an EVT_IDLE handler for a window to indicate that the | |
6287 | application should forward the EVT_IDLE event once more to the | |
6288 | application windows. If no window calls this function during its | |
6289 | EVT_IDLE handler, then the application will remain in a passive event | |
6290 | loop until a new event is posted to the application by the windowing | |
6291 | system. | |
6292 | """ | |
54f9ee45 | 6293 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6294 | |
6295 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6296 | """ |
6297 | MoreRequested(self) -> bool | |
6298 | ||
6299 | Returns ``True`` if the OnIdle function processing this event | |
6300 | requested more processing time. | |
6301 | """ | |
54f9ee45 | 6302 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6303 | |
6304 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6305 | """ |
6306 | SetMode(int mode) | |
6307 | ||
6308 | Static method for specifying how wxWidgets will send idle events: to | |
6309 | all windows, or only to those which specify that they will process the | |
6310 | events. | |
6311 | ||
6312 | The mode can be one of the following values: | |
6313 | ||
6314 | ========================= ======================================== | |
6315 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6316 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6317 | the wx.WS_EX_PROCESS_IDLE extra style | |
6318 | flag set. | |
6319 | ========================= ======================================== | |
6320 | ||
6321 | """ | |
54f9ee45 | 6322 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6323 | |
6324 | SetMode = staticmethod(SetMode) | |
6325 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6326 | """ |
6327 | GetMode() -> int | |
6328 | ||
6329 | Static method returning a value specifying how wxWidgets will send | |
6330 | idle events: to all windows, or only to those which specify that they | |
6331 | will process the events. | |
6332 | """ | |
54f9ee45 | 6333 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6334 | |
6335 | GetMode = staticmethod(GetMode) | |
6336 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6337 | """ |
6338 | CanSend(Window win) -> bool | |
6339 | ||
6340 | Returns ``True`` if it is appropriate to send idle events to this | |
6341 | window. | |
6342 | ||
6343 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6344 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6345 | events should be sent to this window now. By default this will always | |
6346 | return ``True`` because the update mode is initially | |
6347 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6348 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6349 | """ | |
54f9ee45 | 6350 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6351 | |
6352 | CanSend = staticmethod(CanSend) | |
2131d850 | 6353 | _core_.IdleEvent_swigregister(IdleEvent) |
d14a1e28 | 6354 | |
e811c8ce | 6355 | def IdleEvent_SetMode(*args, **kwargs): |
0085ce49 | 6356 | """ |
5ba5649b RD |
6357 | IdleEvent_SetMode(int mode) |
6358 | ||
6359 | Static method for specifying how wxWidgets will send idle events: to | |
6360 | all windows, or only to those which specify that they will process the | |
6361 | events. | |
6362 | ||
6363 | The mode can be one of the following values: | |
6364 | ||
6365 | ========================= ======================================== | |
6366 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6367 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6368 | the wx.WS_EX_PROCESS_IDLE extra style | |
6369 | flag set. | |
6370 | ========================= ======================================== | |
6371 | ||
6372 | """ | |
0085ce49 | 6373 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6374 | |
0085ce49 RD |
6375 | def IdleEvent_GetMode(*args): |
6376 | """ | |
5ba5649b RD |
6377 | IdleEvent_GetMode() -> int |
6378 | ||
6379 | Static method returning a value specifying how wxWidgets will send | |
6380 | idle events: to all windows, or only to those which specify that they | |
6381 | will process the events. | |
6382 | """ | |
0085ce49 | 6383 | return _core_.IdleEvent_GetMode(*args) |
d14a1e28 | 6384 | |
e811c8ce | 6385 | def IdleEvent_CanSend(*args, **kwargs): |
0085ce49 | 6386 | """ |
5ba5649b RD |
6387 | IdleEvent_CanSend(Window win) -> bool |
6388 | ||
6389 | Returns ``True`` if it is appropriate to send idle events to this | |
6390 | window. | |
6391 | ||
6392 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6393 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6394 | events should be sent to this window now. By default this will always | |
6395 | return ``True`` because the update mode is initially | |
6396 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6397 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6398 | """ | |
0085ce49 | 6399 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6400 | |
6401 | #--------------------------------------------------------------------------- | |
6402 | ||
2131d850 RD |
6403 | class ClipboardTextEvent(CommandEvent): |
6404 | """ | |
6405 | A Clipboard Text event is sent when a window intercepts a text | |
6406 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6407 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6408 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6409 | generated automatically for a Rich Edit text control. | |
6410 | """ | |
6411 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6412 | __repr__ = _swig_repr | |
6413 | def __init__(self, *args, **kwargs): | |
6414 | """ | |
6415 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6416 | ||
6417 | A Clipboard Text event is sent when a window intercepts a text | |
6418 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6419 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6420 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6421 | generated automatically for a Rich Edit text control. | |
6422 | """ | |
6423 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6424 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6425 | ||
6426 | #--------------------------------------------------------------------------- | |
6427 | ||
d14a1e28 | 6428 | class PyEvent(Event): |
5ba5649b RD |
6429 | """ |
6430 | wx.PyEvent can be used as a base class for implementing custom event | |
6431 | types in Python. You should derived from this class instead of | |
6432 | `wx.Event` because this class is Python-aware and is able to transport | |
6433 | its Python bits safely through the wxWidgets event system and have | |
6434 | them still be there when the event handler is invoked. | |
6435 | ||
6436 | :see: `wx.PyCommandEvent` | |
6437 | ||
6438 | """ | |
0085ce49 RD |
6439 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6440 | __repr__ = _swig_repr | |
6441 | def __init__(self, *args, **kwargs): | |
2131d850 | 6442 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
0085ce49 | 6443 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6444 | self._SetSelf(self) |
e811c8ce | 6445 | |
0085ce49 RD |
6446 | __swig_destroy__ = _core_.delete_PyEvent |
6447 | __del__ = lambda self : None; | |
5ba5649b RD |
6448 | def _SetSelf(*args, **kwargs): |
6449 | """_SetSelf(self, PyObject self)""" | |
6450 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6451 | |
5ba5649b RD |
6452 | def _GetSelf(*args, **kwargs): |
6453 | """_GetSelf(self) -> PyObject""" | |
6454 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6455 | |
2131d850 | 6456 | _core_.PyEvent_swigregister(PyEvent) |
d14a1e28 RD |
6457 | |
6458 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6459 | """ |
6460 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6461 | event types in Python, where the event shoudl travel up to parent | |
6462 | windows looking for a handler. You should derived from this class | |
6463 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6464 | able to transport its Python bits safely through the wxWidgets event | |
6465 | system and have them still be there when the event handler is invoked. | |
6466 | ||
6467 | :see: `wx.PyEvent` | |
6468 | ||
6469 | """ | |
0085ce49 RD |
6470 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6471 | __repr__ = _swig_repr | |
6472 | def __init__(self, *args, **kwargs): | |
2131d850 | 6473 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
0085ce49 | 6474 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 6475 | self._SetSelf(self) |
e811c8ce | 6476 | |
0085ce49 RD |
6477 | __swig_destroy__ = _core_.delete_PyCommandEvent |
6478 | __del__ = lambda self : None; | |
5ba5649b RD |
6479 | def _SetSelf(*args, **kwargs): |
6480 | """_SetSelf(self, PyObject self)""" | |
6481 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6482 | |
5ba5649b RD |
6483 | def _GetSelf(*args, **kwargs): |
6484 | """_GetSelf(self) -> PyObject""" | |
6485 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6486 | |
2131d850 | 6487 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d14a1e28 | 6488 | |
53aa7709 | 6489 | class DateEvent(CommandEvent): |
5ba5649b RD |
6490 | """ |
6491 | This event class holds information about a date change event and is | |
6492 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6493 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6494 | EVT_DATE_CHANGED. | |
6495 | """ | |
0085ce49 RD |
6496 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6497 | __repr__ = _swig_repr | |
6498 | def __init__(self, *args, **kwargs): | |
2131d850 | 6499 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
0085ce49 | 6500 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 6501 | def GetDate(*args, **kwargs): |
5ba5649b RD |
6502 | """ |
6503 | GetDate(self) -> DateTime | |
6504 | ||
6505 | Returns the date. | |
6506 | """ | |
53aa7709 RD |
6507 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6508 | ||
6509 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6510 | """ |
6511 | SetDate(self, DateTime date) | |
6512 | ||
6513 | Sets the date carried by the event, normally only used by the library | |
6514 | internally. | |
6515 | """ | |
53aa7709 RD |
6516 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6517 | ||
2bf58437 | 6518 | Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`") |
2131d850 | 6519 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 RD |
6520 | |
6521 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6522 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6523 | ||
d14a1e28 RD |
6524 | #--------------------------------------------------------------------------- |
6525 | ||
54f9ee45 RD |
6526 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6527 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6528 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6529 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6530 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6531 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 6532 | class PyApp(EvtHandler): |
66c033b4 RD |
6533 | """ |
6534 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6535 | `wx.App` class (or some other derived class) instead. | |
6536 | """ | |
0085ce49 RD |
6537 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6538 | __repr__ = _swig_repr | |
6539 | def __init__(self, *args, **kwargs): | |
98e665d3 | 6540 | """ |
a95a7133 | 6541 | __init__(self) -> PyApp |
98e665d3 RD |
6542 | |
6543 | Create a new application object, starting the bootstrap process. | |
6544 | """ | |
0085ce49 | 6545 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
70b7a5fe RD |
6546 | self._setCallbackInfo(self, PyApp, False) |
6547 | self._setOORInfo(self, False) | |
e811c8ce | 6548 | |
0085ce49 RD |
6549 | __swig_destroy__ = _core_.delete_PyApp |
6550 | __del__ = lambda self : None; | |
e811c8ce | 6551 | def _setCallbackInfo(*args, **kwargs): |
70b7a5fe | 6552 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
54f9ee45 | 6553 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
6554 | |
6555 | def GetAppName(*args, **kwargs): | |
0df68c9f | 6556 | """ |
a95a7133 | 6557 | GetAppName(self) -> String |
6c3b4aae | 6558 | |
0df68c9f RD |
6559 | Get the application name. |
6560 | """ | |
54f9ee45 | 6561 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
6562 | |
6563 | def SetAppName(*args, **kwargs): | |
0df68c9f | 6564 | """ |
a95a7133 | 6565 | SetAppName(self, String name) |
6c3b4aae | 6566 | |
66c033b4 RD |
6567 | Set the application name. This value may be used automatically by |
6568 | `wx.Config` and such. | |
0df68c9f | 6569 | """ |
54f9ee45 | 6570 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
6571 | |
6572 | def GetClassName(*args, **kwargs): | |
0df68c9f | 6573 | """ |
a95a7133 | 6574 | GetClassName(self) -> String |
e811c8ce | 6575 | |
0df68c9f RD |
6576 | Get the application's class name. |
6577 | """ | |
54f9ee45 | 6578 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
6579 | |
6580 | def SetClassName(*args, **kwargs): | |
0df68c9f | 6581 | """ |
a95a7133 | 6582 | SetClassName(self, String name) |
6c3b4aae | 6583 | |
66c033b4 RD |
6584 | Set the application's class name. This value may be used for |
6585 | X-resources if applicable for the platform | |
0df68c9f | 6586 | """ |
54f9ee45 | 6587 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
6588 | |
6589 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 6590 | """ |
a95a7133 | 6591 | GetVendorName(self) -> String |
6c3b4aae | 6592 | |
0df68c9f RD |
6593 | Get the application's vendor name. |
6594 | """ | |
54f9ee45 | 6595 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
6596 | |
6597 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 6598 | """ |
a95a7133 | 6599 | SetVendorName(self, String name) |
6c3b4aae | 6600 | |
66c033b4 RD |
6601 | Set the application's vendor name. This value may be used |
6602 | automatically by `wx.Config` and such. | |
0df68c9f | 6603 | """ |
54f9ee45 | 6604 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
6605 | |
6606 | def GetTraits(*args, **kwargs): | |
0df68c9f | 6607 | """ |
a95a7133 | 6608 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 6609 | |
66c033b4 RD |
6610 | Return (and create if necessary) the app traits object to which we |
6611 | delegate for everything which either should be configurable by the | |
6612 | user (then he can change the default behaviour simply by overriding | |
6613 | CreateTraits() and returning his own traits object) or which is | |
6614 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6615 | differences behind the common facade. | |
6616 | ||
6617 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 6618 | """ |
54f9ee45 | 6619 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
6620 | |
6621 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 6622 | """ |
a95a7133 | 6623 | ProcessPendingEvents(self) |
6c3b4aae | 6624 | |
66c033b4 RD |
6625 | Process all events in the Pending Events list -- it is necessary to |
6626 | call this function to process posted events. This normally happens | |
6627 | during each event loop iteration. | |
0df68c9f | 6628 | """ |
54f9ee45 | 6629 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
6630 | |
6631 | def Yield(*args, **kwargs): | |
0df68c9f | 6632 | """ |
a95a7133 | 6633 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6634 | |
66c033b4 RD |
6635 | Process all currently pending events right now, instead of waiting |
6636 | until return to the event loop. It is an error to call ``Yield`` | |
6637 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 6638 | |
66c033b4 | 6639 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
6640 | reentrancies (i.e. when called from an event handler it may |
6641 | result in calling the same event handler again), use with | |
6642 | extreme care or, better, don't use at all! | |
0df68c9f | 6643 | |
66c033b4 | 6644 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 6645 | |
0df68c9f | 6646 | """ |
54f9ee45 | 6647 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
6648 | |
6649 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 6650 | """ |
a95a7133 | 6651 | WakeUpIdle(self) |
6c3b4aae | 6652 | |
66c033b4 RD |
6653 | Make sure that idle events are sent again. |
6654 | :see: `wx.WakeUpIdle` | |
0df68c9f | 6655 | """ |
54f9ee45 | 6656 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 6657 | |
1fc3b23a RD |
6658 | def IsMainLoopRunning(*args, **kwargs): |
6659 | """ | |
6660 | IsMainLoopRunning() -> bool | |
6661 | ||
6662 | Returns True if we're running the main loop, i.e. if the events can | |
6663 | currently be dispatched. | |
6664 | """ | |
6665 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
6666 | ||
6667 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 6668 | def MainLoop(*args, **kwargs): |
0df68c9f | 6669 | """ |
a95a7133 | 6670 | MainLoop(self) -> int |
6c3b4aae | 6671 | |
66c033b4 RD |
6672 | Execute the main GUI loop, the function doesn't normally return until |
6673 | all top level windows have been closed and destroyed. | |
0df68c9f | 6674 | """ |
54f9ee45 | 6675 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
6676 | |
6677 | def Exit(*args, **kwargs): | |
0df68c9f | 6678 | """ |
a95a7133 | 6679 | Exit(self) |
6c3b4aae | 6680 | |
0df68c9f | 6681 | Exit the main loop thus terminating the application. |
66c033b4 | 6682 | :see: `wx.Exit` |
0df68c9f | 6683 | """ |
54f9ee45 | 6684 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce RD |
6685 | |
6686 | def ExitMainLoop(*args, **kwargs): | |
0df68c9f | 6687 | """ |
a95a7133 | 6688 | ExitMainLoop(self) |
6c3b4aae | 6689 | |
66c033b4 RD |
6690 | Exit the main GUI loop during the next iteration of the main |
6691 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 6692 | """ |
54f9ee45 | 6693 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
6694 | |
6695 | def Pending(*args, **kwargs): | |
0df68c9f | 6696 | """ |
a95a7133 | 6697 | Pending(self) -> bool |
6c3b4aae | 6698 | |
0df68c9f RD |
6699 | Returns True if there are unprocessed events in the event queue. |
6700 | """ | |
54f9ee45 | 6701 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
6702 | |
6703 | def Dispatch(*args, **kwargs): | |
0df68c9f | 6704 | """ |
a95a7133 | 6705 | Dispatch(self) -> bool |
6c3b4aae | 6706 | |
0df68c9f RD |
6707 | Process the first event in the event queue (blocks until an event |
6708 | appears if there are none currently) | |
6709 | """ | |
54f9ee45 | 6710 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
6711 | |
6712 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 6713 | """ |
a95a7133 | 6714 | ProcessIdle(self) -> bool |
6c3b4aae | 6715 | |
66c033b4 RD |
6716 | Called from the MainLoop when the application becomes idle (there are |
6717 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6718 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 6719 | """ |
54f9ee45 | 6720 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
6721 | |
6722 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 6723 | """ |
a95a7133 | 6724 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 6725 | |
66c033b4 RD |
6726 | Send idle event to window and all subwindows. Returns True if more |
6727 | idle time is requested. | |
0df68c9f | 6728 | """ |
54f9ee45 | 6729 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
6730 | |
6731 | def IsActive(*args, **kwargs): | |
0df68c9f | 6732 | """ |
a95a7133 | 6733 | IsActive(self) -> bool |
6c3b4aae | 6734 | |
0df68c9f RD |
6735 | Return True if our app has focus. |
6736 | """ | |
54f9ee45 | 6737 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
6738 | |
6739 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 6740 | """ |
a95a7133 | 6741 | SetTopWindow(self, Window win) |
6c3b4aae | 6742 | |
66c033b4 | 6743 | Set the *main* top level window |
0df68c9f | 6744 | """ |
54f9ee45 | 6745 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
6746 | |
6747 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 6748 | """ |
a95a7133 | 6749 | GetTopWindow(self) -> Window |
6c3b4aae | 6750 | |
66c033b4 RD |
6751 | Return the *main* top level window (if it hadn't been set previously |
6752 | with SetTopWindow(), will return just some top level window and, if | |
6753 | there not any, will return None) | |
0df68c9f | 6754 | """ |
54f9ee45 | 6755 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
6756 | |
6757 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6758 | """ |
a95a7133 | 6759 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 6760 | |
66c033b4 RD |
6761 | Control the exit behaviour: by default, the program will exit the main |
6762 | loop (and so, usually, terminate) when the last top-level program | |
6763 | window is deleted. Beware that if you disable this behaviour (with | |
6764 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
6765 | explicitly from somewhere. | |
0df68c9f | 6766 | """ |
54f9ee45 | 6767 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6768 | |
6769 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6770 | """ |
a95a7133 | 6771 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 6772 | |
0df68c9f RD |
6773 | Get the current exit behaviour setting. |
6774 | """ | |
54f9ee45 | 6775 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6776 | |
6777 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6778 | """ |
a95a7133 | 6779 | SetUseBestVisual(self, bool flag) |
6c3b4aae | 6780 | |
66c033b4 RD |
6781 | Set whether the app should try to use the best available visual on |
6782 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 6783 | """ |
54f9ee45 | 6784 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6785 | |
6786 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6787 | """ |
a95a7133 | 6788 | GetUseBestVisual(self) -> bool |
6c3b4aae | 6789 | |
0df68c9f RD |
6790 | Get current UseBestVisual setting. |
6791 | """ | |
54f9ee45 | 6792 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6793 | |
6794 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 6795 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 6796 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
6797 | |
6798 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 6799 | """GetPrintMode(self) -> int""" |
54f9ee45 | 6800 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 6801 | |
e811c8ce | 6802 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 6803 | """ |
a95a7133 | 6804 | SetAssertMode(self, int mode) |
6c3b4aae | 6805 | |
41e2b43e | 6806 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 6807 | """ |
54f9ee45 | 6808 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 6809 | |
6c3b4aae | 6810 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 6811 | """ |
a95a7133 | 6812 | GetAssertMode(self) -> int |
6c3b4aae | 6813 | |
0df68c9f RD |
6814 | Get the current OnAssert behaviour setting. |
6815 | """ | |
54f9ee45 | 6816 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 6817 | |
e811c8ce | 6818 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 6819 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 6820 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6821 | |
6822 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
6823 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6824 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 6825 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6826 | |
6827 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
6828 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6829 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 6830 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6831 | |
6832 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
6833 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6834 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 6835 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6836 | |
6837 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
6838 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6839 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 6840 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6841 | |
6842 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
6843 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 6844 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 6845 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6846 | |
6847 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
6848 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6849 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 6850 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6851 | |
6852 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
6853 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6854 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 6855 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6856 | |
6857 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
6858 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6859 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 6860 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6861 | |
6862 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
6863 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6864 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 6865 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6866 | |
6867 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
6868 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 6869 | """ |
a95a7133 | 6870 | _BootstrapApp(self) |
6c3b4aae | 6871 | |
0df68c9f RD |
6872 | For internal use only |
6873 | """ | |
54f9ee45 | 6874 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
6875 | |
6876 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 6877 | """ |
66c033b4 | 6878 | GetComCtl32Version() -> int |
6c3b4aae | 6879 | |
66c033b4 RD |
6880 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6881 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 6882 | """ |
54f9ee45 | 6883 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
6884 | |
6885 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
fc46b7f3 RD |
6886 | def DisplayAvailable(*args, **kwargs): |
6887 | """ | |
6888 | DisplayAvailable() -> bool | |
6889 | ||
6890 | Tests if it is possible to create a GUI in the current environment. | |
6891 | This will mean different things on the different platforms. | |
6892 | ||
6893 | * On X Windows systems this function will return ``False`` if it is | |
6894 | not able to open a connection to the X display, which can happen | |
6895 | if $DISPLAY is not set, or is not set correctly. | |
6896 | ||
6897 | * On Mac OS X a ``False`` return value will mean that wx is not | |
6898 | able to access the window manager, which can happen if logged in | |
6899 | remotely or if running from the normal version of python instead | |
6900 | of the framework version, (i.e., pythonw.) | |
6901 | ||
6902 | * On MS Windows... | |
6903 | ||
6904 | """ | |
6905 | return _core_.PyApp_DisplayAvailable(*args, **kwargs) | |
6906 | ||
6907 | DisplayAvailable = staticmethod(DisplayAvailable) | |
2131d850 | 6908 | _core_.PyApp_swigregister(PyApp) |
d14a1e28 | 6909 | |
0085ce49 RD |
6910 | def PyApp_IsMainLoopRunning(*args): |
6911 | """ | |
1fc3b23a RD |
6912 | PyApp_IsMainLoopRunning() -> bool |
6913 | ||
6914 | Returns True if we're running the main loop, i.e. if the events can | |
6915 | currently be dispatched. | |
6916 | """ | |
0085ce49 | 6917 | return _core_.PyApp_IsMainLoopRunning(*args) |
1fc3b23a | 6918 | |
0085ce49 RD |
6919 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
6920 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
6921 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d14a1e28 | 6922 | |
0085ce49 RD |
6923 | def PyApp_GetMacAboutMenuItemId(*args): |
6924 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
6925 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d14a1e28 | 6926 | |
0085ce49 RD |
6927 | def PyApp_GetMacPreferencesMenuItemId(*args): |
6928 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
6929 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d14a1e28 | 6930 | |
0085ce49 RD |
6931 | def PyApp_GetMacExitMenuItemId(*args): |
6932 | """PyApp_GetMacExitMenuItemId() -> long""" | |
6933 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d14a1e28 | 6934 | |
0085ce49 RD |
6935 | def PyApp_GetMacHelpMenuTitleName(*args): |
6936 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
6937 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d14a1e28 | 6938 | |
e811c8ce | 6939 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
0085ce49 RD |
6940 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
6941 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d14a1e28 | 6942 | |
e811c8ce | 6943 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
0085ce49 RD |
6944 | """PyApp_SetMacAboutMenuItemId(long val)""" |
6945 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d14a1e28 | 6946 | |
e811c8ce | 6947 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
0085ce49 RD |
6948 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
6949 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d14a1e28 | 6950 | |
e811c8ce | 6951 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
0085ce49 RD |
6952 | """PyApp_SetMacExitMenuItemId(long val)""" |
6953 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d14a1e28 | 6954 | |
e811c8ce | 6955 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
0085ce49 RD |
6956 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
6957 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d14a1e28 | 6958 | |
0085ce49 RD |
6959 | def PyApp_GetComCtl32Version(*args): |
6960 | """ | |
0df68c9f | 6961 | PyApp_GetComCtl32Version() -> int |
6c3b4aae | 6962 | |
66c033b4 RD |
6963 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6964 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 6965 | """ |
0085ce49 | 6966 | return _core_.PyApp_GetComCtl32Version(*args) |
d14a1e28 | 6967 | |
fc46b7f3 RD |
6968 | def PyApp_DisplayAvailable(*args): |
6969 | """ | |
6970 | PyApp_DisplayAvailable() -> bool | |
6971 | ||
6972 | Tests if it is possible to create a GUI in the current environment. | |
6973 | This will mean different things on the different platforms. | |
6974 | ||
6975 | * On X Windows systems this function will return ``False`` if it is | |
6976 | not able to open a connection to the X display, which can happen | |
6977 | if $DISPLAY is not set, or is not set correctly. | |
6978 | ||
6979 | * On Mac OS X a ``False`` return value will mean that wx is not | |
6980 | able to access the window manager, which can happen if logged in | |
6981 | remotely or if running from the normal version of python instead | |
6982 | of the framework version, (i.e., pythonw.) | |
6983 | ||
6984 | * On MS Windows... | |
6985 | ||
6986 | """ | |
6987 | return _core_.PyApp_DisplayAvailable(*args) | |
6988 | ||
d14a1e28 RD |
6989 | #--------------------------------------------------------------------------- |
6990 | ||
6991 | ||
0085ce49 RD |
6992 | def Exit(*args): |
6993 | """ | |
0df68c9f | 6994 | Exit() |
6c3b4aae | 6995 | |
0df68c9f RD |
6996 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
6997 | """ | |
0085ce49 | 6998 | return _core_.Exit(*args) |
d14a1e28 | 6999 | |
0085ce49 RD |
7000 | def Yield(*args): |
7001 | """ | |
0df68c9f | 7002 | Yield() -> bool |
6c3b4aae | 7003 | |
0df68c9f RD |
7004 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
7005 | """ | |
0085ce49 | 7006 | return _core_.Yield(*args) |
d14a1e28 | 7007 | |
0085ce49 RD |
7008 | def YieldIfNeeded(*args): |
7009 | """ | |
0df68c9f | 7010 | YieldIfNeeded() -> bool |
6c3b4aae | 7011 | |
0df68c9f RD |
7012 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
7013 | """ | |
0085ce49 | 7014 | return _core_.YieldIfNeeded(*args) |
d14a1e28 | 7015 | |
e811c8ce | 7016 | def SafeYield(*args, **kwargs): |
0085ce49 | 7017 | """ |
0df68c9f | 7018 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 7019 | |
66c033b4 RD |
7020 | This function is similar to `wx.Yield`, except that it disables the |
7021 | user input to all program windows before calling `wx.Yield` and | |
7022 | re-enables it again afterwards. If ``win`` is not None, this window | |
7023 | will remain enabled, allowing the implementation of some limited user | |
7024 | interaction. | |
6c3b4aae | 7025 | |
66c033b4 | 7026 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 7027 | """ |
0085ce49 | 7028 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 7029 | |
0085ce49 RD |
7030 | def WakeUpIdle(*args): |
7031 | """ | |
0df68c9f | 7032 | WakeUpIdle() |
6c3b4aae | 7033 | |
66c033b4 RD |
7034 | Cause the message queue to become empty again, so idle events will be |
7035 | sent. | |
0df68c9f | 7036 | """ |
0085ce49 | 7037 | return _core_.WakeUpIdle(*args) |
d14a1e28 | 7038 | |
e811c8ce | 7039 | def PostEvent(*args, **kwargs): |
0085ce49 | 7040 | """ |
0df68c9f | 7041 | PostEvent(EvtHandler dest, Event event) |
6c3b4aae | 7042 | |
66c033b4 RD |
7043 | Send an event to a window or other wx.EvtHandler to be processed |
7044 | later. | |
0df68c9f | 7045 | """ |
0085ce49 | 7046 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 7047 | |
0085ce49 RD |
7048 | def App_CleanUp(*args): |
7049 | """ | |
0df68c9f | 7050 | App_CleanUp() |
6c3b4aae | 7051 | |
41e2b43e | 7052 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 7053 | Python shuts down. |
0df68c9f | 7054 | """ |
0085ce49 | 7055 | return _core_.App_CleanUp(*args) |
d14a1e28 | 7056 | |
0085ce49 RD |
7057 | def GetApp(*args): |
7058 | """ | |
0df68c9f | 7059 | GetApp() -> PyApp |
6c3b4aae | 7060 | |
196addbf | 7061 | Return a reference to the current wx.App object. |
0df68c9f | 7062 | """ |
0085ce49 | 7063 | return _core_.GetApp(*args) |
5cbf236d RD |
7064 | |
7065 | def SetDefaultPyEncoding(*args, **kwargs): | |
0085ce49 | 7066 | """ |
5cbf236d RD |
7067 | SetDefaultPyEncoding(string encoding) |
7068 | ||
7069 | Sets the encoding that wxPython will use when it needs to convert a | |
7070 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
7071 | |
7072 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7073 | but please be aware that the default encoding within the same locale | |
7074 | may be slightly different on different platforms. For example, please | |
7075 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7076 | between the common latin/roman encodings. | |
5cbf236d | 7077 | """ |
0085ce49 | 7078 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7079 | |
0085ce49 RD |
7080 | def GetDefaultPyEncoding(*args): |
7081 | """ | |
5cbf236d RD |
7082 | GetDefaultPyEncoding() -> string |
7083 | ||
7084 | Gets the current encoding that wxPython will use when it needs to | |
7085 | convert a Python string or unicode object to or from a wxString. | |
7086 | """ | |
0085ce49 | 7087 | return _core_.GetDefaultPyEncoding(*args) |
d14a1e28 RD |
7088 | #---------------------------------------------------------------------- |
7089 | ||
7090 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
7091 | """ |
7092 | A class that can be used for redirecting Python's stdout and | |
7093 | stderr streams. It will do nothing until something is wrriten to | |
7094 | the stream at which point it will create a Frame with a text area | |
7095 | and write the text there. | |
7096 | """ | |
d14a1e28 RD |
7097 | def __init__(self, title = "wxPython: stdout/stderr"): |
7098 | self.frame = None | |
7099 | self.title = title | |
412d302d RD |
7100 | self.pos = wx.DefaultPosition |
7101 | self.size = (450, 300) | |
d14a1e28 RD |
7102 | self.parent = None |
7103 | ||
7104 | def SetParent(self, parent): | |
6c3b4aae | 7105 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
7106 | self.parent = parent |
7107 | ||
6c3b4aae RD |
7108 | |
7109 | def CreateOutputWindow(self, st): | |
412d302d RD |
7110 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7111 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 7112 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7113 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 7114 | self.text.AppendText(st) |
6c3b4aae | 7115 | self.frame.Show(True) |
2131d850 | 7116 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
6c3b4aae | 7117 | |
d14a1e28 | 7118 | |
7409c0c6 RD |
7119 | def OnCloseWindow(self, event): |
7120 | if self.frame is not None: | |
7121 | self.frame.Destroy() | |
7122 | self.frame = None | |
7123 | self.text = None | |
7124 | ||
7125 | ||
d14a1e28 | 7126 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
7127 | def write(self, text): |
7128 | """ | |
7129 | Create the output window if needed and write the string to it. | |
7130 | If not called in the context of the gui thread then uses | |
7131 | CallAfter to do the work there. | |
7132 | """ | |
7133 | if self.frame is None: | |
7134 | if not wx.Thread_IsMain(): | |
7135 | wx.CallAfter(self.CreateOutputWindow, text) | |
7136 | else: | |
7137 | self.CreateOutputWindow(text) | |
7138 | else: | |
7139 | if not wx.Thread_IsMain(): | |
7140 | wx.CallAfter(self.text.AppendText, text) | |
7141 | else: | |
7142 | self.text.AppendText(text) | |
7143 | ||
d14a1e28 RD |
7144 | |
7145 | def close(self): | |
6c3b4aae RD |
7146 | if self.frame is not None: |
7147 | wx.CallAfter(self.frame.Close) | |
7148 | ||
d14a1e28 | 7149 | |
19272049 RD |
7150 | def flush(self): |
7151 | pass | |
7152 | ||
7153 | ||
d14a1e28 RD |
7154 | |
7155 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
7156 | |
7157 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
fc46b7f3 | 7158 | |
d14a1e28 | 7159 | class App(wx.PyApp): |
6c3b4aae | 7160 | """ |
66c033b4 RD |
7161 | The ``wx.App`` class represents the application and is used to: |
7162 | ||
7163 | * bootstrap the wxPython system and initialize the underlying | |
7164 | gui toolkit | |
7165 | * set and get application-wide properties | |
7166 | * implement the windowing system main message or event loop, | |
7167 | and to dispatch events to window instances | |
7168 | * etc. | |
7169 | ||
7170 | Every application must have a ``wx.App`` instance, and all | |
7171 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
7172 | ``wx.App`` object has been created in order to ensure that the gui |
7173 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7174 | |
7175 | Normally you would derive from this class and implement an | |
7176 | ``OnInit`` method that creates a frame and then calls | |
7177 | ``self.SetTopWindow(frame)``. | |
7178 | ||
03e37cd5 | 7179 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7180 | directly. |
6c3b4aae | 7181 | """ |
66c033b4 | 7182 | |
d14a1e28 RD |
7183 | outputWindowClass = PyOnDemandOutputWindow |
7184 | ||
03e37cd5 RD |
7185 | def __init__(self, redirect=_defRedirect, filename=None, |
7186 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7187 | """ |
7188 | Construct a ``wx.App`` object. | |
7189 | ||
03e37cd5 RD |
7190 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7191 | redirected? Defaults to True on Windows and Mac, False | |
7192 | otherwise. If `filename` is None then output will be | |
7193 | redirected to a window that pops up as needed. (You can | |
7194 | control what kind of window is created for the output by | |
7195 | resetting the class variable ``outputWindowClass`` to a | |
7196 | class of your choosing.) | |
66c033b4 | 7197 | |
03e37cd5 RD |
7198 | :param filename: The name of a file to redirect output to, if |
7199 | redirect is True. | |
66c033b4 RD |
7200 | |
7201 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7202 | available visual provided by the system (only relevant on |
7203 | systems that have more than one visual.) This parameter | |
7204 | must be used instead of calling `SetUseBestVisual` later | |
7205 | on because it must be set before the underlying GUI | |
7206 | toolkit is initialized. | |
7207 | ||
7208 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7209 | app to terminate upon a Ctrl-C in the console like other | |
7210 | GUI apps will. | |
66c033b4 RD |
7211 | |
7212 | :note: You should override OnInit to do applicaition | |
7213 | initialization to ensure that the system, toolkit and | |
7214 | wxWidgets are fully initialized. | |
7215 | """ | |
fc46b7f3 | 7216 | |
d14a1e28 RD |
7217 | wx.PyApp.__init__(self) |
7218 | ||
fc46b7f3 RD |
7219 | # make sure we can create a GUI |
7220 | if not self.DisplayAvailable(): | |
7221 | ||
7222 | if wx.Platform == "__WXMAC__": | |
7223 | msg = """This program needs access to the screen. | |
7224 | Please run with 'pythonw', not 'python', and only when you are logged | |
7225 | in on the main display of your Mac.""" | |
7226 | ||
7227 | elif wx.Platform == "__WXGTK__": | |
7228 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
d14a1e28 | 7229 | |
fc46b7f3 RD |
7230 | else: |
7231 | msg = "Unable to create GUI" | |
7232 | # TODO: more description is needed for wxMSW... | |
7233 | ||
7234 | raise SystemExit(msg) | |
7235 | ||
d14a1e28 RD |
7236 | # This has to be done before OnInit |
7237 | self.SetUseBestVisual(useBestVisual) | |
7238 | ||
7239 | # Set the default handler for SIGINT. This fixes a problem | |
7240 | # where if Ctrl-C is pressed in the console that started this | |
7241 | # app then it will not appear to do anything, (not even send | |
7242 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7243 | # setting the default handler then the app will exit, as | |
7244 | # expected (depending on platform.) | |
03e37cd5 RD |
7245 | if clearSigInt: |
7246 | try: | |
7247 | import signal | |
7248 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7249 | except: | |
7250 | pass | |
d14a1e28 RD |
7251 | |
7252 | # Save and redirect the stdio to a window? | |
7253 | self.stdioWin = None | |
7254 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7255 | if redirect: | |
7256 | self.RedirectStdio(filename) | |
7257 | ||
8fb0e70a RD |
7258 | # Use Python's install prefix as the default |
7259 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7260 | ||
d14a1e28 RD |
7261 | # This finishes the initialization of wxWindows and then calls |
7262 | # the OnInit that should be present in the derived class | |
7263 | self._BootstrapApp() | |
7264 | ||
7265 | ||
01f6b6d3 RD |
7266 | def OnPreInit(self): |
7267 | """ | |
7268 | Things that must be done after _BootstrapApp has done its | |
7269 | thing, but would be nice if they were already done by the time | |
7270 | that OnInit is called. | |
7271 | """ | |
7272 | wx.StockGDI._initStockObjects() | |
7273 | ||
7274 | ||
02b455f2 RD |
7275 | def __del__(self, destroy=wx.PyApp.__del__): |
7276 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7277 | destroy(self) | |
d14a1e28 | 7278 | |
70b7a5fe RD |
7279 | def Destroy(self): |
7280 | wx.PyApp.Destroy(self) | |
7281 | self.thisown = 0 | |
d14a1e28 RD |
7282 | |
7283 | def SetTopWindow(self, frame): | |
1e0c8722 | 7284 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7285 | if self.stdioWin: |
7286 | self.stdioWin.SetParent(frame) | |
7287 | wx.PyApp.SetTopWindow(self, frame) | |
7288 | ||
7289 | ||
7290 | def MainLoop(self): | |
1e0c8722 | 7291 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7292 | wx.PyApp.MainLoop(self) |
7293 | self.RestoreStdio() | |
7294 | ||
7295 | ||
7409c0c6 | 7296 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7297 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7298 | if filename: |
7299 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7300 | else: | |
7301 | self.stdioWin = self.outputWindowClass() | |
7302 | _sys.stdout = _sys.stderr = self.stdioWin | |
7303 | ||
7304 | ||
7305 | def RestoreStdio(self): | |
02b455f2 RD |
7306 | try: |
7307 | _sys.stdout, _sys.stderr = self.saveStdio | |
7308 | except: | |
7309 | pass | |
d14a1e28 RD |
7310 | |
7311 | ||
412d302d RD |
7312 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7313 | """ | |
7314 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7315 | the stdio has been redirected. This should be called before |
7316 | any output would cause the output window to be created. | |
412d302d RD |
7317 | """ |
7318 | if self.stdioWin: | |
7319 | if title is not None: | |
7320 | self.stdioWin.title = title | |
7321 | if pos is not None: | |
7322 | self.stdioWin.pos = pos | |
7323 | if size is not None: | |
7324 | self.stdioWin.size = size | |
7325 | ||
7326 | ||
7327 | ||
d14a1e28 | 7328 | |
66c033b4 | 7329 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7330 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7331 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7332 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7333 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7334 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7335 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7336 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7337 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7338 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7339 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7340 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7341 | |
7342 | #---------------------------------------------------------------------------- | |
7343 | ||
7344 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7345 | """ |
7346 | A simple application class. You can just create one of these and | |
7347 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7348 | about OnInit. For example:: |
7349 | ||
7350 | app = wx.PySimpleApp() | |
7351 | frame = wx.Frame(None, title='Hello World') | |
7352 | frame.Show() | |
7353 | app.MainLoop() | |
7354 | ||
7355 | :see: `wx.App` | |
7356 | """ | |
6c3b4aae | 7357 | |
03e37cd5 RD |
7358 | def __init__(self, redirect=False, filename=None, |
7359 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7360 | """ |
7361 | :see: `wx.App.__init__` | |
7362 | """ | |
03e37cd5 | 7363 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7364 | |
d14a1e28 | 7365 | def OnInit(self): |
d14a1e28 RD |
7366 | return True |
7367 | ||
7368 | ||
66c033b4 | 7369 | |
6c3b4aae | 7370 | # Is anybody using this one? |
d14a1e28 RD |
7371 | class PyWidgetTester(wx.App): |
7372 | def __init__(self, size = (250, 100)): | |
7373 | self.size = size | |
7374 | wx.App.__init__(self, 0) | |
7375 | ||
7376 | def OnInit(self): | |
196addbf | 7377 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7378 | self.SetTopWindow(self.frame) |
7379 | return True | |
7380 | ||
66c033b4 RD |
7381 | def SetWidget(self, widgetClass, *args, **kwargs): |
7382 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7383 | self.frame.Show(True) |
7384 | ||
7385 | #---------------------------------------------------------------------------- | |
7386 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7387 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7388 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7389 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7390 | |
7391 | class __wxPyCleanup: | |
7392 | def __init__(self): | |
54f9ee45 | 7393 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7394 | def __del__(self): |
7395 | self.cleanup() | |
7396 | ||
7397 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7398 | ||
7399 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7400 | ## import atexit |
7401 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7402 | |
7403 | ||
7404 | #---------------------------------------------------------------------------- | |
7405 | ||
7406 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7407 | |
7408 | class EventLoop(object): | |
093d3ff1 | 7409 | """Proxy of C++ EventLoop class""" |
0085ce49 RD |
7410 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7411 | __repr__ = _swig_repr | |
7412 | def __init__(self, *args, **kwargs): | |
2ef75293 | 7413 | """__init__(self) -> EventLoop""" |
0085ce49 RD |
7414 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
7415 | __swig_destroy__ = _core_.delete_EventLoop | |
7416 | __del__ = lambda self : None; | |
2ef75293 RD |
7417 | def Run(*args, **kwargs): |
7418 | """Run(self) -> int""" | |
7419 | return _core_.EventLoop_Run(*args, **kwargs) | |
7420 | ||
7421 | def Exit(*args, **kwargs): | |
7422 | """Exit(self, int rc=0)""" | |
7423 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7424 | ||
7425 | def Pending(*args, **kwargs): | |
7426 | """Pending(self) -> bool""" | |
7427 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7428 | ||
7429 | def Dispatch(*args, **kwargs): | |
7430 | """Dispatch(self) -> bool""" | |
7431 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7432 | ||
7433 | def IsRunning(*args, **kwargs): | |
7434 | """IsRunning(self) -> bool""" | |
7435 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7436 | ||
7437 | def GetActive(*args, **kwargs): | |
7438 | """GetActive() -> EventLoop""" | |
7439 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7440 | ||
7441 | GetActive = staticmethod(GetActive) | |
7442 | def SetActive(*args, **kwargs): | |
7443 | """SetActive(EventLoop loop)""" | |
7444 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7445 | ||
7446 | SetActive = staticmethod(SetActive) | |
2131d850 | 7447 | _core_.EventLoop_swigregister(EventLoop) |
2ef75293 | 7448 | |
0085ce49 RD |
7449 | def EventLoop_GetActive(*args): |
7450 | """EventLoop_GetActive() -> EventLoop""" | |
7451 | return _core_.EventLoop_GetActive(*args) | |
2ef75293 RD |
7452 | |
7453 | def EventLoop_SetActive(*args, **kwargs): | |
0085ce49 RD |
7454 | """EventLoop_SetActive(EventLoop loop)""" |
7455 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
2ef75293 | 7456 | |
091f5bed RD |
7457 | class EventLoopActivator(object): |
7458 | """Proxy of C++ EventLoopActivator class""" | |
0085ce49 RD |
7459 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7460 | __repr__ = _swig_repr | |
7461 | def __init__(self, *args, **kwargs): | |
091f5bed | 7462 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
0085ce49 RD |
7463 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
7464 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7465 | __del__ = lambda self : None; | |
2131d850 | 7466 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
091f5bed | 7467 | |
2ef75293 | 7468 | #--------------------------------------------------------------------------- |
d14a1e28 | 7469 | |
eec1c382 RD |
7470 | ACCEL_ALT = _core_.ACCEL_ALT |
7471 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
7472 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
7473 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
7474 | ACCEL_CMD = _core_.ACCEL_CMD | |
1e0c8722 | 7475 | class AcceleratorEntry(object): |
66c033b4 RD |
7476 | """ |
7477 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7478 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7479 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 7480 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
7481 | |
7482 | :see: `wx.AcceleratorTable` | |
7483 | """ | |
0085ce49 RD |
7484 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7485 | __repr__ = _swig_repr | |
7486 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
7487 | """ |
7488 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7489 | ||
7490 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 7491 | """ |
0085ce49 RD |
7492 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
7493 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
7494 | __del__ = lambda self : None; | |
1e0c8722 | 7495 | def Set(*args, **kwargs): |
66c033b4 RD |
7496 | """ |
7497 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 7498 | |
66c033b4 RD |
7499 | (Re)set the attributes of a wx.AcceleratorEntry. |
7500 | :see `__init__` | |
7501 | """ | |
7502 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 RD |
7503 | |
7504 | def GetFlags(*args, **kwargs): | |
66c033b4 RD |
7505 | """ |
7506 | GetFlags(self) -> int | |
7507 | ||
7508 | Get the AcceleratorEntry's flags. | |
7509 | """ | |
54f9ee45 | 7510 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
7511 | |
7512 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
7513 | """ |
7514 | GetKeyCode(self) -> int | |
7515 | ||
7516 | Get the AcceleratorEntry's keycode. | |
7517 | """ | |
54f9ee45 | 7518 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
7519 | |
7520 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
7521 | """ |
7522 | GetCommand(self) -> int | |
7523 | ||
7524 | Get the AcceleratorEntry's command ID. | |
7525 | """ | |
54f9ee45 | 7526 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 | 7527 | |
2bf58437 RD |
7528 | Command = property(GetCommand,doc="See `GetCommand`") |
7529 | Flags = property(GetFlags,doc="See `GetFlags`") | |
7530 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
2131d850 | 7531 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
1e0c8722 RD |
7532 | |
7533 | class AcceleratorTable(Object): | |
66c033b4 RD |
7534 | """ |
7535 | An accelerator table allows the application to specify a table of | |
7536 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7537 | button commands are supported; on GTK, only menu commands are | |
7538 | supported. | |
66c033b4 | 7539 | """ |
0085ce49 RD |
7540 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7541 | __repr__ = _swig_repr | |
7542 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
7543 | """ |
7544 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 7545 | |
66c033b4 RD |
7546 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7547 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7548 | ||
7549 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 7550 | """ |
0085ce49 RD |
7551 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
7552 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
7553 | __del__ = lambda self : None; | |
1e0c8722 | 7554 | def Ok(*args, **kwargs): |
a95a7133 | 7555 | """Ok(self) -> bool""" |
54f9ee45 | 7556 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
1e0c8722 | 7557 | |
2131d850 | 7558 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
1e0c8722 RD |
7559 | |
7560 | ||
7561 | def GetAccelFromString(*args, **kwargs): | |
0085ce49 RD |
7562 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
7563 | return _core_.GetAccelFromString(*args, **kwargs) | |
1e0c8722 RD |
7564 | #--------------------------------------------------------------------------- |
7565 | ||
74a57fcd RD |
7566 | class VisualAttributes(object): |
7567 | """struct containing all the visual attributes of a control""" | |
0085ce49 RD |
7568 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7569 | __repr__ = _swig_repr | |
7570 | def __init__(self, *args, **kwargs): | |
74a57fcd | 7571 | """ |
a95a7133 | 7572 | __init__(self) -> VisualAttributes |
74a57fcd RD |
7573 | |
7574 | struct containing all the visual attributes of a control | |
7575 | """ | |
0085ce49 RD |
7576 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
7577 | __swig_destroy__ = _core_.delete_VisualAttributes | |
7578 | __del__ = lambda self : None; | |
54f9ee45 RD |
7579 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7580 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7581 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
2131d850 | 7582 | _core_.VisualAttributes_swigregister(VisualAttributes) |
74a57fcd RD |
7583 | NullAcceleratorTable = cvar.NullAcceleratorTable |
7584 | PanelNameStr = cvar.PanelNameStr | |
7585 | ||
54f9ee45 RD |
7586 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7587 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7588 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7589 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7590 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 7591 | class Window(EvtHandler): |
15afbcd0 RD |
7592 | """ |
7593 | wx.Window is the base class for all windows and represents any visible | |
7594 | object on the screen. All controls, top level windows and so on are | |
7595 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7596 | appear on screen themselves. | |
7597 | ||
7598 | """ | |
0085ce49 RD |
7599 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7600 | __repr__ = _swig_repr | |
7601 | def __init__(self, *args, **kwargs): | |
0df68c9f | 7602 | """ |
a95a7133 | 7603 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7604 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
7605 | |
7606 | Construct and show a generic Window. | |
0df68c9f | 7607 | """ |
0085ce49 | 7608 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d14a1e28 | 7609 | self._setOORInfo(self) |
d14a1e28 | 7610 | |
e811c8ce | 7611 | def Create(*args, **kwargs): |
0df68c9f | 7612 | """ |
a95a7133 | 7613 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7614 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
7615 | |
7616 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 7617 | """ |
54f9ee45 | 7618 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 7619 | |
e811c8ce | 7620 | def Close(*args, **kwargs): |
15afbcd0 | 7621 | """ |
a95a7133 | 7622 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
7623 | |
7624 | This function simply generates a EVT_CLOSE event whose handler usually | |
7625 | tries to close the window. It doesn't close the window itself, | |
7626 | however. If force is False (the default) then the window's close | |
7627 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 7628 | """ |
54f9ee45 | 7629 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 7630 | |
e811c8ce | 7631 | def Destroy(*args, **kwargs): |
0df68c9f | 7632 | """ |
a95a7133 | 7633 | Destroy(self) -> bool |
d14a1e28 | 7634 | |
15afbcd0 RD |
7635 | Destroys the window safely. Frames and dialogs are not destroyed |
7636 | immediately when this function is called -- they are added to a list | |
7637 | of windows to be deleted on idle time, when all the window's events | |
7638 | have been processed. This prevents problems with events being sent to | |
7639 | non-existent windows. | |
7640 | ||
7641 | Returns True if the window has either been successfully deleted, or it | |
7642 | has been added to the list of windows pending real deletion. | |
0df68c9f | 7643 | """ |
7e08d4ef RD |
7644 | val = _core_.Window_Destroy(*args, **kwargs) |
7645 | args[0].thisown = 0 | |
7646 | return val | |
d14a1e28 | 7647 | |
e811c8ce | 7648 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 7649 | """ |
a95a7133 | 7650 | DestroyChildren(self) -> bool |
15afbcd0 | 7651 | |
41e2b43e RD |
7652 | Destroys all children of a window. Called automatically by the |
7653 | destructor. | |
15afbcd0 | 7654 | """ |
54f9ee45 | 7655 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 7656 | |
e811c8ce | 7657 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 7658 | """ |
a95a7133 | 7659 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
7660 | |
7661 | Is the window in the process of being deleted? | |
7662 | """ | |
54f9ee45 | 7663 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 7664 | |
e811c8ce | 7665 | def SetLabel(*args, **kwargs): |
15afbcd0 | 7666 | """ |
a95a7133 | 7667 | SetLabel(self, String label) |
15afbcd0 RD |
7668 | |
7669 | Set the text which the window shows in its label if applicable. | |
7670 | """ | |
54f9ee45 | 7671 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 7672 | |
e811c8ce | 7673 | def GetLabel(*args, **kwargs): |
15afbcd0 | 7674 | """ |
a95a7133 | 7675 | GetLabel(self) -> String |
15afbcd0 | 7676 | |
41e2b43e RD |
7677 | Generic way of getting a label from any window, for identification |
7678 | purposes. The interpretation of this function differs from class to | |
7679 | class. For frames and dialogs, the value returned is the title. For | |
7680 | buttons or static text controls, it is the button text. This function | |
7681 | can be useful for meta-programs such as testing tools or special-needs | |
7682 | access programs)which need to identify windows by name. | |
15afbcd0 | 7683 | """ |
54f9ee45 | 7684 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 7685 | |
e811c8ce | 7686 | def SetName(*args, **kwargs): |
15afbcd0 | 7687 | """ |
a95a7133 | 7688 | SetName(self, String name) |
15afbcd0 | 7689 | |
41e2b43e RD |
7690 | Sets the window's name. The window name is used for ressource setting |
7691 | in X, it is not the same as the window title/label | |
15afbcd0 | 7692 | """ |
54f9ee45 | 7693 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 7694 | |
e811c8ce | 7695 | def GetName(*args, **kwargs): |
15afbcd0 | 7696 | """ |
a95a7133 | 7697 | GetName(self) -> String |
15afbcd0 | 7698 | |
41e2b43e RD |
7699 | Returns the windows name. This name is not guaranteed to be unique; |
7700 | it is up to the programmer to supply an appropriate name in the window | |
7701 | constructor or via wx.Window.SetName. | |
15afbcd0 | 7702 | """ |
54f9ee45 | 7703 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 7704 | |
4276dc52 RD |
7705 | def SetWindowVariant(*args, **kwargs): |
7706 | """ | |
a95a7133 | 7707 | SetWindowVariant(self, int variant) |
4276dc52 | 7708 | |
41e2b43e RD |
7709 | Sets the variant of the window/font size to use for this window, if |
7710 | the platform supports variants, for example, wxMac. | |
4276dc52 | 7711 | """ |
54f9ee45 | 7712 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
7713 | |
7714 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 7715 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 7716 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 7717 | |
e811c8ce | 7718 | def SetId(*args, **kwargs): |
15afbcd0 | 7719 | """ |
a95a7133 | 7720 | SetId(self, int winid) |
15afbcd0 RD |
7721 | |
7722 | Sets the identifier of the window. Each window has an integer | |
7723 | identifier. If the application has not provided one, an identifier | |
7724 | will be generated. Normally, the identifier should be provided on | |
7725 | creation and should not be modified subsequently. | |
7726 | """ | |
54f9ee45 | 7727 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 7728 | |
e811c8ce | 7729 | def GetId(*args, **kwargs): |
15afbcd0 | 7730 | """ |
a95a7133 | 7731 | GetId(self) -> int |
15afbcd0 RD |
7732 | |
7733 | Returns the identifier of the window. Each window has an integer | |
7734 | identifier. If the application has not provided one (or the default Id | |
7735 | -1 is used) then an unique identifier with a negative value will be | |
7736 | generated. | |
7737 | """ | |
54f9ee45 | 7738 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 7739 | |
e811c8ce | 7740 | def NewControlId(*args, **kwargs): |
15afbcd0 | 7741 | """ |
66c033b4 | 7742 | NewControlId() -> int |
15afbcd0 RD |
7743 | |
7744 | Generate a control id for the controls which were not given one. | |
7745 | """ | |
54f9ee45 | 7746 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 7747 | |
e811c8ce RD |
7748 | NewControlId = staticmethod(NewControlId) |
7749 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 7750 | """ |
66c033b4 | 7751 | NextControlId(int winid) -> int |
15afbcd0 RD |
7752 | |
7753 | Get the id of the control following the one with the given | |
41e2b43e | 7754 | autogenerated) id |
15afbcd0 | 7755 | """ |
54f9ee45 | 7756 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 7757 | |
e811c8ce RD |
7758 | NextControlId = staticmethod(NextControlId) |
7759 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 7760 | """ |
66c033b4 | 7761 | PrevControlId(int winid) -> int |
15afbcd0 RD |
7762 | |
7763 | Get the id of the control preceding the one with the given | |
41e2b43e | 7764 | autogenerated) id |
15afbcd0 | 7765 | """ |
54f9ee45 | 7766 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 7767 | |
e811c8ce RD |
7768 | PrevControlId = staticmethod(PrevControlId) |
7769 | def SetSize(*args, **kwargs): | |
15afbcd0 | 7770 | """ |
a95a7133 | 7771 | SetSize(self, Size size) |
15afbcd0 RD |
7772 | |
7773 | Sets the size of the window in pixels. | |
7774 | """ | |
54f9ee45 | 7775 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 7776 | |
e811c8ce | 7777 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 7778 | """ |
a95a7133 | 7779 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7780 | |
7781 | Sets the position and size of the window in pixels. The sizeFlags | |
7782 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
7783 | equal to -1. |
7784 | ||
7785 | ======================== ====================================== | |
7786 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
7787 | default should be used. | |
7788 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
7789 | -1 values are supplied. | |
7790 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
7791 | interpreted as real dimensions, not | |
7792 | default values. | |
7793 | ======================== ====================================== | |
7794 | ||
15afbcd0 | 7795 | """ |
54f9ee45 | 7796 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 7797 | |
e811c8ce | 7798 | def SetRect(*args, **kwargs): |
15afbcd0 | 7799 | """ |
a95a7133 | 7800 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7801 | |
7802 | Sets the position and size of the window in pixels using a wx.Rect. | |
7803 | """ | |
54f9ee45 | 7804 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 7805 | |
e811c8ce | 7806 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 7807 | """ |
a95a7133 | 7808 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
7809 | |
7810 | Sets the size of the window in pixels. | |
7811 | """ | |
54f9ee45 | 7812 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 7813 | |
e811c8ce | 7814 | def Move(*args, **kwargs): |
15afbcd0 | 7815 | """ |
a95a7133 | 7816 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
7817 | |
7818 | Moves the window to the given position. | |
7819 | """ | |
54f9ee45 | 7820 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 7821 | |
e811c8ce RD |
7822 | SetPosition = Move |
7823 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 7824 | """ |
a95a7133 | 7825 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
7826 | |
7827 | Moves the window to the given position. | |
7828 | """ | |
54f9ee45 | 7829 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 7830 | |
f8167d6e RD |
7831 | def SetBestFittingSize(*args, **kwargs): |
7832 | """ | |
7833 | SetBestFittingSize(self, Size size=DefaultSize) | |
7834 | ||
7835 | A 'Smart' SetSize that will fill in default size components with the | |
7836 | window's *best size* values. Also set's the minsize for use with sizers. | |
7837 | """ | |
7838 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
7839 | ||
e811c8ce | 7840 | def Raise(*args, **kwargs): |
15afbcd0 | 7841 | """ |
a95a7133 | 7842 | Raise(self) |
15afbcd0 | 7843 | |
943e8dfd RD |
7844 | Raises the window to the top of the window hierarchy. In current |
7845 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 7846 | """ |
54f9ee45 | 7847 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
7848 | |
7849 | def Lower(*args, **kwargs): | |
15afbcd0 | 7850 | """ |
a95a7133 | 7851 | Lower(self) |
15afbcd0 | 7852 | |
943e8dfd RD |
7853 | Lowers the window to the bottom of the window hierarchy. In current |
7854 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 7855 | """ |
54f9ee45 | 7856 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
7857 | |
7858 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 7859 | """ |
a95a7133 | 7860 | SetClientSize(self, Size size) |
15afbcd0 RD |
7861 | |
7862 | This sets the size of the window client area in pixels. Using this | |
7863 | function to size a window tends to be more device-independent than | |
7864 | wx.Window.SetSize, since the application need not worry about what | |
7865 | dimensions the border or title bar have when trying to fit the window | |
7866 | around panel items, for example. | |
7867 | """ | |
54f9ee45 | 7868 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
7869 | |
7870 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 7871 | """ |
a95a7133 | 7872 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
7873 | |
7874 | This sets the size of the window client area in pixels. Using this | |
7875 | function to size a window tends to be more device-independent than | |
7876 | wx.Window.SetSize, since the application need not worry about what | |
7877 | dimensions the border or title bar have when trying to fit the window | |
7878 | around panel items, for example. | |
7879 | """ | |
54f9ee45 | 7880 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
7881 | |
7882 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 7883 | """ |
a95a7133 | 7884 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
7885 | |
7886 | This sets the size of the window client area in pixels. Using this | |
7887 | function to size a window tends to be more device-independent than | |
7888 | wx.Window.SetSize, since the application need not worry about what | |
7889 | dimensions the border or title bar have when trying to fit the window | |
7890 | around panel items, for example. | |
7891 | """ | |
54f9ee45 | 7892 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
7893 | |
7894 | def GetPosition(*args, **kwargs): | |
0df68c9f | 7895 | """ |
a95a7133 | 7896 | GetPosition(self) -> Point |
e811c8ce | 7897 | |
75219dcb RD |
7898 | Get the window's position. Notice that the position is in client |
7899 | coordinates for child windows and screen coordinates for the top level | |
7900 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7901 | kinds of windows. | |
0df68c9f | 7902 | """ |
54f9ee45 | 7903 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
7904 | |
7905 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
7906 | """ |
7907 | GetPositionTuple() -> (x,y) | |
e811c8ce | 7908 | |
75219dcb RD |
7909 | Get the window's position. Notice that the position is in client |
7910 | coordinates for child windows and screen coordinates for the top level | |
7911 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7912 | kinds of windows. | |
0df68c9f | 7913 | """ |
54f9ee45 | 7914 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce | 7915 | |
75219dcb RD |
7916 | def GetScreenPosition(*args, **kwargs): |
7917 | """ | |
7918 | GetScreenPosition(self) -> Point | |
7919 | ||
7920 | Get the position of the window in screen coordinantes. | |
7921 | """ | |
7922 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
7923 | ||
7924 | def GetScreenPositionTuple(*args, **kwargs): | |
7925 | """ | |
7926 | GetScreenPositionTuple() -> (x,y) | |
7927 | ||
7928 | Get the position of the window in screen coordinantes. | |
7929 | """ | |
7930 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
7931 | ||
7932 | def GetScreenRect(*args, **kwargs): | |
7933 | """ | |
7934 | GetScreenRect(self) -> Rect | |
7935 | ||
7936 | Returns the size and position of the window in screen coordinantes as | |
7937 | a `wx.Rect` object. | |
7938 | """ | |
7939 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
7940 | ||
e811c8ce | 7941 | def GetSize(*args, **kwargs): |
0df68c9f | 7942 | """ |
a95a7133 | 7943 | GetSize(self) -> Size |
e811c8ce | 7944 | |
0df68c9f RD |
7945 | Get the window size. |
7946 | """ | |
54f9ee45 | 7947 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
7948 | |
7949 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
7950 | """ |
7951 | GetSizeTuple() -> (width, height) | |
e811c8ce | 7952 | |
0df68c9f RD |
7953 | Get the window size. |
7954 | """ | |
54f9ee45 | 7955 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
7956 | |
7957 | def GetRect(*args, **kwargs): | |
15afbcd0 | 7958 | """ |
a95a7133 | 7959 | GetRect(self) -> Rect |
15afbcd0 | 7960 | |
75219dcb | 7961 | Returns the size and position of the window as a `wx.Rect` object. |
15afbcd0 | 7962 | """ |
54f9ee45 | 7963 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
7964 | |
7965 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 7966 | """ |
a95a7133 | 7967 | GetClientSize(self) -> Size |
e811c8ce | 7968 | |
15afbcd0 RD |
7969 | This gets the size of the window's 'client area' in pixels. The client |
7970 | area is the area which may be drawn on by the programmer, excluding | |
7971 | title bar, border, scrollbars, etc. | |
0df68c9f | 7972 | """ |
54f9ee45 | 7973 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
7974 | |
7975 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
7976 | """ |
7977 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 7978 | |
15afbcd0 RD |
7979 | This gets the size of the window's 'client area' in pixels. The client |
7980 | area is the area which may be drawn on by the programmer, excluding | |
7981 | title bar, border, scrollbars, etc. | |
0df68c9f | 7982 | """ |
54f9ee45 | 7983 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
7984 | |
7985 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 7986 | """ |
a95a7133 | 7987 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
7988 | |
7989 | Get the origin of the client area of the window relative to the | |
7990 | window's top left corner (the client area may be shifted because of | |
7991 | the borders, scrollbars, other decorations...) | |
7992 | """ | |
54f9ee45 | 7993 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
7994 | |
7995 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 7996 | """ |
a95a7133 | 7997 | GetClientRect(self) -> Rect |
15afbcd0 | 7998 | |
61863841 | 7999 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 8000 | """ |
54f9ee45 | 8001 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
8002 | |
8003 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 8004 | """ |
a95a7133 | 8005 | GetBestSize(self) -> Size |
e811c8ce | 8006 | |
248ed943 | 8007 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8008 | window, if applicable. For example, for a static text control, it will |
8009 | be the minimal size such that the control label is not truncated. For | |
8010 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8011 | this function will be the same as the size the window would have had | |
8012 | after calling Fit. | |
0df68c9f | 8013 | """ |
54f9ee45 | 8014 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
8015 | |
8016 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8017 | """ |
8018 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 8019 | |
248ed943 | 8020 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8021 | window, if applicable. For example, for a static text control, it will |
8022 | be the minimal size such that the control label is not truncated. For | |
8023 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8024 | this function will be the same as the size the window would have had | |
8025 | after calling Fit. | |
0df68c9f | 8026 | """ |
54f9ee45 | 8027 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 8028 | |
dfbb5885 RD |
8029 | def InvalidateBestSize(*args, **kwargs): |
8030 | """ | |
8031 | InvalidateBestSize(self) | |
8032 | ||
8033 | Reset the cached best size value so it will be recalculated the next | |
8034 | time it is needed. | |
8035 | """ | |
8036 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8037 | ||
e2813725 RD |
8038 | def CacheBestSize(*args, **kwargs): |
8039 | """ | |
8040 | CacheBestSize(self, Size size) | |
8041 | ||
8042 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8043 | some properties of the window change.) | |
8044 | """ | |
8045 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8046 | ||
dfbb5885 RD |
8047 | def GetBestFittingSize(*args, **kwargs): |
8048 | """ | |
8049 | GetBestFittingSize(self) -> Size | |
8050 | ||
8051 | This function will merge the window's best size into the window's | |
8052 | minimum size, giving priority to the min size components, and returns | |
8053 | the results. | |
8054 | ||
8055 | """ | |
8056 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
8057 | ||
e811c8ce | 8058 | def GetAdjustedBestSize(*args, **kwargs): |
15afbcd0 | 8059 | """ |
a95a7133 | 8060 | GetAdjustedBestSize(self) -> Size |
15afbcd0 RD |
8061 | |
8062 | This method is similar to GetBestSize, except in one | |
8063 | thing. GetBestSize should return the minimum untruncated size of the | |
8064 | window, while this method will return the largest of BestSize and any | |
8065 | user specified minimum size. ie. it is the minimum size the window | |
8066 | should currently be drawn at, not the minimal size it can possibly | |
8067 | tolerate. | |
8068 | """ | |
54f9ee45 | 8069 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
e811c8ce RD |
8070 | |
8071 | def Center(*args, **kwargs): | |
15afbcd0 | 8072 | """ |
a95a7133 | 8073 | Center(self, int direction=BOTH) |
15afbcd0 RD |
8074 | |
8075 | Centers the window. The parameter specifies the direction for | |
8076 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8077 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8078 | on the entire screen and not on its parent window. If it is a | |
8079 | top-level window and has no parent then it will always be centered | |
8080 | relative to the screen. | |
8081 | """ | |
54f9ee45 | 8082 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
8083 | |
8084 | Centre = Center | |
e811c8ce | 8085 | def CenterOnParent(*args, **kwargs): |
15afbcd0 | 8086 | """ |
a95a7133 | 8087 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
8088 | |
8089 | Center with respect to the the parent window | |
8090 | """ | |
54f9ee45 | 8091 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
8092 | |
8093 | CentreOnParent = CenterOnParent | |
8094 | def Fit(*args, **kwargs): | |
15afbcd0 | 8095 | """ |
a95a7133 | 8096 | Fit(self) |
15afbcd0 RD |
8097 | |
8098 | Sizes the window so that it fits around its subwindows. This function | |
8099 | won't do anything if there are no subwindows and will only really work | |
8100 | correctly if sizers are used for the subwindows layout. Also, if the | |
8101 | window has exactly one subwindow it is better (faster and the result | |
8102 | is more precise as Fit adds some margin to account for fuzziness of | |
8103 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8104 | instead of calling Fit. | |
8105 | """ | |
54f9ee45 | 8106 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
8107 | |
8108 | def FitInside(*args, **kwargs): | |
15afbcd0 | 8109 | """ |
a95a7133 | 8110 | FitInside(self) |
15afbcd0 RD |
8111 | |
8112 | Similar to Fit, but sizes the interior (virtual) size of a | |
8113 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8114 | sizing changes that do not trigger a size event, and/or scrolled | |
8115 | windows without an interior sizer. This function similarly won't do | |
8116 | anything if there are no subwindows. | |
8117 | """ | |
54f9ee45 | 8118 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 8119 | |
f16ab95d | 8120 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 8121 | """ |
a95a7133 | 8122 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 8123 | int incH=-1) |
15afbcd0 RD |
8124 | |
8125 | Allows specification of minimum and maximum window sizes, and window | |
8126 | size increments. If a pair of values is not set (or set to -1), the | |
8127 | default values will be used. If this function is called, the user | |
908b74cd RD |
8128 | will not be able to size the window outside the given bounds (if it is |
8129 | a top-level window.) Sizers will also inspect the minimum window size | |
8130 | and will use that value if set when calculating layout. | |
8131 | ||
8132 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 8133 | """ |
f16ab95d | 8134 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 8135 | |
f16ab95d RD |
8136 | def SetSizeHintsSz(*args, **kwargs): |
8137 | """ | |
8138 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8139 | ||
8140 | Allows specification of minimum and maximum window sizes, and window | |
8141 | size increments. If a pair of values is not set (or set to -1), the | |
8142 | default values will be used. If this function is called, the user | |
8143 | will not be able to size the window outside the given bounds (if it is | |
8144 | a top-level window.) Sizers will also inspect the minimum window size | |
8145 | and will use that value if set when calculating layout. | |
8146 | ||
8147 | The resizing increments are only significant under Motif or Xt. | |
8148 | """ | |
8149 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8150 | ||
8151 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 8152 | """ |
908b74cd | 8153 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
8154 | |
8155 | Allows specification of minimum and maximum virtual window sizes. If a | |
8156 | pair of values is not set (or set to -1), the default values will be | |
8157 | used. If this function is called, the user will not be able to size | |
8158 | the virtual area of the window outside the given bounds. | |
8159 | """ | |
f16ab95d RD |
8160 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8161 | ||
8162 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8163 | """ | |
8164 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8165 | ||
8166 | Allows specification of minimum and maximum virtual window sizes. If a | |
8167 | pair of values is not set (or set to -1), the default values will be | |
8168 | used. If this function is called, the user will not be able to size | |
8169 | the virtual area of the window outside the given bounds. | |
8170 | """ | |
8171 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 8172 | |
908b74cd RD |
8173 | def GetMaxSize(*args, **kwargs): |
8174 | """GetMaxSize(self) -> Size""" | |
8175 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8176 | ||
8177 | def GetMinSize(*args, **kwargs): | |
8178 | """GetMinSize(self) -> Size""" | |
8179 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8180 | ||
8181 | def SetMinSize(*args, **kwargs): | |
8182 | """ | |
8183 | SetMinSize(self, Size minSize) | |
8184 | ||
8185 | A more convenient method than `SetSizeHints` for setting just the | |
8186 | min size. | |
8187 | """ | |
8188 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8189 | ||
8190 | def SetMaxSize(*args, **kwargs): | |
8191 | """ | |
8192 | SetMaxSize(self, Size maxSize) | |
8193 | ||
8194 | A more convenient method than `SetSizeHints` for setting just the | |
8195 | max size. | |
8196 | """ | |
8197 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8198 | ||
e811c8ce | 8199 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8200 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8201 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8202 | |
8203 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8204 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8205 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8206 | |
8207 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8208 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8209 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8210 | |
8211 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8212 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8213 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8214 | |
e811c8ce | 8215 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8216 | """ |
a95a7133 | 8217 | SetVirtualSize(self, Size size) |
e811c8ce | 8218 | |
15afbcd0 RD |
8219 | Set the the virtual size of a window in pixels. For most windows this |
8220 | is just the client area of the window, but for some like scrolled | |
8221 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8222 | """ |
54f9ee45 | 8223 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8224 | |
8225 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8226 | """ |
a95a7133 | 8227 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8228 | |
15afbcd0 RD |
8229 | Set the the virtual size of a window in pixels. For most windows this |
8230 | is just the client area of the window, but for some like scrolled | |
8231 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8232 | """ |
54f9ee45 | 8233 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8234 | |
8235 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8236 | """ |
a95a7133 | 8237 | GetVirtualSize(self) -> Size |
e811c8ce | 8238 | |
15afbcd0 RD |
8239 | Get the the virtual size of the window in pixels. For most windows |
8240 | this is just the client area of the window, but for some like scrolled | |
8241 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8242 | """ |
54f9ee45 | 8243 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8244 | |
8245 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8246 | """ |
8247 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8248 | |
15afbcd0 RD |
8249 | Get the the virtual size of the window in pixels. For most windows |
8250 | this is just the client area of the window, but for some like scrolled | |
8251 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8252 | """ |
54f9ee45 | 8253 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce RD |
8254 | |
8255 | def GetBestVirtualSize(*args, **kwargs): | |
15afbcd0 | 8256 | """ |
a95a7133 | 8257 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8258 | |
8259 | Return the largest of ClientSize and BestSize (as determined by a | |
8260 | sizer, interior children, or other means) | |
8261 | """ | |
54f9ee45 | 8262 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8263 | |
8264 | def Show(*args, **kwargs): | |
15afbcd0 | 8265 | """ |
a95a7133 | 8266 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8267 | |
8268 | Shows or hides the window. You may need to call Raise for a top level | |
8269 | window if you want to bring it to top, although this is not needed if | |
8270 | Show is called immediately after the frame creation. Returns True if | |
8271 | the window has been shown or hidden or False if nothing was done | |
8272 | because it already was in the requested state. | |
8273 | """ | |
54f9ee45 | 8274 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8275 | |
8276 | def Hide(*args, **kwargs): | |
15afbcd0 | 8277 | """ |
a95a7133 | 8278 | Hide(self) -> bool |
15afbcd0 RD |
8279 | |
8280 | Equivalent to calling Show(False). | |
8281 | """ | |
54f9ee45 | 8282 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8283 | |
8284 | def Enable(*args, **kwargs): | |
15afbcd0 | 8285 | """ |
a95a7133 | 8286 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8287 | |
8288 | Enable or disable the window for user input. Note that when a parent | |
8289 | window is disabled, all of its children are disabled as well and they | |
8290 | are reenabled again when the parent is. Returns true if the window | |
8291 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8292 | window had already been in the specified state. | |
8293 | """ | |
54f9ee45 | 8294 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8295 | |
8296 | def Disable(*args, **kwargs): | |
15afbcd0 | 8297 | """ |
a95a7133 | 8298 | Disable(self) -> bool |
15afbcd0 RD |
8299 | |
8300 | Disables the window, same as Enable(false). | |
8301 | """ | |
54f9ee45 | 8302 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8303 | |
8304 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8305 | """ |
a95a7133 | 8306 | IsShown(self) -> bool |
15afbcd0 RD |
8307 | |
8308 | Returns true if the window is shown, false if it has been hidden. | |
8309 | """ | |
54f9ee45 | 8310 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8311 | |
8312 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8313 | """ |
a95a7133 | 8314 | IsEnabled(self) -> bool |
15afbcd0 RD |
8315 | |
8316 | Returns true if the window is enabled for input, false otherwise. | |
8317 | """ | |
54f9ee45 | 8318 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce RD |
8319 | |
8320 | def SetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8321 | """ |
a95a7133 | 8322 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 8323 | |
41e2b43e RD |
8324 | Sets the style of the window. Please note that some styles cannot be |
8325 | changed after the window creation and that Refresh() might need to be | |
8326 | called after changing the others for the change to take place | |
8327 | immediately. | |
15afbcd0 | 8328 | """ |
54f9ee45 | 8329 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
8330 | |
8331 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8332 | """ |
a95a7133 | 8333 | GetWindowStyleFlag(self) -> long |
e811c8ce | 8334 | |
15afbcd0 RD |
8335 | Gets the window style that was passed to the constructor or Create |
8336 | method. | |
8337 | """ | |
54f9ee45 | 8338 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 8339 | |
15afbcd0 | 8340 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 8341 | def HasFlag(*args, **kwargs): |
15afbcd0 | 8342 | """ |
a95a7133 | 8343 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
8344 | |
8345 | Test if the given style is set for this window. | |
8346 | """ | |
54f9ee45 | 8347 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
8348 | |
8349 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 8350 | """ |
a95a7133 | 8351 | IsRetained(self) -> bool |
15afbcd0 RD |
8352 | |
8353 | Returns true if the window is retained, false otherwise. Retained | |
8354 | windows are only available on X platforms. | |
8355 | """ | |
54f9ee45 | 8356 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce RD |
8357 | |
8358 | def SetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8359 | """ |
a95a7133 | 8360 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
8361 | |
8362 | Sets the extra style bits for the window. Extra styles are the less | |
8363 | often used style bits which can't be set with the constructor or with | |
8364 | SetWindowStyleFlag() | |
8365 | """ | |
54f9ee45 | 8366 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8367 | |
8368 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8369 | """ |
a95a7133 | 8370 | GetExtraStyle(self) -> long |
15afbcd0 RD |
8371 | |
8372 | Returns the extra style bits for the window. | |
8373 | """ | |
54f9ee45 | 8374 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8375 | |
8376 | def MakeModal(*args, **kwargs): | |
15afbcd0 | 8377 | """ |
a95a7133 | 8378 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
8379 | |
8380 | Disables all other windows in the application so that the user can | |
8381 | only interact with this window. Passing False will reverse this | |
8382 | effect. | |
8383 | """ | |
54f9ee45 | 8384 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
8385 | |
8386 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8387 | """ |
a95a7133 | 8388 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
8389 | |
8390 | This function tells a window if it should use the system's "theme" | |
8391 | code to draw the windows' background instead if its own background | |
8392 | drawing code. This will only have an effect on platforms that support | |
8393 | the notion of themes in user defined windows. One such platform is | |
8394 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8395 | user's selected theme. | |
8396 | ||
8397 | Dialogs, notebook pages and the status bar have this flag set to true | |
8398 | by default so that the default look and feel is simulated best. | |
8399 | """ | |
54f9ee45 | 8400 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8401 | |
8402 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8403 | """ |
a95a7133 | 8404 | GetThemeEnabled(self) -> bool |
e811c8ce | 8405 | |
15afbcd0 RD |
8406 | Return the themeEnabled flag. |
8407 | """ | |
54f9ee45 | 8408 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8409 | |
8410 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 8411 | """ |
a95a7133 | 8412 | SetFocus(self) |
15afbcd0 RD |
8413 | |
8414 | Set's the focus to this window, allowing it to receive keyboard input. | |
8415 | """ | |
54f9ee45 | 8416 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
8417 | |
8418 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 8419 | """ |
a95a7133 | 8420 | SetFocusFromKbd(self) |
15afbcd0 RD |
8421 | |
8422 | Set focus to this window as the result of a keyboard action. Normally | |
8423 | only called internally. | |
8424 | """ | |
54f9ee45 | 8425 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
8426 | |
8427 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 8428 | """ |
66c033b4 | 8429 | FindFocus() -> Window |
15afbcd0 RD |
8430 | |
8431 | Returns the window or control that currently has the keyboard focus, | |
8432 | or None. | |
8433 | """ | |
54f9ee45 | 8434 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
8435 | |
8436 | FindFocus = staticmethod(FindFocus) | |
8437 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 8438 | """ |
a95a7133 | 8439 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
8440 | |
8441 | Can this window have focus? | |
8442 | """ | |
54f9ee45 | 8443 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce RD |
8444 | |
8445 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
15afbcd0 | 8446 | """ |
a95a7133 | 8447 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
8448 | |
8449 | Can this window be given focus by keyboard navigation? if not, the | |
8450 | only way to give it focus (provided it accepts it at all) is to click | |
8451 | it. | |
8452 | """ | |
54f9ee45 | 8453 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce | 8454 | |
908b74cd RD |
8455 | def Navigate(*args, **kwargs): |
8456 | """ | |
8457 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8458 | ||
fd2dc343 RD |
8459 | Does keyboard navigation from this window to another, by sending a |
8460 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8461 | """ |
8462 | return _core_.Window_Navigate(*args, **kwargs) | |
8463 | ||
7f98d120 RD |
8464 | def MoveAfterInTabOrder(*args, **kwargs): |
8465 | """ | |
8466 | MoveAfterInTabOrder(self, Window win) | |
8467 | ||
8468 | Moves this window in the tab navigation order after the specified | |
8469 | sibling window. This means that when the user presses the TAB key on | |
8470 | that other window, the focus switches to this window. | |
8471 | ||
8472 | The default tab order is the same as creation order. This function | |
8473 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8474 | windows. | |
8475 | ||
8476 | """ | |
8477 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8478 | ||
8479 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8480 | """ | |
8481 | MoveBeforeInTabOrder(self, Window win) | |
8482 | ||
8483 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8484 | before win instead of putting it right after it. | |
8485 | """ | |
8486 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8487 | ||
e811c8ce | 8488 | def GetChildren(*args, **kwargs): |
15afbcd0 | 8489 | """ |
a95a7133 | 8490 | GetChildren(self) -> PyObject |
15afbcd0 RD |
8491 | |
8492 | Returns a list of the window's children. NOTE: Currently this is a | |
8493 | copy of the child window list maintained by the window, so the return | |
8494 | value of this function is only valid as long as the window's children | |
8495 | do not change. | |
8496 | """ | |
54f9ee45 | 8497 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
8498 | |
8499 | def GetParent(*args, **kwargs): | |
15afbcd0 | 8500 | """ |
a95a7133 | 8501 | GetParent(self) -> Window |
15afbcd0 RD |
8502 | |
8503 | Returns the parent window of this window, or None if there isn't one. | |
8504 | """ | |
54f9ee45 | 8505 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
8506 | |
8507 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 8508 | """ |
a95a7133 | 8509 | GetGrandParent(self) -> Window |
15afbcd0 | 8510 | |
41e2b43e RD |
8511 | Returns the parent of the parent of this window, or None if there |
8512 | isn't one. | |
15afbcd0 | 8513 | """ |
54f9ee45 | 8514 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce RD |
8515 | |
8516 | def IsTopLevel(*args, **kwargs): | |
15afbcd0 | 8517 | """ |
a95a7133 | 8518 | IsTopLevel(self) -> bool |
15afbcd0 RD |
8519 | |
8520 | Returns true if the given window is a top-level one. Currently all | |
8521 | frames and dialogs are always considered to be top-level windows (even | |
8522 | if they have a parent window). | |
8523 | """ | |
54f9ee45 | 8524 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
8525 | |
8526 | def Reparent(*args, **kwargs): | |
15afbcd0 | 8527 | """ |
a95a7133 | 8528 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
8529 | |
8530 | Reparents the window, i.e the window will be removed from its current | |
8531 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8532 | re-inserted into another. Available on Windows and GTK. Returns True | |
8533 | if the parent was changed, False otherwise (error or newParent == | |
8534 | oldParent) | |
8535 | """ | |
54f9ee45 | 8536 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
8537 | |
8538 | def AddChild(*args, **kwargs): | |
15afbcd0 | 8539 | """ |
a95a7133 | 8540 | AddChild(self, Window child) |
15afbcd0 RD |
8541 | |
8542 | Adds a child window. This is called automatically by window creation | |
8543 | functions so should not be required by the application programmer. | |
8544 | """ | |
54f9ee45 | 8545 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
8546 | |
8547 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 8548 | """ |
a95a7133 | 8549 | RemoveChild(self, Window child) |
15afbcd0 RD |
8550 | |
8551 | Removes a child window. This is called automatically by window | |
8552 | deletion functions so should not be required by the application | |
8553 | programmer. | |
8554 | """ | |
54f9ee45 | 8555 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce | 8556 | |
704eda0c RD |
8557 | def SetDoubleBuffered(*args, **kwargs): |
8558 | """ | |
8559 | SetDoubleBuffered(self, bool on) | |
8560 | ||
8561 | Currently wxGTK2 only. | |
8562 | """ | |
8563 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
8564 | ||
e811c8ce | 8565 | def FindWindowById(*args, **kwargs): |
15afbcd0 | 8566 | """ |
a95a7133 | 8567 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
8568 | |
8569 | Find a chld of this window by window ID | |
8570 | """ | |
54f9ee45 | 8571 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
8572 | |
8573 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 8574 | """ |
a95a7133 | 8575 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
8576 | |
8577 | Find a child of this window by name | |
8578 | """ | |
54f9ee45 | 8579 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
8580 | |
8581 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 8582 | """ |
a95a7133 | 8583 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
8584 | |
8585 | Returns the event handler for this window. By default, the window is | |
8586 | its own event handler. | |
8587 | """ | |
54f9ee45 | 8588 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
8589 | |
8590 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 8591 | """ |
a95a7133 | 8592 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8593 | |
8594 | Sets the event handler for this window. An event handler is an object | |
8595 | that is capable of processing the events sent to a window. By default, | |
8596 | the window is its own event handler, but an application may wish to | |
8597 | substitute another, for example to allow central implementation of | |
8598 | event-handling for a variety of different window classes. | |
8599 | ||
41e2b43e | 8600 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 RD |
8601 | up a chain of event handlers, where an event not handled by one event |
8602 | handler is handed to the next one in the chain. | |
8603 | """ | |
54f9ee45 | 8604 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
8605 | |
8606 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 8607 | """ |
a95a7133 | 8608 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8609 | |
8610 | Pushes this event handler onto the event handler stack for the window. | |
8611 | An event handler is an object that is capable of processing the events | |
8612 | sent to a window. By default, the window is its own event handler, but | |
8613 | an application may wish to substitute another, for example to allow | |
8614 | central implementation of event-handling for a variety of different | |
8615 | window classes. | |
8616 | ||
8617 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8618 | event handlers, where an event not handled by one event handler is | |
41e2b43e | 8619 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
15afbcd0 RD |
8620 | remove the event handler. |
8621 | """ | |
54f9ee45 | 8622 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
8623 | |
8624 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 8625 | """ |
a95a7133 | 8626 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
8627 | |
8628 | Removes and returns the top-most event handler on the event handler | |
8629 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
8630 | destroyed after it is popped. | |
8631 | """ | |
54f9ee45 | 8632 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
8633 | |
8634 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 8635 | """ |
a95a7133 | 8636 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 8637 | |
41e2b43e RD |
8638 | Find the given handler in the event handler chain and remove (but not |
8639 | delete) it from the event handler chain, return True if it was found | |
8640 | and False otherwise (this also results in an assert failure so this | |
8641 | function should only be called when the handler is supposed to be | |
8642 | there.) | |
15afbcd0 | 8643 | """ |
54f9ee45 | 8644 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
8645 | |
8646 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 8647 | """ |
a95a7133 | 8648 | SetValidator(self, Validator validator) |
15afbcd0 RD |
8649 | |
8650 | Deletes the current validator (if any) and sets the window validator, | |
8651 | having called wx.Validator.Clone to create a new validator of this | |
8652 | type. | |
8653 | """ | |
54f9ee45 | 8654 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
8655 | |
8656 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 8657 | """ |
a95a7133 | 8658 | GetValidator(self) -> Validator |
15afbcd0 RD |
8659 | |
8660 | Returns a pointer to the current validator for the window, or None if | |
8661 | there is none. | |
8662 | """ | |
54f9ee45 | 8663 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 8664 | |
74a57fcd RD |
8665 | def Validate(*args, **kwargs): |
8666 | """ | |
a95a7133 | 8667 | Validate(self) -> bool |
74a57fcd RD |
8668 | |
8669 | Validates the current values of the child controls using their | |
41e2b43e RD |
8670 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8671 | style flag set, the method will also call Validate() of all child | |
8672 | windows. Returns false if any of the validations failed. | |
74a57fcd | 8673 | """ |
54f9ee45 | 8674 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
8675 | |
8676 | def TransferDataToWindow(*args, **kwargs): | |
8677 | """ | |
a95a7133 | 8678 | TransferDataToWindow(self) -> bool |
74a57fcd | 8679 | |
41e2b43e RD |
8680 | Transfers values to child controls from data areas specified by their |
8681 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8682 | style flag set, the method will also call TransferDataToWindow() of | |
8683 | all child windows. | |
74a57fcd | 8684 | """ |
54f9ee45 | 8685 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
8686 | |
8687 | def TransferDataFromWindow(*args, **kwargs): | |
8688 | """ | |
a95a7133 | 8689 | TransferDataFromWindow(self) -> bool |
74a57fcd | 8690 | |
41e2b43e RD |
8691 | Transfers values from child controls to data areas specified by their |
8692 | validators. Returns false if a transfer failed. If the window has | |
8693 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8694 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 8695 | """ |
54f9ee45 | 8696 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
8697 | |
8698 | def InitDialog(*args, **kwargs): | |
8699 | """ | |
a95a7133 | 8700 | InitDialog(self) |
74a57fcd | 8701 | |
41e2b43e RD |
8702 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8703 | to the dialog via validators. | |
74a57fcd | 8704 | """ |
54f9ee45 | 8705 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 8706 | |
e811c8ce | 8707 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 8708 | """ |
a95a7133 | 8709 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
8710 | |
8711 | Sets the accelerator table for this window. | |
8712 | """ | |
54f9ee45 | 8713 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8714 | |
8715 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 8716 | """ |
a95a7133 | 8717 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
8718 | |
8719 | Gets the accelerator table for this window. | |
8720 | """ | |
54f9ee45 | 8721 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8722 | |
8723 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 8724 | """ |
a95a7133 | 8725 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
8726 | |
8727 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8728 | registered here, this window will receive a hotkey event. It will | |
8729 | receive the event even if the application is in the background and | |
8730 | does not have the input focus because the user is working with some | |
8731 | other application. To bind an event handler function to this hotkey | |
8732 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8733 | hotkey was registered successfully. | |
8734 | """ | |
54f9ee45 | 8735 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
8736 | |
8737 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 8738 | """ |
a95a7133 | 8739 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
8740 | |
8741 | Unregisters a system wide hotkey. | |
8742 | """ | |
54f9ee45 | 8743 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
8744 | |
8745 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 8746 | """ |
a95a7133 | 8747 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
8748 | |
8749 | Converts a point or size from dialog units to pixels. Dialog units | |
8750 | are used for maintaining a dialog's proportions even if the font | |
8751 | changes. For the x dimension, the dialog units are multiplied by the | |
8752 | average character width and then divided by 4. For the y dimension, | |
8753 | the dialog units are multiplied by the average character height and | |
8754 | then divided by 8. | |
8755 | """ | |
54f9ee45 | 8756 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
8757 | |
8758 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 8759 | """ |
a95a7133 | 8760 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
8761 | |
8762 | Converts a point or size from dialog units to pixels. Dialog units | |
8763 | are used for maintaining a dialog's proportions even if the font | |
8764 | changes. For the x dimension, the dialog units are multiplied by the | |
8765 | average character width and then divided by 4. For the y dimension, | |
8766 | the dialog units are multiplied by the average character height and | |
8767 | then divided by 8. | |
8768 | """ | |
54f9ee45 | 8769 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
8770 | |
8771 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 8772 | """ |
a95a7133 | 8773 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
8774 | |
8775 | Converts a point or size from dialog units to pixels. Dialog units | |
8776 | are used for maintaining a dialog's proportions even if the font | |
8777 | changes. For the x dimension, the dialog units are multiplied by the | |
8778 | average character width and then divided by 4. For the y dimension, | |
8779 | the dialog units are multiplied by the average character height and | |
8780 | then divided by 8. | |
8781 | """ | |
54f9ee45 | 8782 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
8783 | |
8784 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 8785 | """ |
a95a7133 | 8786 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
8787 | |
8788 | Converts a point or size from dialog units to pixels. Dialog units | |
8789 | are used for maintaining a dialog's proportions even if the font | |
8790 | changes. For the x dimension, the dialog units are multiplied by the | |
8791 | average character width and then divided by 4. For the y dimension, | |
8792 | the dialog units are multiplied by the average character height and | |
8793 | then divided by 8. | |
8794 | """ | |
54f9ee45 | 8795 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
8796 | |
8797 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 8798 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 8799 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
8800 | |
8801 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 8802 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 8803 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
8804 | |
8805 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 8806 | """ |
a95a7133 | 8807 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
8808 | |
8809 | Moves the pointer to the given position on the window. | |
8810 | ||
8811 | NOTE: This function is not supported under Mac because Apple Human | |
8812 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
8813 | """ | |
54f9ee45 | 8814 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
8815 | |
8816 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 8817 | """ |
a95a7133 | 8818 | CaptureMouse(self) |
15afbcd0 RD |
8819 | |
8820 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
8821 | release the capture. | |
8822 | ||
8823 | Note that wxWindows maintains the stack of windows having captured the | |
8824 | mouse and when the mouse is released the capture returns to the window | |
8825 | which had had captured it previously and it is only really released if | |
8826 | there were no previous window. In particular, this means that you must | |
34e0a3bb RD |
8827 | release the mouse as many times as you capture it, unless the window |
8828 | receives the `wx.MouseCaptureLostEvent` event. | |
8829 | ||
8830 | Any application which captures the mouse in the beginning of some | |
8831 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
8832 | operation when it receives the event. The event handler must not | |
8833 | recapture mouse. | |
15afbcd0 | 8834 | """ |
54f9ee45 | 8835 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
8836 | |
8837 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 8838 | """ |
a95a7133 | 8839 | ReleaseMouse(self) |
15afbcd0 RD |
8840 | |
8841 | Releases mouse input captured with wx.Window.CaptureMouse. | |
8842 | """ | |
54f9ee45 | 8843 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
8844 | |
8845 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 8846 | """ |
66c033b4 | 8847 | GetCapture() -> Window |
15afbcd0 RD |
8848 | |
8849 | Returns the window which currently captures the mouse or None | |
8850 | """ | |
54f9ee45 | 8851 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
8852 | |
8853 | GetCapture = staticmethod(GetCapture) | |
8854 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 8855 | """ |
a95a7133 | 8856 | HasCapture(self) -> bool |
15afbcd0 RD |
8857 | |
8858 | Returns true if this window has the current mouse capture. | |
8859 | """ | |
54f9ee45 | 8860 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
8861 | |
8862 | def Refresh(*args, **kwargs): | |
15afbcd0 | 8863 | """ |
a95a7133 | 8864 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
8865 | |
8866 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
8867 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
8868 | to the window. | |
8869 | """ | |
54f9ee45 | 8870 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
8871 | |
8872 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 8873 | """ |
fef4c27a | 8874 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
8875 | |
8876 | Redraws the contents of the given rectangle: the area inside it will | |
8877 | be repainted. This is the same as Refresh but has a nicer syntax. | |
8878 | """ | |
54f9ee45 | 8879 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
8880 | |
8881 | def Update(*args, **kwargs): | |
15afbcd0 | 8882 | """ |
a95a7133 | 8883 | Update(self) |
15afbcd0 RD |
8884 | |
8885 | Calling this method immediately repaints the invalidated area of the | |
8886 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
8887 | this would usually only happen when the flow of control returns to the | |
8888 | event loop.) Notice that this function doesn't refresh the window and | |
8889 | does nothing if the window has been already repainted. Use Refresh | |
8890 | first if you want to immediately redraw the window (or some portion of | |
8891 | it) unconditionally. | |
8892 | """ | |
54f9ee45 | 8893 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
8894 | |
8895 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 8896 | """ |
a95a7133 | 8897 | ClearBackground(self) |
15afbcd0 RD |
8898 | |
8899 | Clears the window by filling it with the current background | |
8900 | colour. Does not cause an erase background event to be generated. | |
8901 | """ | |
54f9ee45 | 8902 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
8903 | |
8904 | def Freeze(*args, **kwargs): | |
15afbcd0 | 8905 | """ |
a95a7133 | 8906 | Freeze(self) |
15afbcd0 | 8907 | |
41e2b43e RD |
8908 | Freezes the window or, in other words, prevents any updates from |
8909 | taking place on screen, the window is not redrawn at all. Thaw must be | |
8910 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
8911 | nested, with the actual Thaw being delayed until all the nesting has | |
8912 | been undone. | |
15afbcd0 RD |
8913 | |
8914 | This method is useful for visual appearance optimization (for example, | |
8915 | it is a good idea to use it before inserting large amount of text into | |
8916 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
8917 | for all controls so it is mostly just a hint to wxWindows and not a | |
8918 | mandatory directive. | |
8919 | """ | |
54f9ee45 | 8920 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce RD |
8921 | |
8922 | def Thaw(*args, **kwargs): | |
15afbcd0 | 8923 | """ |
a95a7133 | 8924 | Thaw(self) |
15afbcd0 | 8925 | |
4276dc52 | 8926 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
8927 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
8928 | times that Freeze was before the window will be updated. | |
15afbcd0 | 8929 | """ |
54f9ee45 | 8930 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
8931 | |
8932 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 8933 | """ |
a95a7133 | 8934 | PrepareDC(self, DC dc) |
15afbcd0 RD |
8935 | |
8936 | Call this function to prepare the device context for drawing a | |
8937 | scrolled image. It sets the device origin according to the current | |
8938 | scroll position. | |
8939 | """ | |
54f9ee45 | 8940 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce RD |
8941 | |
8942 | def GetUpdateRegion(*args, **kwargs): | |
15afbcd0 | 8943 | """ |
a95a7133 | 8944 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
8945 | |
8946 | Returns the region specifying which parts of the window have been | |
8947 | damaged. Should only be called within an EVT_PAINT handler. | |
8948 | """ | |
54f9ee45 | 8949 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
8950 | |
8951 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 8952 | """ |
a95a7133 | 8953 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
8954 | |
8955 | Get the update rectangle region bounding box in client coords. | |
8956 | """ | |
54f9ee45 | 8957 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
8958 | |
8959 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 8960 | """ |
a95a7133 | 8961 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
8962 | |
8963 | Returns true if the given point or rectangle area has been exposed | |
8964 | since the last repaint. Call this in an paint event handler to | |
8965 | optimize redrawing by only redrawing those areas, which have been | |
8966 | exposed. | |
8967 | """ | |
54f9ee45 | 8968 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
8969 | |
8970 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 8971 | """ |
a95a7133 | 8972 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
8973 | |
8974 | Returns true if the given point or rectangle area has been exposed | |
8975 | since the last repaint. Call this in an paint event handler to | |
8976 | optimize redrawing by only redrawing those areas, which have been | |
8977 | exposed. | |
8978 | """ | |
54f9ee45 | 8979 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 8980 | |
4276dc52 | 8981 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 8982 | """ |
a95a7133 | 8983 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
8984 | |
8985 | Returns true if the given point or rectangle area has been exposed | |
8986 | since the last repaint. Call this in an paint event handler to | |
8987 | optimize redrawing by only redrawing those areas, which have been | |
8988 | exposed. | |
8989 | """ | |
54f9ee45 | 8990 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 8991 | |
74a57fcd RD |
8992 | def GetDefaultAttributes(*args, **kwargs): |
8993 | """ | |
a95a7133 | 8994 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 8995 | |
41e2b43e RD |
8996 | Get the default attributes for an instance of this class. This is |
8997 | useful if you want to use the same font or colour in your own control | |
8998 | as in a standard control -- which is a much better idea than hard | |
8999 | coding specific colours or fonts which might look completely out of | |
db3e571a | 9000 | place on the user's system, especially if it uses themes. |
74a57fcd | 9001 | """ |
54f9ee45 | 9002 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9003 | |
9004 | def GetClassDefaultAttributes(*args, **kwargs): | |
9005 | """ | |
66c033b4 | 9006 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 9007 | |
41e2b43e RD |
9008 | Get the default attributes for this class. This is useful if you want |
9009 | to use the same font or colour in your own control as in a standard | |
9010 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9011 | colours or fonts which might look completely out of place on the |
9012 | user's system, especially if it uses themes. | |
74a57fcd RD |
9013 | |
9014 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9015 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9016 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9017 | this. | |
74a57fcd | 9018 | """ |
54f9ee45 | 9019 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9020 | |
9021 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 9022 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9023 | """ |
a95a7133 | 9024 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9025 | |
9026 | Sets the background colour of the window. Returns True if the colour | |
9027 | was changed. The background colour is usually painted by the default | |
9028 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9029 | automatically under GTK. Using `wx.NullColour` will reset the window |
9030 | to the default background colour. | |
15afbcd0 | 9031 | |
db3e571a | 9032 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9033 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
9034 | calling this function. |
9035 | ||
f8167d6e RD |
9036 | Using this function will disable attempts to use themes for this |
9037 | window, if the system supports them. Use with care since usually the | |
9038 | themes represent the appearance chosen by the user to be used for all | |
9039 | applications on the system. | |
15afbcd0 | 9040 | """ |
54f9ee45 | 9041 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 9042 | |
412d302d RD |
9043 | def SetOwnBackgroundColour(*args, **kwargs): |
9044 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9045 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 9046 | |
e811c8ce | 9047 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 9048 | """ |
a95a7133 | 9049 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9050 | |
9051 | Sets the foreground colour of the window. Returns True is the colour | |
9052 | was changed. The interpretation of foreground colour is dependent on | |
9053 | the window class; it may be the text colour or other colour, or it may | |
9054 | not be used at all. | |
9055 | """ | |
54f9ee45 | 9056 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 9057 | |
fa47d7a7 VS |
9058 | def SetOwnForegroundColour(*args, **kwargs): |
9059 | """SetOwnForegroundColour(self, Colour colour)""" | |
9060 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 9061 | |
e811c8ce | 9062 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9063 | """ |
a95a7133 | 9064 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
9065 | |
9066 | Returns the background colour of the window. | |
9067 | """ | |
54f9ee45 | 9068 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
9069 | |
9070 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 9071 | """ |
a95a7133 | 9072 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
9073 | |
9074 | Returns the foreground colour of the window. The interpretation of | |
9075 | foreground colour is dependent on the window class; it may be the text | |
9076 | colour or other colour, or it may not be used at all. | |
9077 | """ | |
54f9ee45 | 9078 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 9079 | |
562ecc31 RD |
9080 | def InheritsBackgroundColour(*args, **kwargs): |
9081 | """InheritsBackgroundColour(self) -> bool""" | |
9082 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9083 | ||
9084 | def UseBgCol(*args, **kwargs): | |
9085 | """UseBgCol(self) -> bool""" | |
9086 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9087 | ||
7bc1e663 RD |
9088 | def SetBackgroundStyle(*args, **kwargs): |
9089 | """ | |
9090 | SetBackgroundStyle(self, int style) -> bool | |
9091 | ||
9092 | Returns the background style of the window. The background style | |
9093 | indicates how the background of the window is drawn. | |
9094 | ||
9095 | ====================== ======================================== | |
9096 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9097 | be determined by the system | |
9098 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9099 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9100 | application. | |
9101 | ====================== ======================================== | |
9102 | ||
9103 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9104 | a custom background, such as a tiled bitmap. Currently the style has | |
9105 | no effect on other platforms. | |
9106 | ||
9107 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9108 | """ | |
9109 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9110 | ||
9111 | def GetBackgroundStyle(*args, **kwargs): | |
9112 | """ | |
9113 | GetBackgroundStyle(self) -> int | |
9114 | ||
9115 | Returns the background style of the window. | |
9116 | ||
9117 | :see: `SetBackgroundStyle` | |
9118 | """ | |
9119 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9120 | ||
51b83b37 RD |
9121 | def HasTransparentBackground(*args, **kwargs): |
9122 | """ | |
9123 | HasTransparentBackground(self) -> bool | |
9124 | ||
9125 | Returns True if this window's background is transparent (as, for | |
9126 | example, for `wx.StaticText`) and should show the parent window's | |
9127 | background. | |
9128 | ||
9129 | This method is mostly used internally by the library itself and you | |
9130 | normally shouldn't have to call it. You may, however, have to override | |
9131 | it in your custom control classes to ensure that background is painted | |
9132 | correctly. | |
9133 | """ | |
9134 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9135 | ||
e811c8ce | 9136 | def SetCursor(*args, **kwargs): |
15afbcd0 | 9137 | """ |
a95a7133 | 9138 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
9139 | |
9140 | Sets the window's cursor. Notice that the window cursor also sets it | |
9141 | for the children of the window implicitly. | |
9142 | ||
9143 | The cursor may be wx.NullCursor in which case the window cursor will | |
9144 | be reset back to default. | |
9145 | """ | |
54f9ee45 | 9146 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
9147 | |
9148 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 9149 | """ |
a95a7133 | 9150 | GetCursor(self) -> Cursor |
15afbcd0 RD |
9151 | |
9152 | Return the cursor associated with this window. | |
9153 | """ | |
54f9ee45 | 9154 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
9155 | |
9156 | def SetFont(*args, **kwargs): | |
15afbcd0 | 9157 | """ |
a95a7133 | 9158 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
9159 | |
9160 | Sets the font for this window. | |
9161 | """ | |
54f9ee45 | 9162 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 9163 | |
fa47d7a7 VS |
9164 | def SetOwnFont(*args, **kwargs): |
9165 | """SetOwnFont(self, Font font)""" | |
9166 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9167 | |
e811c8ce | 9168 | def GetFont(*args, **kwargs): |
15afbcd0 | 9169 | """ |
a95a7133 | 9170 | GetFont(self) -> Font |
15afbcd0 | 9171 | |
4276dc52 | 9172 | Returns the default font used for this window. |
15afbcd0 | 9173 | """ |
54f9ee45 | 9174 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9175 | |
9176 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9177 | """ |
a95a7133 | 9178 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9179 | |
9180 | Sets the caret associated with the window. | |
9181 | """ | |
54f9ee45 | 9182 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9183 | |
9184 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9185 | """ |
a95a7133 | 9186 | GetCaret(self) -> Caret |
15afbcd0 RD |
9187 | |
9188 | Returns the caret associated with the window. | |
9189 | """ | |
54f9ee45 | 9190 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9191 | |
9192 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9193 | """ |
a95a7133 | 9194 | GetCharHeight(self) -> int |
15afbcd0 RD |
9195 | |
9196 | Get the (average) character size for the current font. | |
9197 | """ | |
54f9ee45 | 9198 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9199 | |
9200 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9201 | """ |
a95a7133 | 9202 | GetCharWidth(self) -> int |
15afbcd0 RD |
9203 | |
9204 | Get the (average) character size for the current font. | |
9205 | """ | |
54f9ee45 | 9206 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9207 | |
9208 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9209 | """ |
9210 | GetTextExtent(String string) -> (width, height) | |
9211 | ||
9212 | Get the width and height of the text using the current font. | |
9213 | """ | |
54f9ee45 | 9214 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9215 | |
9216 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9217 | """ |
196addbf | 9218 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9219 | (width, height, descent, externalLeading) |
e811c8ce | 9220 | |
15afbcd0 RD |
9221 | Get the width, height, decent and leading of the text using the |
9222 | current or specified font. | |
0df68c9f | 9223 | """ |
54f9ee45 | 9224 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
9225 | |
9226 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
9227 | """ |
9228 | ClientToScreenXY(int x, int y) -> (x,y) | |
9229 | ||
9230 | Converts to screen coordinates from coordinates relative to this window. | |
9231 | """ | |
54f9ee45 | 9232 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
9233 | |
9234 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
9235 | """ |
9236 | ScreenToClientXY(int x, int y) -> (x,y) | |
9237 | ||
9238 | Converts from screen to client window coordinates. | |
9239 | """ | |
54f9ee45 | 9240 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
9241 | |
9242 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 9243 | """ |
a95a7133 | 9244 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
9245 | |
9246 | Converts to screen coordinates from coordinates relative to this window. | |
9247 | """ | |
54f9ee45 | 9248 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
9249 | |
9250 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 9251 | """ |
a95a7133 | 9252 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
9253 | |
9254 | Converts from screen to client window coordinates. | |
9255 | """ | |
54f9ee45 | 9256 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
9257 | |
9258 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 9259 | """ |
a95a7133 | 9260 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
9261 | |
9262 | Test where the given (in client coords) point lies | |
9263 | """ | |
54f9ee45 | 9264 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
9265 | |
9266 | def HitTest(*args, **kwargs): | |
15afbcd0 | 9267 | """ |
a95a7133 | 9268 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
9269 | |
9270 | Test where the given (in client coords) point lies | |
9271 | """ | |
54f9ee45 | 9272 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 9273 | |
15afbcd0 RD |
9274 | def GetBorder(*args): |
9275 | """ | |
a95a7133 RD |
9276 | GetBorder(self, long flags) -> int |
9277 | GetBorder(self) -> int | |
e811c8ce | 9278 | |
15afbcd0 RD |
9279 | Get border for the flags of this window |
9280 | """ | |
54f9ee45 | 9281 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
9282 | |
9283 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 9284 | """ |
a95a7133 | 9285 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
9286 | |
9287 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9288 | implementation depends on the window; for example a wx.ToolBar will | |
9289 | send an update UI event for each toolbar button, and a wx.Frame will | |
9290 | send an update UI event for each menubar menu item. You can call this | |
9291 | function from your application to ensure that your UI is up-to-date at | |
9292 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9293 | concerned). This may be necessary if you have called | |
5ba5649b | 9294 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
9295 | limit the overhead that wxWindows incurs by sending update UI events |
9296 | in idle time. | |
15afbcd0 | 9297 | """ |
54f9ee45 | 9298 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
9299 | |
9300 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 9301 | """ |
b0503257 | 9302 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 9303 | |
b0503257 RD |
9304 | Pops up the given menu at the specified coordinates, relative to this window, |
9305 | and returns control when the user has dismissed the menu. If a menu item is | |
9306 | selected, the corresponding menu event is generated and will be processed as | |
9307 | usual. If the default position is given then the current position of the | |
9308 | mouse cursor will be used. | |
15afbcd0 | 9309 | """ |
54f9ee45 | 9310 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 9311 | |
15afbcd0 RD |
9312 | def PopupMenu(*args, **kwargs): |
9313 | """ | |
b0503257 | 9314 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 9315 | |
b0503257 RD |
9316 | Pops up the given menu at the specified coordinates, relative to this window, |
9317 | and returns control when the user has dismissed the menu. If a menu item is | |
9318 | selected, the corresponding menu event is generated and will be processed as | |
9319 | usual. If the default position is given then the current position of the | |
9320 | mouse cursor will be used. | |
15afbcd0 | 9321 | """ |
54f9ee45 | 9322 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 | 9323 | |
10044bf1 RD |
9324 | def HasMultiplePages(*args, **kwargs): |
9325 | """HasMultiplePages(self) -> bool""" | |
9326 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
9327 | ||
15afbcd0 RD |
9328 | def GetHandle(*args, **kwargs): |
9329 | """ | |
a95a7133 | 9330 | GetHandle(self) -> long |
15afbcd0 RD |
9331 | |
9332 | Returns the platform-specific handle (as a long integer) of the | |
9333 | physical window. Currently on wxMac it returns the handle of the | |
9334 | toplevel parent of the window. | |
9335 | """ | |
54f9ee45 | 9336 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 9337 | |
7e63a440 RD |
9338 | def AssociateHandle(*args, **kwargs): |
9339 | """ | |
9340 | AssociateHandle(self, long handle) | |
9341 | ||
9342 | Associate the window with a new native handle | |
9343 | """ | |
9344 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9345 | ||
9346 | def DissociateHandle(*args, **kwargs): | |
9347 | """ | |
9348 | DissociateHandle(self) | |
9349 | ||
9350 | Dissociate the current native handle from the window | |
9351 | """ | |
9352 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9353 | ||
15afbcd0 RD |
9354 | def HasScrollbar(*args, **kwargs): |
9355 | """ | |
a95a7133 | 9356 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
9357 | |
9358 | Does the window have the scrollbar for this orientation? | |
9359 | """ | |
54f9ee45 | 9360 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
9361 | |
9362 | def SetScrollbar(*args, **kwargs): | |
9363 | """ | |
41e2b43e | 9364 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
9365 | bool refresh=True) |
9366 | ||
9367 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 9368 | """ |
54f9ee45 | 9369 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
9370 | |
9371 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 9372 | """ |
a95a7133 | 9373 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
9374 | |
9375 | Sets the position of one of the built-in scrollbars. | |
9376 | """ | |
54f9ee45 | 9377 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
9378 | |
9379 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 9380 | """ |
a95a7133 | 9381 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
9382 | |
9383 | Returns the built-in scrollbar position. | |
9384 | """ | |
54f9ee45 | 9385 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
9386 | |
9387 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 9388 | """ |
a95a7133 | 9389 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
9390 | |
9391 | Returns the built-in scrollbar thumb size. | |
9392 | """ | |
54f9ee45 | 9393 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
9394 | |
9395 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 9396 | """ |
a95a7133 | 9397 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
9398 | |
9399 | Returns the built-in scrollbar range. | |
9400 | """ | |
54f9ee45 | 9401 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
9402 | |
9403 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 9404 | """ |
a95a7133 | 9405 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
9406 | |
9407 | Physically scrolls the pixels in the window and move child windows | |
9408 | accordingly. Use this function to optimise your scrolling | |
9409 | implementations, to minimise the area that must be redrawn. Note that | |
9410 | it is rarely required to call this function from a user program. | |
15afbcd0 | 9411 | """ |
54f9ee45 | 9412 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
9413 | |
9414 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 9415 | """ |
a95a7133 | 9416 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
9417 | |
9418 | If the platform and window class supports it, scrolls the window by | |
9419 | the given number of lines down, if lines is positive, or up if lines | |
9420 | is negative. Returns True if the window was scrolled, False if it was | |
9421 | already on top/bottom and nothing was done. | |
9422 | """ | |
54f9ee45 | 9423 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
9424 | |
9425 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 9426 | """ |
a95a7133 | 9427 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 9428 | |
41e2b43e | 9429 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
9430 | the given number of pages down, if pages is positive, or up if pages |
9431 | is negative. Returns True if the window was scrolled, False if it was | |
9432 | already on top/bottom and nothing was done. | |
9433 | """ | |
54f9ee45 | 9434 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
9435 | |
9436 | def LineUp(*args, **kwargs): | |
15afbcd0 | 9437 | """ |
a95a7133 | 9438 | LineUp(self) -> bool |
15afbcd0 RD |
9439 | |
9440 | This is just a wrapper for ScrollLines(-1). | |
9441 | """ | |
54f9ee45 | 9442 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
9443 | |
9444 | def LineDown(*args, **kwargs): | |
15afbcd0 | 9445 | """ |
a95a7133 | 9446 | LineDown(self) -> bool |
15afbcd0 RD |
9447 | |
9448 | This is just a wrapper for ScrollLines(1). | |
9449 | """ | |
54f9ee45 | 9450 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
9451 | |
9452 | def PageUp(*args, **kwargs): | |
15afbcd0 | 9453 | """ |
a95a7133 | 9454 | PageUp(self) -> bool |
15afbcd0 RD |
9455 | |
9456 | This is just a wrapper for ScrollPages(-1). | |
9457 | """ | |
54f9ee45 | 9458 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
9459 | |
9460 | def PageDown(*args, **kwargs): | |
15afbcd0 | 9461 | """ |
a95a7133 | 9462 | PageDown(self) -> bool |
15afbcd0 RD |
9463 | |
9464 | This is just a wrapper for ScrollPages(1). | |
9465 | """ | |
54f9ee45 | 9466 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
9467 | |
9468 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 9469 | """ |
a95a7133 | 9470 | SetHelpText(self, String text) |
15afbcd0 RD |
9471 | |
9472 | Sets the help text to be used as context-sensitive help for this | |
9473 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9474 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9475 | """ |
54f9ee45 | 9476 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
9477 | |
9478 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 9479 | """ |
a95a7133 | 9480 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
9481 | |
9482 | Associate this help text with all windows with the same id as this | |
9483 | one. | |
9484 | """ | |
54f9ee45 | 9485 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce | 9486 | |
b850e7f3 RD |
9487 | def GetHelpTextAtPoint(*args, **kwargs): |
9488 | """ | |
9489 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
9490 | ||
9491 | Get the help string associated with the given position in this window. | |
9492 | ||
9493 | Notice that pt may be invalid if event origin is keyboard or unknown | |
9494 | and this method should return the global window help text then | |
9495 | ||
9496 | """ | |
9497 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
9498 | ||
e811c8ce | 9499 | def GetHelpText(*args, **kwargs): |
15afbcd0 | 9500 | """ |
a95a7133 | 9501 | GetHelpText(self) -> String |
15afbcd0 RD |
9502 | |
9503 | Gets the help text to be used as context-sensitive help for this | |
9504 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9505 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9506 | """ |
54f9ee45 | 9507 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
9508 | |
9509 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 9510 | """ |
a95a7133 | 9511 | SetToolTipString(self, String tip) |
15afbcd0 RD |
9512 | |
9513 | Attach a tooltip to the window. | |
9514 | """ | |
54f9ee45 | 9515 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
9516 | |
9517 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 9518 | """ |
a95a7133 | 9519 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
9520 | |
9521 | Attach a tooltip to the window. | |
9522 | """ | |
54f9ee45 | 9523 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
9524 | |
9525 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 9526 | """ |
a95a7133 | 9527 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
9528 | |
9529 | get the associated tooltip or None if none | |
9530 | """ | |
54f9ee45 | 9531 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
9532 | |
9533 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 9534 | """ |
a95a7133 | 9535 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
9536 | |
9537 | Associates a drop target with this window. If the window already has | |
9538 | a drop target, it is deleted. | |
9539 | """ | |
54f9ee45 | 9540 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
9541 | |
9542 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 9543 | """ |
a95a7133 | 9544 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
9545 | |
9546 | Returns the associated drop target, which may be None. | |
9547 | """ | |
54f9ee45 | 9548 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 9549 | |
5ba5649b RD |
9550 | def DragAcceptFiles(*args, **kwargs): |
9551 | """ | |
9552 | DragAcceptFiles(self, bool accept) | |
9553 | ||
9554 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9555 | Only functional on Windows. | |
9556 | """ | |
9557 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9558 | ||
e811c8ce | 9559 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 9560 | """ |
a95a7133 | 9561 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
9562 | |
9563 | Sets the window to have the given layout constraints. If an existing | |
9564 | layout constraints object is already owned by the window, it will be | |
9565 | deleted. Pass None to disassociate and delete the window's current | |
9566 | constraints. | |
9567 | ||
9568 | You must call SetAutoLayout to tell a window to use the constraints | |
9569 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9570 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9571 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9572 | effect. | |
9573 | """ | |
54f9ee45 | 9574 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
9575 | |
9576 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 9577 | """ |
a95a7133 | 9578 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
9579 | |
9580 | Returns a pointer to the window's layout constraints, or None if there | |
9581 | are none. | |
9582 | """ | |
54f9ee45 | 9583 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
9584 | |
9585 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9586 | """ |
a95a7133 | 9587 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
9588 | |
9589 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
9590 | when the window is resized. lease note that this only happens for the |
9591 | windows usually used to contain children, namely `wx.Panel` and | |
9592 | `wx.TopLevelWindow` (and the classes deriving from them). | |
9593 | ||
9594 | This method is called implicitly by `SetSizer` but if you use | |
9595 | `SetConstraints` you should call it manually or otherwise the window | |
9596 | layout won't be correctly updated when its size changes. | |
15afbcd0 | 9597 | """ |
54f9ee45 | 9598 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9599 | |
9600 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9601 | """ |
a95a7133 | 9602 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
9603 | |
9604 | Returns the current autoLayout setting | |
9605 | """ | |
54f9ee45 | 9606 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9607 | |
9608 | def Layout(*args, **kwargs): | |
15afbcd0 | 9609 | """ |
a95a7133 | 9610 | Layout(self) -> bool |
15afbcd0 RD |
9611 | |
9612 | Invokes the constraint-based layout algorithm or the sizer-based | |
9613 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9614 | this function gets called automatically by the default EVT_SIZE | |
9615 | handler when the window is resized. | |
9616 | """ | |
54f9ee45 | 9617 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
9618 | |
9619 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 9620 | """ |
a95a7133 | 9621 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9622 | |
9623 | Sets the window to have the given layout sizer. The window will then | |
9624 | own the object, and will take care of its deletion. If an existing | |
9625 | layout sizer object is already owned by the window, it will be deleted | |
9626 | if the deleteOld parameter is true. Note that this function will also | |
9627 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 9628 | non-None, and False otherwise. |
15afbcd0 | 9629 | """ |
54f9ee45 | 9630 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
9631 | |
9632 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 9633 | """ |
a95a7133 | 9634 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9635 | |
9636 | The same as SetSizer, except it also sets the size hints for the | |
9637 | window based on the sizer's minimum size. | |
9638 | """ | |
54f9ee45 | 9639 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
9640 | |
9641 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 9642 | """ |
a95a7133 | 9643 | GetSizer(self) -> Sizer |
15afbcd0 RD |
9644 | |
9645 | Return the sizer associated with the window by a previous call to | |
9646 | SetSizer or None if there isn't one. | |
9647 | """ | |
54f9ee45 | 9648 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
9649 | |
9650 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9651 | """ |
a95a7133 | 9652 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
9653 | |
9654 | This normally does not need to be called by application code. It is | |
9655 | called internally when a window is added to a sizer, and is used so | |
9656 | the window can remove itself from the sizer when it is destroyed. | |
9657 | """ | |
54f9ee45 | 9658 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
9659 | |
9660 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9661 | """ |
a95a7133 | 9662 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
9663 | |
9664 | Return the sizer that this window is a member of, if any, otherwise None. | |
9665 | """ | |
54f9ee45 | 9666 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 9667 | |
a95a7133 RD |
9668 | def InheritAttributes(*args, **kwargs): |
9669 | """ | |
9670 | InheritAttributes(self) | |
9671 | ||
41e2b43e RD |
9672 | This function is (or should be, in case of custom controls) called |
9673 | during window creation to intelligently set up the window visual | |
9674 | attributes, that is the font and the foreground and background | |
9675 | colours. | |
9676 | ||
9677 | By 'intelligently' the following is meant: by default, all windows use | |
9678 | their own default attributes. However if some of the parent's | |
9679 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9680 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
9681 | explicitly set for this window itself, then this window takes the same |
9682 | value as used by the parent. In addition, if the window overrides | |
9683 | ShouldInheritColours to return false, the colours will not be changed | |
9684 | no matter what and only the font might. | |
9685 | ||
34621cc5 | 9686 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 9687 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
9688 | attributes are used and in this case, nothing should be inherited as |
9689 | in modern GUIs different controls use different fonts (and colours) | |
9690 | than their siblings so they can't inherit the same value from the | |
9691 | parent. However it was also deemed desirable to allow to simply change | |
9692 | the attributes of all children at once by just changing the font or | |
9693 | colour of their common parent, hence in this case we do inherit the | |
9694 | parents attributes. | |
9695 | ||
a95a7133 | 9696 | """ |
54f9ee45 | 9697 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
9698 | |
9699 | def ShouldInheritColours(*args, **kwargs): | |
9700 | """ | |
9701 | ShouldInheritColours(self) -> bool | |
9702 | ||
9703 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
9704 | changed by InheritAttributes, returning false forbids inheriting them |
9705 | from the parent window. | |
a95a7133 | 9706 | |
41e2b43e RD |
9707 | The base class version returns false, but this method is overridden in |
9708 | wxControl where it returns true. | |
a95a7133 | 9709 | """ |
54f9ee45 | 9710 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 9711 | |
fc46b7f3 RD |
9712 | def CanSetTransparent(*args, **kwargs): |
9713 | """ | |
9714 | CanSetTransparent(self) -> bool | |
9715 | ||
9716 | Returns ``True`` if the platform supports setting the transparency for | |
9717 | this window. Note that this method will err on the side of caution, | |
9718 | so it is possible that this will return ``False`` when it is in fact | |
9719 | possible to set the transparency. | |
9720 | ||
9721 | NOTE: On X-windows systems the X server must have the composite | |
9722 | extension loaded, and there must be a composite manager program (such | |
9723 | as xcompmgr) running. | |
9724 | """ | |
9725 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
9726 | ||
9727 | def SetTransparent(*args, **kwargs): | |
9728 | """ | |
9729 | SetTransparent(self, byte alpha) -> bool | |
9730 | ||
9731 | Attempt to set the transparency of this window to the ``alpha`` value, | |
9732 | returns True on success. The ``alpha`` value is an integer in the | |
9733 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
9734 | opaque. | |
9735 | """ | |
9736 | return _core_.Window_SetTransparent(*args, **kwargs) | |
9737 | ||
e811c8ce | 9738 | def PostCreate(self, pre): |
15afbcd0 RD |
9739 | """ |
9740 | Phase 3 of the 2-phase create <wink!> | |
9741 | Call this method after precreating the window with the 2-phase create method. | |
9742 | """ | |
e811c8ce RD |
9743 | self.this = pre.this |
9744 | self.thisown = pre.thisown | |
9745 | pre.thisown = 0 | |
9746 | if hasattr(self, '_setOORInfo'): | |
9747 | self._setOORInfo(self) | |
9748 | if hasattr(self, '_setCallbackInfo'): | |
9749 | self._setCallbackInfo(self, self.__class__) | |
9750 | ||
7e08d4ef | 9751 | def SendSizeEvent(self): |
453fb36b | 9752 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) |
7e08d4ef | 9753 | |
2bf58437 RD |
9754 | AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") |
9755 | AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`") | |
9756 | AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") | |
9757 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
9758 | BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") | |
9759 | BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`") | |
9760 | BestSize = property(GetBestSize,doc="See `GetBestSize`") | |
9761 | BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`") | |
9762 | Border = property(GetBorder,doc="See `GetBorder`") | |
9763 | Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`") | |
9764 | CharHeight = property(GetCharHeight,doc="See `GetCharHeight`") | |
9765 | CharWidth = property(GetCharWidth,doc="See `GetCharWidth`") | |
9766 | Children = property(GetChildren,doc="See `GetChildren`") | |
9767 | ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`") | |
9768 | ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`") | |
9769 | ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`") | |
9770 | Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`") | |
9771 | ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`") | |
9772 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
9773 | DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`") | |
9774 | DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`") | |
9775 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
9776 | ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`") | |
9777 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
9778 | ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`") | |
9779 | FullTextExtent = property(GetFullTextExtent,doc="See `GetFullTextExtent`") | |
9780 | GrandParent = property(GetGrandParent,doc="See `GetGrandParent`") | |
9781 | Handle = property(GetHandle,doc="See `GetHandle`") | |
9782 | HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`") | |
9783 | HelpTextAtPoint = property(GetHelpTextAtPoint,doc="See `GetHelpTextAtPoint`") | |
9784 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
9785 | Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`") | |
9786 | MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`") | |
9787 | MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`") | |
9788 | MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`") | |
9789 | MinHeight = property(GetMinHeight,doc="See `GetMinHeight`") | |
9790 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
9791 | MinWidth = property(GetMinWidth,doc="See `GetMinWidth`") | |
9792 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
9793 | Parent = property(GetParent,doc="See `GetParent`") | |
9794 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
9795 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
9796 | ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`") | |
9797 | ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`") | |
9798 | ScrollPos = property(GetScrollPos,SetScrollPos,doc="See `GetScrollPos` and `SetScrollPos`") | |
9799 | ScrollRange = property(GetScrollRange,doc="See `GetScrollRange`") | |
9800 | ScrollThumb = property(GetScrollThumb,doc="See `GetScrollThumb`") | |
9801 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
9802 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
9803 | TextExtent = property(GetTextExtent,doc="See `GetTextExtent`") | |
9804 | ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`") | |
9805 | ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`") | |
9806 | UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`") | |
9807 | UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`") | |
9808 | Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`") | |
9809 | VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`") | |
9810 | WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`") | |
9811 | WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`") | |
9812 | WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`") | |
2131d850 | 9813 | _core_.Window_swigregister(Window) |
e811c8ce RD |
9814 | |
9815 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
9816 | """ |
9817 | PreWindow() -> Window | |
9818 | ||
9819 | Precreate a Window for 2-phase creation. | |
9820 | """ | |
54f9ee45 | 9821 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
9822 | return val |
9823 | ||
0085ce49 RD |
9824 | def Window_NewControlId(*args): |
9825 | """ | |
15afbcd0 RD |
9826 | Window_NewControlId() -> int |
9827 | ||
9828 | Generate a control id for the controls which were not given one. | |
9829 | """ | |
0085ce49 | 9830 | return _core_.Window_NewControlId(*args) |
e811c8ce RD |
9831 | |
9832 | def Window_NextControlId(*args, **kwargs): | |
0085ce49 | 9833 | """ |
15afbcd0 RD |
9834 | Window_NextControlId(int winid) -> int |
9835 | ||
9836 | Get the id of the control following the one with the given | |
41e2b43e | 9837 | autogenerated) id |
15afbcd0 | 9838 | """ |
0085ce49 | 9839 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
9840 | |
9841 | def Window_PrevControlId(*args, **kwargs): | |
0085ce49 | 9842 | """ |
15afbcd0 RD |
9843 | Window_PrevControlId(int winid) -> int |
9844 | ||
9845 | Get the id of the control preceding the one with the given | |
41e2b43e | 9846 | autogenerated) id |
15afbcd0 | 9847 | """ |
0085ce49 | 9848 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce | 9849 | |
0085ce49 RD |
9850 | def Window_FindFocus(*args): |
9851 | """ | |
15afbcd0 RD |
9852 | Window_FindFocus() -> Window |
9853 | ||
9854 | Returns the window or control that currently has the keyboard focus, | |
9855 | or None. | |
9856 | """ | |
0085ce49 | 9857 | return _core_.Window_FindFocus(*args) |
e811c8ce | 9858 | |
0085ce49 RD |
9859 | def Window_GetCapture(*args): |
9860 | """ | |
15afbcd0 RD |
9861 | Window_GetCapture() -> Window |
9862 | ||
9863 | Returns the window which currently captures the mouse or None | |
9864 | """ | |
0085ce49 | 9865 | return _core_.Window_GetCapture(*args) |
e811c8ce | 9866 | |
74a57fcd | 9867 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 9868 | """ |
74a57fcd RD |
9869 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
9870 | ||
41e2b43e RD |
9871 | Get the default attributes for this class. This is useful if you want |
9872 | to use the same font or colour in your own control as in a standard | |
9873 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9874 | colours or fonts which might look completely out of place on the |
9875 | user's system, especially if it uses themes. | |
74a57fcd RD |
9876 | |
9877 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9878 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9879 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9880 | this. | |
74a57fcd | 9881 | """ |
0085ce49 | 9882 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 9883 | |
e811c8ce | 9884 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
9885 | """ |
9886 | Convenience function for converting a Point or (x,y) in | |
9887 | dialog units to pixel units. | |
9888 | """ | |
e811c8ce RD |
9889 | if y is None: |
9890 | return win.ConvertDialogPointToPixels(point_or_x) | |
9891 | else: | |
fd3f2efe | 9892 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
9893 | |
9894 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
9895 | """ |
9896 | Convenience function for converting a Size or (w,h) in | |
9897 | dialog units to pixel units. | |
9898 | """ | |
e811c8ce RD |
9899 | if height is None: |
9900 | return win.ConvertDialogSizeToPixels(size_width) | |
9901 | else: | |
fd3f2efe | 9902 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
9903 | |
9904 | ||
9905 | def FindWindowById(*args, **kwargs): | |
0085ce49 | 9906 | """ |
15afbcd0 RD |
9907 | FindWindowById(long id, Window parent=None) -> Window |
9908 | ||
9909 | Find the first window in the application with the given id. If parent | |
9910 | is None, the search will start from all top-level frames and dialog | |
9911 | boxes; if non-None, the search will be limited to the given window | |
9912 | hierarchy. The search is recursive in both cases. | |
9913 | """ | |
0085ce49 | 9914 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
9915 | |
9916 | def FindWindowByName(*args, **kwargs): | |
0085ce49 | 9917 | """ |
15afbcd0 RD |
9918 | FindWindowByName(String name, Window parent=None) -> Window |
9919 | ||
9920 | Find a window by its name (as given in a window constructor or Create | |
9921 | function call). If parent is None, the search will start from all | |
9922 | top-level frames and dialog boxes; if non-None, the search will be | |
9923 | limited to the given window hierarchy. The search is recursive in both | |
9924 | cases. | |
9925 | ||
9926 | If no window with such name is found, wx.FindWindowByLabel is called. | |
9927 | """ | |
0085ce49 | 9928 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
9929 | |
9930 | def FindWindowByLabel(*args, **kwargs): | |
0085ce49 | 9931 | """ |
15afbcd0 RD |
9932 | FindWindowByLabel(String label, Window parent=None) -> Window |
9933 | ||
9934 | Find a window by its label. Depending on the type of window, the label | |
9935 | may be a window title or panel item label. If parent is None, the | |
9936 | search will start from all top-level frames and dialog boxes; if | |
9937 | non-None, the search will be limited to the given window | |
9938 | hierarchy. The search is recursive in both cases. | |
9939 | """ | |
0085ce49 | 9940 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
9941 | |
9942 | def Window_FromHWND(*args, **kwargs): | |
0085ce49 RD |
9943 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
9944 | return _core_.Window_FromHWND(*args, **kwargs) | |
b6b0383e | 9945 | |
0085ce49 RD |
9946 | def GetTopLevelWindows(*args): |
9947 | """ | |
b6b0383e RD |
9948 | GetTopLevelWindows() -> PyObject |
9949 | ||
9950 | Returns a list of the the application's top-level windows, (frames, | |
9951 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
9952 | by wxWidgets, and so it is only valid as long as no top-level windows | |
9953 | are closed or new top-level windows are created. | |
9954 | ||
9955 | """ | |
0085ce49 | 9956 | return _core_.GetTopLevelWindows(*args) |
e811c8ce RD |
9957 | #--------------------------------------------------------------------------- |
9958 | ||
9959 | class Validator(EvtHandler): | |
093d3ff1 | 9960 | """Proxy of C++ Validator class""" |
0085ce49 RD |
9961 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9962 | __repr__ = _swig_repr | |
9963 | def __init__(self, *args, **kwargs): | |
a95a7133 | 9964 | """__init__(self) -> Validator""" |
0085ce49 | 9965 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d14a1e28 | 9966 | self._setOORInfo(self) |
e811c8ce RD |
9967 | |
9968 | def Clone(*args, **kwargs): | |
a95a7133 | 9969 | """Clone(self) -> Validator""" |
54f9ee45 | 9970 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
9971 | |
9972 | def Validate(*args, **kwargs): | |
a95a7133 | 9973 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 9974 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
9975 | |
9976 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 9977 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 9978 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
9979 | |
9980 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 9981 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 9982 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
9983 | |
9984 | def GetWindow(*args, **kwargs): | |
a95a7133 | 9985 | """GetWindow(self) -> Window""" |
54f9ee45 | 9986 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
9987 | |
9988 | def SetWindow(*args, **kwargs): | |
a95a7133 | 9989 | """SetWindow(self, Window window)""" |
54f9ee45 | 9990 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
9991 | |
9992 | def IsSilent(*args, **kwargs): | |
66c033b4 | 9993 | """IsSilent() -> bool""" |
54f9ee45 | 9994 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
9995 | |
9996 | IsSilent = staticmethod(IsSilent) | |
9997 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 9998 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 9999 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10000 | |
10001 | SetBellOnError = staticmethod(SetBellOnError) | |
2131d850 | 10002 | _core_.Validator_swigregister(Validator) |
e811c8ce | 10003 | |
0085ce49 RD |
10004 | def Validator_IsSilent(*args): |
10005 | """Validator_IsSilent() -> bool""" | |
10006 | return _core_.Validator_IsSilent(*args) | |
e811c8ce RD |
10007 | |
10008 | def Validator_SetBellOnError(*args, **kwargs): | |
0085ce49 RD |
10009 | """Validator_SetBellOnError(int doIt=True)""" |
10010 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
e811c8ce RD |
10011 | |
10012 | class PyValidator(Validator): | |
093d3ff1 | 10013 | """Proxy of C++ PyValidator class""" |
0085ce49 RD |
10014 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10015 | __repr__ = _swig_repr | |
10016 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10017 | """__init__(self) -> PyValidator""" |
0085ce49 | 10018 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
e811c8ce RD |
10019 | |
10020 | self._setCallbackInfo(self, PyValidator, 1) | |
10021 | self._setOORInfo(self) | |
10022 | ||
10023 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 10024 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" |
54f9ee45 | 10025 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce | 10026 | |
2131d850 | 10027 | _core_.PyValidator_swigregister(PyValidator) |
e811c8ce RD |
10028 | |
10029 | #--------------------------------------------------------------------------- | |
10030 | ||
10031 | class Menu(EvtHandler): | |
093d3ff1 | 10032 | """Proxy of C++ Menu class""" |
0085ce49 RD |
10033 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10034 | __repr__ = _swig_repr | |
10035 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10036 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
0085ce49 | 10037 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
e811c8ce RD |
10038 | self._setOORInfo(self) |
10039 | ||
10040 | def Append(*args, **kwargs): | |
a95a7133 | 10041 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 10042 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
10043 | |
10044 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 10045 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 10046 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
10047 | |
10048 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 10049 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10050 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
10051 | |
10052 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 10053 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10054 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
10055 | |
10056 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 10057 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10058 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce | 10059 | |
50efceee RD |
10060 | def AppendSubMenu(*args, **kwargs): |
10061 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
10062 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
10063 | ||
e811c8ce | 10064 | def AppendItem(*args, **kwargs): |
a95a7133 | 10065 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10066 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce | 10067 | |
e811c8ce | 10068 | def InsertItem(*args, **kwargs): |
a95a7133 | 10069 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 10070 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce | 10071 | |
0085ce49 RD |
10072 | def PrependItem(*args, **kwargs): |
10073 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10074 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10075 | ||
10076 | def Break(*args, **kwargs): | |
10077 | """Break(self)""" | |
10078 | return _core_.Menu_Break(*args, **kwargs) | |
10079 | ||
e811c8ce | 10080 | def Insert(*args, **kwargs): |
0df68c9f | 10081 | """ |
a95a7133 | 10082 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
a41e16b6 | 10083 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 10084 | """ |
54f9ee45 | 10085 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
10086 | |
10087 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 10088 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 10089 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
10090 | |
10091 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 10092 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10093 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
10094 | |
10095 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 10096 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10097 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
10098 | |
10099 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 10100 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10101 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce | 10102 | |
e811c8ce | 10103 | def Prepend(*args, **kwargs): |
a95a7133 | 10104 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 10105 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
10106 | |
10107 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 10108 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 10109 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
10110 | |
10111 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 10112 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10113 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
10114 | |
10115 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 10116 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10117 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
10118 | |
10119 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 10120 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10121 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
10122 | |
10123 | def Remove(*args, **kwargs): | |
a95a7133 | 10124 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 10125 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce RD |
10126 | |
10127 | def RemoveItem(*args, **kwargs): | |
a95a7133 | 10128 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10129 | return _core_.Menu_RemoveItem(*args, **kwargs) |
e811c8ce RD |
10130 | |
10131 | def Delete(*args, **kwargs): | |
a95a7133 | 10132 | """Delete(self, int id) -> bool""" |
54f9ee45 | 10133 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
10134 | |
10135 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 10136 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 10137 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
10138 | |
10139 | def Destroy(*args, **kwargs): | |
0df68c9f | 10140 | """ |
a95a7133 | 10141 | Destroy(self) |
e811c8ce | 10142 | |
0df68c9f RD |
10143 | Deletes the C++ object this Python object is a proxy for. |
10144 | """ | |
7e08d4ef RD |
10145 | val = _core_.Menu_Destroy(*args, **kwargs) |
10146 | args[0].thisown = 0 | |
10147 | return val | |
e811c8ce RD |
10148 | |
10149 | def DestroyId(*args, **kwargs): | |
0df68c9f | 10150 | """ |
a95a7133 | 10151 | DestroyId(self, int id) -> bool |
e811c8ce | 10152 | |
0df68c9f RD |
10153 | Deletes the C++ object this Python object is a proxy for. |
10154 | """ | |
7e08d4ef RD |
10155 | val = _core_.Menu_DestroyId(*args, **kwargs) |
10156 | args[0].thisown = 0 | |
10157 | return val | |
e811c8ce RD |
10158 | |
10159 | def DestroyItem(*args, **kwargs): | |
0df68c9f | 10160 | """ |
a95a7133 | 10161 | DestroyItem(self, MenuItem item) -> bool |
e811c8ce | 10162 | |
0df68c9f RD |
10163 | Deletes the C++ object this Python object is a proxy for. |
10164 | """ | |
7e08d4ef RD |
10165 | val = _core_.Menu_DestroyItem(*args, **kwargs) |
10166 | args[0].thisown = 0 | |
10167 | return val | |
e811c8ce RD |
10168 | |
10169 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 10170 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 10171 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
10172 | |
10173 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 10174 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 10175 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
10176 | |
10177 | def FindItem(*args, **kwargs): | |
a95a7133 | 10178 | """FindItem(self, String item) -> int""" |
54f9ee45 | 10179 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
10180 | |
10181 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10182 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10183 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
10184 | |
10185 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 10186 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 10187 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
10188 | |
10189 | def Enable(*args, **kwargs): | |
a95a7133 | 10190 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10191 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
10192 | |
10193 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10194 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10195 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10196 | |
10197 | def Check(*args, **kwargs): | |
a95a7133 | 10198 | """Check(self, int id, bool check)""" |
54f9ee45 | 10199 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
10200 | |
10201 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10202 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10203 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
10204 | |
10205 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10206 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10207 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
10208 | |
10209 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10210 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10211 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
10212 | |
10213 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10214 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10215 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10216 | |
10217 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10218 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10219 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10220 | |
10221 | def SetTitle(*args, **kwargs): | |
a95a7133 | 10222 | """SetTitle(self, String title)""" |
54f9ee45 | 10223 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
10224 | |
10225 | def GetTitle(*args, **kwargs): | |
a95a7133 | 10226 | """GetTitle(self) -> String""" |
54f9ee45 | 10227 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
10228 | |
10229 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 10230 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 10231 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
10232 | |
10233 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 10234 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 10235 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
10236 | |
10237 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10238 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 10239 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10240 | |
10241 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10242 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 10243 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10244 | |
10245 | def GetStyle(*args, **kwargs): | |
a95a7133 | 10246 | """GetStyle(self) -> long""" |
54f9ee45 | 10247 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
10248 | |
10249 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 10250 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 10251 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
10252 | |
10253 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 10254 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 10255 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
10256 | |
10257 | def Attach(*args, **kwargs): | |
a95a7133 | 10258 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 10259 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
10260 | |
10261 | def Detach(*args, **kwargs): | |
a95a7133 | 10262 | """Detach(self)""" |
54f9ee45 | 10263 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
10264 | |
10265 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10266 | """IsAttached(self) -> bool""" |
54f9ee45 | 10267 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
10268 | |
10269 | def SetParent(*args, **kwargs): | |
a95a7133 | 10270 | """SetParent(self, Menu parent)""" |
54f9ee45 | 10271 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
10272 | |
10273 | def GetParent(*args, **kwargs): | |
a95a7133 | 10274 | """GetParent(self) -> Menu""" |
54f9ee45 | 10275 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 10276 | |
2131d850 | 10277 | _core_.Menu_swigregister(Menu) |
d14a1e28 RD |
10278 | DefaultValidator = cvar.DefaultValidator |
10279 | ||
10280 | #--------------------------------------------------------------------------- | |
10281 | ||
10282 | class MenuBar(Window): | |
093d3ff1 | 10283 | """Proxy of C++ MenuBar class""" |
0085ce49 RD |
10284 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10285 | __repr__ = _swig_repr | |
10286 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10287 | """__init__(self, long style=0) -> MenuBar""" |
0085ce49 | 10288 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d14a1e28 | 10289 | self._setOORInfo(self) |
e811c8ce RD |
10290 | |
10291 | def Append(*args, **kwargs): | |
a95a7133 | 10292 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 10293 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
10294 | |
10295 | def Insert(*args, **kwargs): | |
a95a7133 | 10296 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 10297 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
10298 | |
10299 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 10300 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 10301 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
10302 | |
10303 | def GetMenu(*args, **kwargs): | |
a95a7133 | 10304 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 10305 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
10306 | |
10307 | def Replace(*args, **kwargs): | |
a95a7133 | 10308 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 10309 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
10310 | |
10311 | def Remove(*args, **kwargs): | |
a95a7133 | 10312 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 10313 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
10314 | |
10315 | def EnableTop(*args, **kwargs): | |
a95a7133 | 10316 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 10317 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
10318 | |
10319 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 10320 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 10321 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
10322 | |
10323 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 10324 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 10325 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
10326 | |
10327 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 10328 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 10329 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
10330 | |
10331 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 10332 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 10333 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
10334 | |
10335 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10336 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10337 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
10338 | |
10339 | def FindMenu(*args, **kwargs): | |
a95a7133 | 10340 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 10341 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
10342 | |
10343 | def Enable(*args, **kwargs): | |
a95a7133 | 10344 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10345 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
10346 | |
10347 | def Check(*args, **kwargs): | |
a95a7133 | 10348 | """Check(self, int id, bool check)""" |
54f9ee45 | 10349 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
10350 | |
10351 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10352 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10353 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
10354 | |
10355 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10356 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10357 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10358 | |
10359 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10360 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10361 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
10362 | |
10363 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10364 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10365 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
10366 | |
10367 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10368 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10369 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10370 | |
10371 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10372 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10373 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10374 | |
10375 | def GetFrame(*args, **kwargs): | |
a95a7133 | 10376 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 10377 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
10378 | |
10379 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10380 | """IsAttached(self) -> bool""" |
54f9ee45 | 10381 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
10382 | |
10383 | def Attach(*args, **kwargs): | |
a95a7133 | 10384 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 10385 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
10386 | |
10387 | def Detach(*args, **kwargs): | |
a95a7133 | 10388 | """Detach(self)""" |
54f9ee45 | 10389 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 10390 | |
587d0f36 RD |
10391 | def UpdateMenus(*args, **kwargs): |
10392 | """UpdateMenus(self)""" | |
10393 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
10394 | ||
4f433fef RD |
10395 | def SetAutoWindowMenu(*args, **kwargs): |
10396 | """SetAutoWindowMenu(bool enable)""" | |
10397 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10398 | ||
10399 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10400 | def GetAutoWindowMenu(*args, **kwargs): | |
10401 | """GetAutoWindowMenu() -> bool""" | |
10402 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10403 | ||
10404 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
2131d850 | 10405 | _core_.MenuBar_swigregister(MenuBar) |
d14a1e28 | 10406 | |
4f433fef | 10407 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
0085ce49 RD |
10408 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
10409 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 10410 | |
0085ce49 RD |
10411 | def MenuBar_GetAutoWindowMenu(*args): |
10412 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10413 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 10414 | |
d14a1e28 RD |
10415 | #--------------------------------------------------------------------------- |
10416 | ||
10417 | class MenuItem(Object): | |
093d3ff1 | 10418 | """Proxy of C++ MenuItem class""" |
0085ce49 RD |
10419 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10420 | __repr__ = _swig_repr | |
10421 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10422 | """ |
a95a7133 | 10423 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
196addbf RD |
10424 | String help=EmptyString, int kind=ITEM_NORMAL, |
10425 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 10426 | """ |
0085ce49 RD |
10427 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
10428 | __swig_destroy__ = _core_.delete_MenuItem | |
10429 | __del__ = lambda self : None; | |
e811c8ce | 10430 | def GetMenu(*args, **kwargs): |
a95a7133 | 10431 | """GetMenu(self) -> Menu""" |
54f9ee45 | 10432 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
10433 | |
10434 | def SetMenu(*args, **kwargs): | |
a95a7133 | 10435 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 10436 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
10437 | |
10438 | def SetId(*args, **kwargs): | |
a95a7133 | 10439 | """SetId(self, int id)""" |
54f9ee45 | 10440 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
10441 | |
10442 | def GetId(*args, **kwargs): | |
a95a7133 | 10443 | """GetId(self) -> int""" |
54f9ee45 | 10444 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
10445 | |
10446 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 10447 | """IsSeparator(self) -> bool""" |
54f9ee45 | 10448 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
10449 | |
10450 | def SetText(*args, **kwargs): | |
a95a7133 | 10451 | """SetText(self, String str)""" |
54f9ee45 | 10452 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
10453 | |
10454 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10455 | """GetLabel(self) -> String""" |
54f9ee45 | 10456 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
10457 | |
10458 | def GetText(*args, **kwargs): | |
a95a7133 | 10459 | """GetText(self) -> String""" |
54f9ee45 | 10460 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
10461 | |
10462 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 10463 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 10464 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
10465 | |
10466 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10467 | def GetKind(*args, **kwargs): | |
a95a7133 | 10468 | """GetKind(self) -> int""" |
54f9ee45 | 10469 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 10470 | |
a95a7133 RD |
10471 | def SetKind(*args, **kwargs): |
10472 | """SetKind(self, int kind)""" | |
54f9ee45 | 10473 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 10474 | |
e811c8ce | 10475 | def SetCheckable(*args, **kwargs): |
a95a7133 | 10476 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 10477 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
10478 | |
10479 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 10480 | """IsCheckable(self) -> bool""" |
54f9ee45 | 10481 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
10482 | |
10483 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 10484 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 10485 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
10486 | |
10487 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 10488 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 10489 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
10490 | |
10491 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 10492 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 10493 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
10494 | |
10495 | def Enable(*args, **kwargs): | |
a95a7133 | 10496 | """Enable(self, bool enable=True)""" |
54f9ee45 | 10497 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
10498 | |
10499 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10500 | """IsEnabled(self) -> bool""" |
54f9ee45 | 10501 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10502 | |
10503 | def Check(*args, **kwargs): | |
a95a7133 | 10504 | """Check(self, bool check=True)""" |
54f9ee45 | 10505 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
10506 | |
10507 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10508 | """IsChecked(self) -> bool""" |
54f9ee45 | 10509 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
10510 | |
10511 | def Toggle(*args, **kwargs): | |
a95a7133 | 10512 | """Toggle(self)""" |
54f9ee45 | 10513 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
10514 | |
10515 | def SetHelp(*args, **kwargs): | |
a95a7133 | 10516 | """SetHelp(self, String str)""" |
54f9ee45 | 10517 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
10518 | |
10519 | def GetHelp(*args, **kwargs): | |
a95a7133 | 10520 | """GetHelp(self) -> String""" |
54f9ee45 | 10521 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
10522 | |
10523 | def GetAccel(*args, **kwargs): | |
a95a7133 | 10524 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 10525 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
10526 | |
10527 | def SetAccel(*args, **kwargs): | |
a95a7133 | 10528 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 10529 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 10530 | |
091f5bed RD |
10531 | def SetBitmap(*args, **kwargs): |
10532 | """SetBitmap(self, Bitmap bitmap)""" | |
10533 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10534 | ||
10535 | def GetBitmap(*args, **kwargs): | |
10536 | """GetBitmap(self) -> Bitmap""" | |
10537 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10538 | ||
c1280d1e RD |
10539 | def SetFont(*args, **kwargs): |
10540 | """SetFont(self, Font font)""" | |
10541 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10542 | ||
10543 | def GetFont(*args, **kwargs): | |
10544 | """GetFont(self) -> Font""" | |
10545 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10546 | ||
10547 | def SetTextColour(*args, **kwargs): | |
10548 | """SetTextColour(self, Colour colText)""" | |
10549 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10550 | ||
10551 | def GetTextColour(*args, **kwargs): | |
10552 | """GetTextColour(self) -> Colour""" | |
10553 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10554 | ||
10555 | def SetBackgroundColour(*args, **kwargs): | |
10556 | """SetBackgroundColour(self, Colour colBack)""" | |
10557 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10558 | ||
10559 | def GetBackgroundColour(*args, **kwargs): | |
10560 | """GetBackgroundColour(self) -> Colour""" | |
10561 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10562 | ||
10563 | def SetBitmaps(*args, **kwargs): | |
10564 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10565 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10566 | ||
10567 | def SetDisabledBitmap(*args, **kwargs): | |
10568 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10569 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10570 | ||
10571 | def GetDisabledBitmap(*args, **kwargs): | |
10572 | """GetDisabledBitmap(self) -> Bitmap""" | |
10573 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10574 | ||
10575 | def SetMarginWidth(*args, **kwargs): | |
10576 | """SetMarginWidth(self, int nWidth)""" | |
10577 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10578 | ||
10579 | def GetMarginWidth(*args, **kwargs): | |
10580 | """GetMarginWidth(self) -> int""" | |
10581 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10582 | ||
e811c8ce | 10583 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 10584 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 10585 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
10586 | |
10587 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10588 | def IsOwnerDrawn(*args, **kwargs): |
10589 | """IsOwnerDrawn(self) -> bool""" | |
10590 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10591 | ||
10592 | def SetOwnerDrawn(*args, **kwargs): | |
10593 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10594 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10595 | ||
10596 | def ResetOwnerDrawn(*args, **kwargs): | |
10597 | """ResetOwnerDrawn(self)""" | |
10598 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10599 | ||
2131d850 | 10600 | _core_.MenuItem_swigregister(MenuItem) |
d14a1e28 | 10601 | |
e811c8ce | 10602 | def MenuItem_GetLabelFromText(*args, **kwargs): |
0085ce49 RD |
10603 | """MenuItem_GetLabelFromText(String text) -> String""" |
10604 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d14a1e28 | 10605 | |
0085ce49 RD |
10606 | def MenuItem_GetDefaultMarginWidth(*args): |
10607 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10608 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d14a1e28 RD |
10609 | |
10610 | #--------------------------------------------------------------------------- | |
10611 | ||
10612 | class Control(Window): | |
15afbcd0 RD |
10613 | """ |
10614 | This is the base class for a control or 'widget'. | |
10615 | ||
41e2b43e RD |
10616 | A control is generally a small window which processes user input |
10617 | and/or displays one or more item of data. | |
15afbcd0 | 10618 | """ |
0085ce49 RD |
10619 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10620 | __repr__ = _swig_repr | |
10621 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10622 | """ |
248ed943 RD |
10623 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10624 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10625 | String name=ControlNameStr) -> Control |
15afbcd0 | 10626 | |
41e2b43e RD |
10627 | Create a Control. Normally you should only call this from a subclass' |
10628 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 10629 | """ |
0085ce49 | 10630 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d14a1e28 | 10631 | self._setOORInfo(self) |
e811c8ce RD |
10632 | |
10633 | def Create(*args, **kwargs): | |
0df68c9f | 10634 | """ |
248ed943 RD |
10635 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10636 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10637 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
10638 | |
10639 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 10640 | """ |
54f9ee45 | 10641 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce | 10642 | |
10044bf1 RD |
10643 | def GetAlignment(*args, **kwargs): |
10644 | """ | |
10645 | GetAlignment(self) -> int | |
10646 | ||
10647 | Get the control alignment (left/right/centre, top/bottom/centre) | |
10648 | """ | |
10649 | return _core_.Control_GetAlignment(*args, **kwargs) | |
10650 | ||
34e0a3bb | 10651 | def GetLabelText(*args, **kwargs): |
10044bf1 | 10652 | """ |
10044bf1 RD |
10653 | GetLabelText(self) -> String |
10654 | ||
10655 | Get just the text of the label, without mnemonic characters ('&') | |
10656 | """ | |
34e0a3bb | 10657 | return _core_.Control_GetLabelText(*args, **kwargs) |
10044bf1 | 10658 | |
e811c8ce | 10659 | def Command(*args, **kwargs): |
15afbcd0 | 10660 | """ |
a95a7133 | 10661 | Command(self, CommandEvent event) |
15afbcd0 | 10662 | |
41e2b43e RD |
10663 | Simulates the effect of the user issuing a command to the item. |
10664 | ||
10665 | :see: `wx.CommandEvent` | |
10666 | ||
15afbcd0 | 10667 | """ |
54f9ee45 | 10668 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce RD |
10669 | |
10670 | def GetLabel(*args, **kwargs): | |
15afbcd0 | 10671 | """ |
a95a7133 | 10672 | GetLabel(self) -> String |
15afbcd0 RD |
10673 | |
10674 | Return a control's text. | |
10675 | """ | |
54f9ee45 | 10676 | return _core_.Control_GetLabel(*args, **kwargs) |
e811c8ce | 10677 | |
74a57fcd | 10678 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
10679 | """ |
10680 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10681 | ||
10682 | Get the default attributes for this class. This is useful if you want | |
10683 | to use the same font or colour in your own control as in a standard | |
10684 | control -- which is a much better idea than hard coding specific | |
10685 | colours or fonts which might look completely out of place on the | |
10686 | user's system, especially if it uses themes. | |
10687 | ||
10688 | The variant parameter is only relevant under Mac currently and is | |
10689 | ignore under other platforms. Under Mac, it will change the size of | |
10690 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10691 | this. | |
10692 | """ | |
54f9ee45 | 10693 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
10694 | |
10695 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2bf58437 RD |
10696 | Alignment = property(GetAlignment,doc="See `GetAlignment`") |
10697 | Label = property(GetLabel,doc="See `GetLabel`") | |
10698 | LabelText = property(GetLabelText,doc="See `GetLabelText`") | |
2131d850 | 10699 | _core_.Control_swigregister(Control) |
b2dc1044 | 10700 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
10701 | |
10702 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
10703 | """ |
10704 | PreControl() -> Control | |
10705 | ||
10706 | Precreate a Control control for 2-phase creation | |
10707 | """ | |
54f9ee45 | 10708 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
10709 | return val |
10710 | ||
74a57fcd | 10711 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10712 | """ |
110da5b0 RD |
10713 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10714 | ||
10715 | Get the default attributes for this class. This is useful if you want | |
10716 | to use the same font or colour in your own control as in a standard | |
10717 | control -- which is a much better idea than hard coding specific | |
10718 | colours or fonts which might look completely out of place on the | |
10719 | user's system, especially if it uses themes. | |
10720 | ||
10721 | The variant parameter is only relevant under Mac currently and is | |
10722 | ignore under other platforms. Under Mac, it will change the size of | |
10723 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10724 | this. | |
10725 | """ | |
0085ce49 | 10726 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10727 | |
d14a1e28 RD |
10728 | #--------------------------------------------------------------------------- |
10729 | ||
10730 | class ItemContainer(object): | |
15afbcd0 | 10731 | """ |
53aa7709 RD |
10732 | The wx.ItemContainer class defines an interface which is implemented |
10733 | by all controls which have string subitems, each of which may be | |
10734 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10735 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 10736 | this one. |
15afbcd0 | 10737 | |
41e2b43e RD |
10738 | It defines the methods for accessing the control's items and although |
10739 | each of the derived classes implements them differently, they still | |
10740 | all conform to the same interface. | |
15afbcd0 | 10741 | |
41e2b43e RD |
10742 | The items in a wx.ItemContainer have (non empty) string labels and, |
10743 | optionally, client data associated with them. | |
15afbcd0 RD |
10744 | |
10745 | """ | |
0085ce49 RD |
10746 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10747 | def __init__(self): raise AttributeError, "No constructor defined" | |
10748 | __repr__ = _swig_repr | |
e811c8ce | 10749 | def Append(*args, **kwargs): |
15afbcd0 | 10750 | """ |
a95a7133 | 10751 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 10752 | |
41e2b43e RD |
10753 | Adds the item to the control, associating the given data with the item |
10754 | if not None. The return value is the index of the newly added item | |
10755 | which may be different from the last one if the control is sorted (e.g. | |
10756 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 10757 | """ |
54f9ee45 | 10758 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
10759 | |
10760 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 10761 | """ |
f5b96ee1 | 10762 | AppendItems(self, List strings) |
15afbcd0 | 10763 | |
41e2b43e RD |
10764 | Apend several items at once to the control. Notice that calling this |
10765 | method may be much faster than appending the items one by one if you | |
10766 | need to add a lot of items. | |
15afbcd0 | 10767 | """ |
54f9ee45 | 10768 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
10769 | |
10770 | def Insert(*args, **kwargs): | |
15afbcd0 | 10771 | """ |
50f151d7 | 10772 | Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int |
15afbcd0 | 10773 | |
41e2b43e | 10774 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
10775 | optionally associating some data object with the item. |
10776 | """ | |
54f9ee45 | 10777 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
10778 | |
10779 | def Clear(*args, **kwargs): | |
15afbcd0 | 10780 | """ |
a95a7133 | 10781 | Clear(self) |
15afbcd0 RD |
10782 | |
10783 | Removes all items from the control. | |
10784 | """ | |
54f9ee45 | 10785 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
10786 | |
10787 | def Delete(*args, **kwargs): | |
15afbcd0 | 10788 | """ |
50f151d7 | 10789 | Delete(self, unsigned int n) |
15afbcd0 | 10790 | |
41e2b43e RD |
10791 | Deletes the item at the zero-based index 'n' from the control. Note |
10792 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
10793 | enabled) to remove an item with the index negative or greater or equal | |
10794 | than the number of items in the control. | |
15afbcd0 | 10795 | """ |
54f9ee45 | 10796 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 10797 | |
53aa7709 RD |
10798 | def GetClientData(*args, **kwargs): |
10799 | """ | |
50f151d7 | 10800 | GetClientData(self, unsigned int n) -> PyObject |
53aa7709 RD |
10801 | |
10802 | Returns the client data associated with the given item, (if any.) | |
10803 | """ | |
10804 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
10805 | ||
10806 | def SetClientData(*args, **kwargs): | |
10807 | """ | |
50f151d7 | 10808 | SetClientData(self, unsigned int n, PyObject clientData) |
53aa7709 RD |
10809 | |
10810 | Associate the given client data with the item at position n. | |
10811 | """ | |
10812 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
10813 | ||
e811c8ce | 10814 | def GetCount(*args, **kwargs): |
15afbcd0 | 10815 | """ |
50f151d7 | 10816 | GetCount(self) -> unsigned int |
15afbcd0 RD |
10817 | |
10818 | Returns the number of items in the control. | |
10819 | """ | |
54f9ee45 | 10820 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
10821 | |
10822 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 10823 | """ |
a95a7133 | 10824 | IsEmpty(self) -> bool |
15afbcd0 RD |
10825 | |
10826 | Returns True if the control is empty or False if it has some items. | |
10827 | """ | |
54f9ee45 | 10828 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
10829 | |
10830 | def GetString(*args, **kwargs): | |
15afbcd0 | 10831 | """ |
50f151d7 | 10832 | GetString(self, unsigned int n) -> String |
15afbcd0 RD |
10833 | |
10834 | Returns the label of the item with the given index. | |
10835 | """ | |
54f9ee45 | 10836 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
10837 | |
10838 | def GetStrings(*args, **kwargs): | |
a95a7133 | 10839 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 10840 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
10841 | |
10842 | def SetString(*args, **kwargs): | |
15afbcd0 | 10843 | """ |
50f151d7 | 10844 | SetString(self, unsigned int n, String s) |
15afbcd0 RD |
10845 | |
10846 | Sets the label for the given item. | |
10847 | """ | |
54f9ee45 | 10848 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
10849 | |
10850 | def FindString(*args, **kwargs): | |
15afbcd0 | 10851 | """ |
a95a7133 | 10852 | FindString(self, String s) -> int |
15afbcd0 RD |
10853 | |
10854 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
10855 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
10856 | found. | |
15afbcd0 | 10857 | """ |
54f9ee45 | 10858 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 10859 | |
53aa7709 | 10860 | def SetSelection(*args, **kwargs): |
15afbcd0 | 10861 | """ |
53aa7709 | 10862 | SetSelection(self, int n) |
15afbcd0 RD |
10863 | |
10864 | Sets the item at index 'n' to be the selected item. | |
10865 | """ | |
53aa7709 | 10866 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
10867 | |
10868 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 10869 | """ |
a95a7133 | 10870 | GetSelection(self) -> int |
15afbcd0 | 10871 | |
41e2b43e RD |
10872 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
10873 | is selected. | |
15afbcd0 | 10874 | """ |
54f9ee45 | 10875 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 10876 | |
53aa7709 RD |
10877 | def SetStringSelection(*args, **kwargs): |
10878 | """SetStringSelection(self, String s) -> bool""" | |
10879 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
10880 | ||
e811c8ce | 10881 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 10882 | """ |
a95a7133 | 10883 | GetStringSelection(self) -> String |
15afbcd0 | 10884 | |
41e2b43e RD |
10885 | Returns the label of the selected item or an empty string if no item |
10886 | is selected. | |
15afbcd0 | 10887 | """ |
54f9ee45 | 10888 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 10889 | |
53aa7709 | 10890 | def Select(*args, **kwargs): |
15afbcd0 | 10891 | """ |
53aa7709 | 10892 | Select(self, int n) |
15afbcd0 | 10893 | |
53aa7709 RD |
10894 | This is the same as `SetSelection` and exists only because it is |
10895 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 10896 | """ |
53aa7709 | 10897 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 10898 | |
2131d850 | 10899 | _core_.ItemContainer_swigregister(ItemContainer) |
d14a1e28 RD |
10900 | |
10901 | #--------------------------------------------------------------------------- | |
10902 | ||
10903 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 10904 | """ |
41e2b43e RD |
10905 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
10906 | wx.Control class, and is used for the base class of various controls | |
10907 | that have items. | |
15afbcd0 | 10908 | """ |
0085ce49 RD |
10909 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10910 | def __init__(self): raise AttributeError, "No constructor defined" | |
10911 | __repr__ = _swig_repr | |
2131d850 | 10912 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d14a1e28 RD |
10913 | |
10914 | #--------------------------------------------------------------------------- | |
10915 | ||
10916 | class SizerItem(Object): | |
248ed943 RD |
10917 | """ |
10918 | The wx.SizerItem class is used to track the position, size and other | |
01f6b6d3 RD |
10919 | attributes of each item managed by a `wx.Sizer`. It is not usually |
10920 | necessary to use this class because the sizer elements can also be | |
10921 | identified by their positions or window or sizer references but | |
10922 | sometimes it may be more convenient to use wx.SizerItem directly. | |
10923 | Also, custom classes derived from `wx.PySizer` will probably need to | |
10924 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
10925 | layout. | |
248ed943 RD |
10926 | |
10927 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
10928 | """ | |
0085ce49 RD |
10929 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10930 | __repr__ = _swig_repr | |
10931 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10932 | """ |
10933 | __init__(self) -> SizerItem | |
10934 | ||
10935 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
10936 | size will need to be set before this item can be used in a Sizer. | |
10937 | ||
10938 | You will probably never need to create a wx.SizerItem directly as they | |
10939 | are created automatically when the sizer's Add, Insert or Prepend | |
10940 | methods are called. | |
10941 | ||
10942 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
10943 | """ | |
0085ce49 RD |
10944 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
10945 | __swig_destroy__ = _core_.delete_SizerItem | |
10946 | __del__ = lambda self : None; | |
e811c8ce | 10947 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
10948 | """ |
10949 | DeleteWindows(self) | |
10950 | ||
10951 | Destroy the window or the windows in a subsizer, depending on the type | |
10952 | of item. | |
10953 | """ | |
54f9ee45 | 10954 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
10955 | |
10956 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
10957 | """ |
10958 | DetachSizer(self) | |
10959 | ||
10960 | Enable deleting the SizerItem without destroying the contained sizer. | |
10961 | """ | |
54f9ee45 | 10962 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
10963 | |
10964 | def GetSize(*args, **kwargs): | |
248ed943 RD |
10965 | """ |
10966 | GetSize(self) -> Size | |
10967 | ||
10968 | Get the current size of the item, as set in the last Layout. | |
10969 | """ | |
54f9ee45 | 10970 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
10971 | |
10972 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
10973 | """ |
10974 | CalcMin(self) -> Size | |
10975 | ||
10976 | Calculates the minimum desired size for the item, including any space | |
10977 | needed by borders. | |
10978 | """ | |
54f9ee45 | 10979 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
10980 | |
10981 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
10982 | """ |
10983 | SetDimension(self, Point pos, Size size) | |
10984 | ||
10985 | Set the position and size of the space allocated for this item by the | |
10986 | sizer, and adjust the position and size of the item (window or | |
10987 | subsizer) to be within that space taking alignment and borders into | |
10988 | account. | |
10989 | """ | |
54f9ee45 | 10990 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
10991 | |
10992 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
10993 | """ |
10994 | GetMinSize(self) -> Size | |
10995 | ||
10996 | Get the minimum size needed for the item. | |
10997 | """ | |
54f9ee45 | 10998 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 10999 | |
dfbb5885 RD |
11000 | def GetMinSizeWithBorder(*args, **kwargs): |
11001 | """ | |
11002 | GetMinSizeWithBorder(self) -> Size | |
11003 | ||
11004 | Get the minimum size needed for the item with space for the borders | |
11005 | added, if needed. | |
11006 | """ | |
11007 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11008 | ||
e811c8ce | 11009 | def SetInitSize(*args, **kwargs): |
a95a7133 | 11010 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 11011 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
11012 | |
11013 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
11014 | """ |
11015 | SetRatioWH(self, int width, int height) | |
11016 | ||
11017 | Set the ratio item attribute. | |
11018 | """ | |
54f9ee45 | 11019 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
11020 | |
11021 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
11022 | """ |
11023 | SetRatioSize(self, Size size) | |
11024 | ||
11025 | Set the ratio item attribute. | |
11026 | """ | |
54f9ee45 | 11027 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
11028 | |
11029 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
11030 | """ |
11031 | SetRatio(self, float ratio) | |
11032 | ||
11033 | Set the ratio item attribute. | |
11034 | """ | |
54f9ee45 | 11035 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
11036 | |
11037 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
11038 | """ |
11039 | GetRatio(self) -> float | |
11040 | ||
11041 | Set the ratio item attribute. | |
11042 | """ | |
54f9ee45 | 11043 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 11044 | |
d3b6e4ff RD |
11045 | def GetRect(*args, **kwargs): |
11046 | """ | |
11047 | GetRect(self) -> Rect | |
11048 | ||
11049 | Returns the rectangle that the sizer item should occupy | |
11050 | """ | |
11051 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
11052 | ||
e811c8ce | 11053 | def IsWindow(*args, **kwargs): |
248ed943 RD |
11054 | """ |
11055 | IsWindow(self) -> bool | |
11056 | ||
11057 | Is this sizer item a window? | |
11058 | """ | |
54f9ee45 | 11059 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
11060 | |
11061 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
11062 | """ |
11063 | IsSizer(self) -> bool | |
11064 | ||
11065 | Is this sizer item a subsizer? | |
11066 | """ | |
54f9ee45 | 11067 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
11068 | |
11069 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
11070 | """ |
11071 | IsSpacer(self) -> bool | |
11072 | ||
11073 | Is this sizer item a spacer? | |
11074 | """ | |
54f9ee45 | 11075 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
11076 | |
11077 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
11078 | """ |
11079 | SetProportion(self, int proportion) | |
11080 | ||
11081 | Set the proportion value for this item. | |
11082 | """ | |
54f9ee45 | 11083 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
11084 | |
11085 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
11086 | """ |
11087 | GetProportion(self) -> int | |
11088 | ||
11089 | Get the proportion value for this item. | |
11090 | """ | |
54f9ee45 | 11091 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 11092 | |
248ed943 RD |
11093 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11094 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 11095 | def SetFlag(*args, **kwargs): |
248ed943 RD |
11096 | """ |
11097 | SetFlag(self, int flag) | |
11098 | ||
11099 | Set the flag value for this item. | |
11100 | """ | |
54f9ee45 | 11101 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
11102 | |
11103 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
11104 | """ |
11105 | GetFlag(self) -> int | |
11106 | ||
11107 | Get the flag value for this item. | |
11108 | """ | |
54f9ee45 | 11109 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
11110 | |
11111 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
11112 | """ |
11113 | SetBorder(self, int border) | |
11114 | ||
11115 | Set the border value for this item. | |
11116 | """ | |
54f9ee45 | 11117 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
11118 | |
11119 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
11120 | """ |
11121 | GetBorder(self) -> int | |
11122 | ||
11123 | Get the border value for this item. | |
11124 | """ | |
54f9ee45 | 11125 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
11126 | |
11127 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
11128 | """ |
11129 | GetWindow(self) -> Window | |
11130 | ||
11131 | Get the window (if any) that is managed by this sizer item. | |
11132 | """ | |
54f9ee45 | 11133 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce RD |
11134 | |
11135 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
11136 | """ |
11137 | SetWindow(self, Window window) | |
11138 | ||
11139 | Set the window to be managed by this sizer item. | |
11140 | """ | |
54f9ee45 | 11141 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
e811c8ce RD |
11142 | |
11143 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
11144 | """ |
11145 | GetSizer(self) -> Sizer | |
11146 | ||
11147 | Get the subsizer (if any) that is managed by this sizer item. | |
11148 | """ | |
54f9ee45 | 11149 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce RD |
11150 | |
11151 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
11152 | """ |
11153 | SetSizer(self, Sizer sizer) | |
11154 | ||
11155 | Set the subsizer to be managed by this sizer item. | |
11156 | """ | |
54f9ee45 | 11157 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce RD |
11158 | |
11159 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
11160 | """ |
11161 | GetSpacer(self) -> Size | |
11162 | ||
11163 | Get the size of the spacer managed by this sizer item. | |
11164 | """ | |
54f9ee45 | 11165 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
e811c8ce RD |
11166 | |
11167 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
11168 | """ |
11169 | SetSpacer(self, Size size) | |
11170 | ||
11171 | Set the size of the spacer to be managed by this sizer item. | |
11172 | """ | |
54f9ee45 | 11173 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce RD |
11174 | |
11175 | def Show(*args, **kwargs): | |
248ed943 RD |
11176 | """ |
11177 | Show(self, bool show) | |
11178 | ||
11179 | Set the show item attribute, which sizers use to determine if the item | |
11180 | is to be made part of the layout or not. If the item is tracking a | |
11181 | window then it is shown or hidden as needed. | |
11182 | """ | |
54f9ee45 | 11183 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
11184 | |
11185 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11186 | """ |
11187 | IsShown(self) -> bool | |
11188 | ||
11189 | Is the item to be shown in the layout? | |
11190 | """ | |
54f9ee45 | 11191 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
11192 | |
11193 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11194 | """ |
11195 | GetPosition(self) -> Point | |
11196 | ||
11197 | Returns the current position of the item, as set in the last Layout. | |
11198 | """ | |
54f9ee45 | 11199 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
11200 | |
11201 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
11202 | """ |
11203 | GetUserData(self) -> PyObject | |
11204 | ||
11205 | Returns the userData associated with this sizer item, or None if there | |
11206 | isn't any. | |
11207 | """ | |
54f9ee45 | 11208 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 11209 | |
091f5bed RD |
11210 | def SetUserData(*args, **kwargs): |
11211 | """ | |
11212 | SetUserData(self, PyObject userData) | |
11213 | ||
11214 | Associate a Python object with this sizer item. | |
11215 | """ | |
11216 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
11217 | ||
2131d850 | 11218 | _core_.SizerItem_swigregister(SizerItem) |
d14a1e28 | 11219 | |
248ed943 | 11220 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 11221 | """ |
248ed943 RD |
11222 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11223 | PyObject userData=None) -> SizerItem | |
11224 | ||
11225 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 11226 | """ |
248ed943 | 11227 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
11228 | return val |
11229 | ||
248ed943 | 11230 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 11231 | """ |
248ed943 RD |
11232 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
11233 | PyObject userData=None) -> SizerItem | |
11234 | ||
11235 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 11236 | """ |
248ed943 | 11237 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
11238 | return val |
11239 | ||
11240 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
11241 | """ |
11242 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
11243 | PyObject userData=None) -> SizerItem |
11244 | ||
11245 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 11246 | """ |
54f9ee45 | 11247 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
11248 | return val |
11249 | ||
11250 | class Sizer(Object): | |
248ed943 RD |
11251 | """ |
11252 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11253 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11254 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
1d5ee749 RD |
11255 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and |
11256 | `wx.GridBagSizer`. | |
248ed943 RD |
11257 | |
11258 | The concept implemented by sizers in wxWidgets is closely related to | |
11259 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11260 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11261 | subwindows reporting their minimal required size and their ability to | |
11262 | get stretched if the size of the parent window has changed. This will | |
11263 | most often mean that the programmer does not set the original size of | |
11264 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11265 | this sizer will be queried about the recommended size. The sizer in | |
11266 | turn will query its children, which can be normal windows or contorls, | |
11267 | empty space or other sizers, so that a hierarchy of sizers can be | |
11268 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11269 | do not interfere with tab ordering and requires very little resources | |
11270 | compared to a real window on screen. | |
11271 | ||
11272 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11273 | every control reports its own minimal size and the algorithm can | |
11274 | handle differences in font sizes or different window (dialog item) | |
11275 | sizes on different platforms without problems. If for example the | |
11276 | standard font as well as the overall design of Mac widgets requires | |
11277 | more space than on Windows, then the initial size of a dialog using a | |
11278 | sizer will automatically be bigger on Mac than on Windows. | |
11279 | """ | |
0085ce49 RD |
11280 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11281 | def __init__(self): raise AttributeError, "No constructor defined" | |
11282 | __repr__ = _swig_repr | |
11283 | __swig_destroy__ = _core_.delete_Sizer | |
11284 | __del__ = lambda self : None; | |
e811c8ce | 11285 | def _setOORInfo(*args, **kwargs): |
a95a7133 | 11286 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 11287 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
11288 | |
11289 | def Add(*args, **kwargs): | |
0df68c9f | 11290 | """ |
248ed943 | 11291 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11292 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11293 | |
11294 | Appends a child item to the sizer. | |
0df68c9f | 11295 | """ |
54f9ee45 | 11296 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce RD |
11297 | |
11298 | def Insert(*args, **kwargs): | |
0df68c9f | 11299 | """ |
248ed943 | 11300 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11301 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11302 | |
11303 | Inserts a new item into the list of items managed by this sizer before | |
11304 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 11305 | """ |
54f9ee45 | 11306 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce RD |
11307 | |
11308 | def Prepend(*args, **kwargs): | |
0df68c9f | 11309 | """ |
248ed943 | 11310 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11311 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11312 | |
11313 | Adds a new item to the begining of the list of sizer items managed by | |
11314 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 11315 | """ |
54f9ee45 | 11316 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce RD |
11317 | |
11318 | def Remove(*args, **kwargs): | |
248ed943 RD |
11319 | """ |
11320 | Remove(self, item) -> bool | |
11321 | ||
11322 | Removes an item from the sizer and destroys it. This method does not | |
11323 | cause any layout or resizing to take place, call `Layout` to update | |
11324 | the layout on screen after removing a child from the sizer. The | |
11325 | *item* parameter can be either a window, a sizer, or the zero-based | |
11326 | index of an item to remove. Returns True if the child item was found | |
11327 | and removed. | |
11328 | """ | |
54f9ee45 | 11329 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 11330 | |
1c0f361b | 11331 | def Detach(*args, **kwargs): |
248ed943 RD |
11332 | """ |
11333 | Detach(self, item) -> bool | |
11334 | ||
11335 | Detaches an item from the sizer without destroying it. This method | |
11336 | does not cause any layout or resizing to take place, call `Layout` to | |
11337 | do so. The *item* parameter can be either a window, a sizer, or the | |
11338 | zero-based index of the item to be detached. Returns True if the child item | |
11339 | was found and detached. | |
11340 | """ | |
1c0f361b RD |
11341 | return _core_.Sizer_Detach(*args, **kwargs) |
11342 | ||
d3b6e4ff RD |
11343 | def GetItem(*args, **kwargs): |
11344 | """ | |
11345 | GetItem(self, item) -> wx.SizerItem | |
11346 | ||
11347 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11348 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11349 | the item to be found. |
d3b6e4ff RD |
11350 | """ |
11351 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11352 | ||
e811c8ce | 11353 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 11354 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 11355 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 11356 | |
248ed943 RD |
11357 | def SetItemMinSize(self, item, *args): |
11358 | """ | |
11359 | SetItemMinSize(self, item, Size size) | |
11360 | ||
11361 | Sets the minimum size that will be allocated for an item in the sizer. | |
11362 | The *item* parameter can be either a window, a sizer, or the | |
11363 | zero-based index of the item. If a window or sizer is given then it | |
11364 | will be searched for recursivly in subsizers if neccessary. | |
11365 | """ | |
11366 | if len(args) == 2: | |
11367 | # for backward compatibility accept separate width,height args too | |
11368 | return self._SetItemMinSize(item, args) | |
11369 | else: | |
11370 | return self._SetItemMinSize(item, args[0]) | |
11371 | ||
e811c8ce | 11372 | def AddItem(*args, **kwargs): |
248ed943 RD |
11373 | """ |
11374 | AddItem(self, SizerItem item) | |
11375 | ||
11376 | Adds a `wx.SizerItem` to the sizer. | |
11377 | """ | |
54f9ee45 | 11378 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
11379 | |
11380 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11381 | """ |
11382 | InsertItem(self, int index, SizerItem item) | |
11383 | ||
11384 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11385 | """ | |
54f9ee45 | 11386 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
11387 | |
11388 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11389 | """ |
11390 | PrependItem(self, SizerItem item) | |
11391 | ||
11392 | Prepends a `wx.SizerItem` to the sizer. | |
11393 | """ | |
54f9ee45 | 11394 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 11395 | |
248ed943 | 11396 | def AddMany(self, items): |
66c033b4 RD |
11397 | """ |
11398 | AddMany is a convenience method for adding several items | |
11399 | to a sizer at one time. Simply pass it a list of tuples, | |
11400 | where each tuple consists of the parameters that you | |
11401 | would normally pass to the `Add` method. | |
11402 | """ | |
248ed943 RD |
11403 | for item in items: |
11404 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11405 | item = (item, ) | |
11406 | self.Add(*item) | |
d14a1e28 | 11407 | |
74e96f3d | 11408 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
11409 | def AddWindow(self, *args, **kw): |
11410 | """Compatibility alias for `Add`.""" | |
11411 | return self.Add(*args, **kw) | |
11412 | def AddSizer(self, *args, **kw): | |
11413 | """Compatibility alias for `Add`.""" | |
11414 | return self.Add(*args, **kw) | |
11415 | def AddSpacer(self, *args, **kw): | |
11416 | """Compatibility alias for `Add`.""" | |
11417 | return self.Add(*args, **kw) | |
11418 | ||
11419 | def PrependWindow(self, *args, **kw): | |
11420 | """Compatibility alias for `Prepend`.""" | |
11421 | return self.Prepend(*args, **kw) | |
11422 | def PrependSizer(self, *args, **kw): | |
11423 | """Compatibility alias for `Prepend`.""" | |
11424 | return self.Prepend(*args, **kw) | |
11425 | def PrependSpacer(self, *args, **kw): | |
11426 | """Compatibility alias for `Prepend`.""" | |
11427 | return self.Prepend(*args, **kw) | |
11428 | ||
11429 | def InsertWindow(self, *args, **kw): | |
11430 | """Compatibility alias for `Insert`.""" | |
11431 | return self.Insert(*args, **kw) | |
11432 | def InsertSizer(self, *args, **kw): | |
11433 | """Compatibility alias for `Insert`.""" | |
11434 | return self.Insert(*args, **kw) | |
11435 | def InsertSpacer(self, *args, **kw): | |
11436 | """Compatibility alias for `Insert`.""" | |
11437 | return self.Insert(*args, **kw) | |
11438 | ||
11439 | def RemoveWindow(self, *args, **kw): | |
11440 | """Compatibility alias for `Remove`.""" | |
11441 | return self.Remove(*args, **kw) | |
11442 | def RemoveSizer(self, *args, **kw): | |
11443 | """Compatibility alias for `Remove`.""" | |
11444 | return self.Remove(*args, **kw) | |
11445 | def RemovePos(self, *args, **kw): | |
11446 | """Compatibility alias for `Remove`.""" | |
11447 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
11448 | |
11449 | ||
e811c8ce | 11450 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11451 | """ |
11452 | SetDimension(self, int x, int y, int width, int height) | |
11453 | ||
11454 | Call this to force the sizer to take the given dimension and thus | |
11455 | force the items owned by the sizer to resize themselves according to | |
11456 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11457 | methods. | |
11458 | """ | |
54f9ee45 | 11459 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
11460 | |
11461 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11462 | """ |
11463 | SetMinSize(self, Size size) | |
11464 | ||
11465 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11466 | calculate its minimal size based purely on how much space its children | |
11467 | need. After calling this method `GetMinSize` will return either the | |
11468 | minimal size as requested by its children or the minimal size set | |
11469 | here, depending on which is bigger. | |
11470 | """ | |
54f9ee45 | 11471 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
11472 | |
11473 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11474 | """ |
11475 | GetSize(self) -> Size | |
11476 | ||
11477 | Returns the current size of the space managed by the sizer. | |
11478 | """ | |
54f9ee45 | 11479 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
11480 | |
11481 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11482 | """ |
11483 | GetPosition(self) -> Point | |
11484 | ||
11485 | Returns the current position of the sizer's managed space. | |
11486 | """ | |
54f9ee45 | 11487 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
11488 | |
11489 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11490 | """ |
11491 | GetMinSize(self) -> Size | |
11492 | ||
11493 | Returns the minimal size of the sizer. This is either the combined | |
11494 | minimal size of all the children and their borders or the minimal size | |
11495 | set by SetMinSize, depending on which is bigger. | |
11496 | """ | |
54f9ee45 | 11497 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 11498 | |
d14a1e28 | 11499 | def GetSizeTuple(self): |
1c0f361b | 11500 | return self.GetSize().Get() |
d14a1e28 | 11501 | def GetPositionTuple(self): |
1c0f361b | 11502 | return self.GetPosition().Get() |
d14a1e28 | 11503 | def GetMinSizeTuple(self): |
1c0f361b | 11504 | return self.GetMinSize().Get() |
d14a1e28 | 11505 | |
e811c8ce | 11506 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
11507 | """ |
11508 | RecalcSizes(self) | |
11509 | ||
11510 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11511 | items managed by this sizer. You should not need to call this directly as | |
11512 | it is called by `Layout`. | |
11513 | """ | |
54f9ee45 | 11514 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
11515 | |
11516 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11517 | """ |
11518 | CalcMin(self) -> Size | |
11519 | ||
11520 | This method is where the sizer will do the actual calculation of its | |
11521 | children's minimal sizes. You should not need to call this directly as | |
11522 | it is called by `Layout`. | |
11523 | """ | |
54f9ee45 | 11524 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
11525 | |
11526 | def Layout(*args, **kwargs): | |
248ed943 RD |
11527 | """ |
11528 | Layout(self) | |
11529 | ||
11530 | This method will force the recalculation and layout of the items | |
11531 | controlled by the sizer using the current space allocated to the | |
11532 | sizer. Normally this is called automatically from the owning window's | |
11533 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11534 | one of the items in a sizer change size, or items are added or | |
11535 | removed. | |
11536 | """ | |
54f9ee45 | 11537 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
11538 | |
11539 | def Fit(*args, **kwargs): | |
248ed943 RD |
11540 | """ |
11541 | Fit(self, Window window) -> Size | |
11542 | ||
11543 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11544 | size. This is commonly done in the constructor of the window itself in | |
11545 | order to set its initial size to match the needs of the children as | |
11546 | determined by the sizer. Returns the new size. | |
11547 | ||
11548 | For a top level window this is the total window size, not the client size. | |
11549 | """ | |
54f9ee45 | 11550 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
11551 | |
11552 | def FitInside(*args, **kwargs): | |
248ed943 RD |
11553 | """ |
11554 | FitInside(self, Window window) | |
11555 | ||
11556 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11557 | sizer's minimal size. This will not alter the on screen size of the | |
11558 | window, but may cause the addition/removal/alteration of scrollbars | |
11559 | required to view the virtual area in windows which manage it. | |
11560 | ||
11561 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11562 | ||
11563 | """ | |
54f9ee45 | 11564 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
11565 | |
11566 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
11567 | """ |
11568 | SetSizeHints(self, Window window) | |
11569 | ||
11570 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11571 | match the sizer's minimal size. This is commonly done in the | |
11572 | constructor of the window itself if the window is resizable (as are | |
11573 | many dialogs under Unix and frames on probably all platforms) in order | |
11574 | to prevent the window from being sized smaller than the minimal size | |
11575 | required by the sizer. | |
11576 | """ | |
54f9ee45 | 11577 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
11578 | |
11579 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
11580 | """ |
11581 | SetVirtualSizeHints(self, Window window) | |
11582 | ||
11583 | Tell the sizer to set the minimal size of the window virtual area to | |
11584 | match the sizer's minimal size. For windows with managed scrollbars | |
11585 | this will set them appropriately. | |
11586 | ||
11587 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11588 | ||
11589 | """ | |
54f9ee45 | 11590 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
11591 | |
11592 | def Clear(*args, **kwargs): | |
248ed943 RD |
11593 | """ |
11594 | Clear(self, bool deleteWindows=False) | |
11595 | ||
11596 | Clear all items from the sizer, optionally destroying the window items | |
11597 | as well. | |
11598 | """ | |
54f9ee45 | 11599 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
11600 | |
11601 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
11602 | """ |
11603 | DeleteWindows(self) | |
11604 | ||
11605 | Destroy all windows managed by the sizer. | |
11606 | """ | |
54f9ee45 | 11607 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11608 | |
11609 | def GetChildren(*args, **kwargs): | |
248ed943 | 11610 | """ |
51b83b37 | 11611 | GetChildren(self) -> list |
248ed943 RD |
11612 | |
11613 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11614 | """ | |
54f9ee45 | 11615 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
11616 | |
11617 | def Show(*args, **kwargs): | |
248ed943 | 11618 | """ |
ae8162c8 | 11619 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 11620 | |
248ed943 RD |
11621 | Shows or hides an item managed by the sizer. To make a sizer item |
11622 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11623 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
11624 | the item. Use the recursive parameter to show or hide an item in a |
11625 | subsizer. Returns True if the item was found. | |
248ed943 RD |
11626 | """ |
11627 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
11628 | |
11629 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11630 | """ |
11631 | IsShown(self, item) | |
11632 | ||
b1fcee84 | 11633 | Determines if the item is currently shown. To make a sizer |
248ed943 RD |
11634 | item disappear or reappear, use Show followed by `Layout`. The *item* |
11635 | parameter can be either a window, a sizer, or the zero-based index of | |
11636 | the item. | |
11637 | """ | |
54f9ee45 | 11638 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 11639 | |
7e63a440 | 11640 | def Hide(self, item, recursive=False): |
248ed943 | 11641 | """ |
27fb7603 | 11642 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 11643 | """ |
06759a38 | 11644 | return self.Show(item, False, recursive) |
248ed943 | 11645 | |
e811c8ce | 11646 | def ShowItems(*args, **kwargs): |
248ed943 RD |
11647 | """ |
11648 | ShowItems(self, bool show) | |
11649 | ||
84f85550 | 11650 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 11651 | """ |
54f9ee45 | 11652 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 11653 | |
2131d850 | 11654 | _core_.Sizer_swigregister(Sizer) |
d14a1e28 RD |
11655 | |
11656 | class PySizer(Sizer): | |
248ed943 RD |
11657 | """ |
11658 | wx.PySizer is a special version of `wx.Sizer` that has been | |
11659 | instrumented to allow the C++ virtual methods to be overloaded in | |
11660 | Python derived classes. You would derive from this class if you are | |
11661 | wanting to implement a custom sizer in Python code. Simply implement | |
11662 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
11663 | For example:: | |
11664 | ||
11665 | class MySizer(wx.PySizer): | |
11666 | def __init__(self): | |
11667 | wx.PySizer.__init__(self) | |
11668 | ||
11669 | def CalcMin(self): | |
11670 | for item in self.GetChildren(): | |
11671 | # calculate the total minimum width and height needed | |
11672 | # by all items in the sizer according to this sizer's | |
11673 | # layout algorithm. | |
11674 | ... | |
11675 | return wx.Size(width, height) | |
11676 | ||
11677 | def RecalcSizes(self): | |
11678 | # find the space allotted to this sizer | |
11679 | pos = self.GetPosition() | |
11680 | size = self.GetSize() | |
11681 | for item in self.GetChildren(): | |
11682 | # Recalculate (if necessary) the position and size of | |
11683 | # each item and then call item.SetDimension to do the | |
11684 | # actual positioning and sizing of the items within the | |
11685 | # space alloted to this sizer. | |
11686 | ... | |
11687 | item.SetDimension(itemPos, itemSize) | |
11688 | ||
11689 | ||
11690 | When `Layout` is called it first calls `CalcMin` followed by | |
11691 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 11692 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
11693 | |
11694 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
11695 | ||
11696 | ||
11697 | """ | |
0085ce49 RD |
11698 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11699 | __repr__ = _swig_repr | |
11700 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11701 | """ |
11702 | __init__(self) -> PySizer | |
11703 | ||
11704 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
11705 | class. | |
11706 | """ | |
0085ce49 | 11707 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
d14a1e28 | 11708 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) |
e811c8ce RD |
11709 | |
11710 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 11711 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 11712 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 11713 | |
2131d850 | 11714 | _core_.PySizer_swigregister(PySizer) |
d14a1e28 RD |
11715 | |
11716 | #--------------------------------------------------------------------------- | |
11717 | ||
11718 | class BoxSizer(Sizer): | |
248ed943 RD |
11719 | """ |
11720 | The basic idea behind a box sizer is that windows will most often be | |
11721 | laid out in rather simple basic geometry, typically in a row or a | |
11722 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
11723 | its items in a simple row or column, depending on the orientation | |
11724 | parameter passed to the constructor. | |
11725 | """ | |
0085ce49 RD |
11726 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11727 | __repr__ = _swig_repr | |
11728 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11729 | """ |
11730 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
11731 | ||
11732 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
11733 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
11734 | sizer. | |
11735 | """ | |
0085ce49 | 11736 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d14a1e28 | 11737 | self._setOORInfo(self) |
e811c8ce RD |
11738 | |
11739 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
11740 | """ |
11741 | GetOrientation(self) -> int | |
11742 | ||
11743 | Returns the current orientation of the sizer. | |
11744 | """ | |
54f9ee45 | 11745 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
11746 | |
11747 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
11748 | """ |
11749 | SetOrientation(self, int orient) | |
e811c8ce | 11750 | |
248ed943 RD |
11751 | Resets the orientation of the sizer. |
11752 | """ | |
11753 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 11754 | |
2bf58437 | 11755 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
2131d850 | 11756 | _core_.BoxSizer_swigregister(BoxSizer) |
d14a1e28 RD |
11757 | |
11758 | #--------------------------------------------------------------------------- | |
11759 | ||
11760 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
11761 | """ |
11762 | wx.StaticBoxSizer derives from and functions identically to the | |
11763 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
11764 | manages. Note that this static box must be created separately and | |
11765 | passed to the sizer constructor. | |
11766 | """ | |
0085ce49 RD |
11767 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11768 | __repr__ = _swig_repr | |
11769 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11770 | """ |
11771 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
11772 | ||
11773 | Constructor. It takes an associated static box and the orientation | |
11774 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
11775 | ``wx.HORIZONTAL``. | |
11776 | """ | |
0085ce49 | 11777 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d14a1e28 | 11778 | self._setOORInfo(self) |
e811c8ce RD |
11779 | |
11780 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
11781 | """ |
11782 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 11783 | |
248ed943 RD |
11784 | Returns the static box associated with this sizer. |
11785 | """ | |
11786 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 11787 | |
2131d850 | 11788 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d14a1e28 RD |
11789 | |
11790 | #--------------------------------------------------------------------------- | |
11791 | ||
11792 | class GridSizer(Sizer): | |
248ed943 RD |
11793 | """ |
11794 | A grid sizer is a sizer which lays out its children in a | |
11795 | two-dimensional table with all cells having the same size. In other | |
11796 | words, the width of each cell within the grid is the width of the | |
11797 | widest item added to the sizer and the height of each grid cell is the | |
11798 | height of the tallest item. An optional vertical and/or horizontal | |
11799 | gap between items can also be specified (in pixels.) | |
11800 | ||
11801 | Items are placed in the cells of the grid in the order they are added, | |
11802 | in row-major order. In other words, the first row is filled first, | |
11803 | then the second, and so on until all items have been added. (If | |
11804 | neccessary, additional rows will be added as items are added.) If you | |
11805 | need to have greater control over the cells that items are placed in | |
11806 | then use the `wx.GridBagSizer`. | |
11807 | ||
11808 | """ | |
0085ce49 RD |
11809 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11810 | __repr__ = _swig_repr | |
11811 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11812 | """ |
11813 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
11814 | ||
11815 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
11816 | of columns and rows in the sizer - if either of the parameters is | |
11817 | zero, it will be calculated to from the total number of children in | |
11818 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11819 | define extra space between all children. | |
11820 | """ | |
0085ce49 | 11821 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d14a1e28 | 11822 | self._setOORInfo(self) |
e811c8ce | 11823 | |
e811c8ce | 11824 | def SetCols(*args, **kwargs): |
248ed943 RD |
11825 | """ |
11826 | SetCols(self, int cols) | |
11827 | ||
11828 | Sets the number of columns in the sizer. | |
11829 | """ | |
54f9ee45 | 11830 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
11831 | |
11832 | def SetRows(*args, **kwargs): | |
248ed943 RD |
11833 | """ |
11834 | SetRows(self, int rows) | |
11835 | ||
11836 | Sets the number of rows in the sizer. | |
11837 | """ | |
54f9ee45 | 11838 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
11839 | |
11840 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
11841 | """ |
11842 | SetVGap(self, int gap) | |
11843 | ||
11844 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
11845 | """ | |
54f9ee45 | 11846 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
11847 | |
11848 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
11849 | """ |
11850 | SetHGap(self, int gap) | |
11851 | ||
11852 | Sets the horizontal gap (in pixels) between cells in the sizer | |
11853 | """ | |
54f9ee45 | 11854 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
11855 | |
11856 | def GetCols(*args, **kwargs): | |
248ed943 RD |
11857 | """ |
11858 | GetCols(self) -> int | |
11859 | ||
11860 | Returns the number of columns in the sizer. | |
11861 | """ | |
54f9ee45 | 11862 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
11863 | |
11864 | def GetRows(*args, **kwargs): | |
248ed943 RD |
11865 | """ |
11866 | GetRows(self) -> int | |
11867 | ||
11868 | Returns the number of rows in the sizer. | |
11869 | """ | |
54f9ee45 | 11870 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
11871 | |
11872 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
11873 | """ |
11874 | GetVGap(self) -> int | |
11875 | ||
11876 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
11877 | """ | |
54f9ee45 | 11878 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
11879 | |
11880 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
11881 | """ |
11882 | GetHGap(self) -> int | |
11883 | ||
11884 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
11885 | """ | |
54f9ee45 | 11886 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 11887 | |
0085ce49 RD |
11888 | def CalcRowsCols(self): |
11889 | """ | |
11890 | CalcRowsCols() -> (rows, cols) | |
11891 | ||
11892 | Calculates how many rows and columns will be in the sizer based | |
11893 | on the current number of items and also the rows, cols specified | |
11894 | in the constructor. | |
11895 | """ | |
11896 | nitems = len(self.GetChildren()) | |
11897 | rows = self.GetRows() | |
11898 | cols = self.GetCols() | |
11899 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
11900 | if cols != 0: | |
11901 | rows = (nitems + cols - 1) / cols | |
11902 | elif rows != 0: | |
11903 | cols = (nitems + rows - 1) / rows | |
11904 | return (rows, cols) | |
d14a1e28 | 11905 | |
2131d850 | 11906 | _core_.GridSizer_swigregister(GridSizer) |
d14a1e28 RD |
11907 | |
11908 | #--------------------------------------------------------------------------- | |
11909 | ||
54f9ee45 RD |
11910 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
11911 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
11912 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 11913 | class FlexGridSizer(GridSizer): |
248ed943 RD |
11914 | """ |
11915 | A flex grid sizer is a sizer which lays out its children in a | |
11916 | two-dimensional table with all table cells in one row having the same | |
11917 | height and all cells in one column having the same width, but all | |
11918 | rows or all columns are not necessarily the same height or width as in | |
11919 | the `wx.GridSizer`. | |
11920 | ||
11921 | wx.FlexGridSizer can also size items equally in one direction but | |
11922 | unequally ("flexibly") in the other. If the sizer is only flexible | |
11923 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
11924 | needs to be decided how the sizer should grow in the other ("non | |
11925 | flexible") direction in order to fill the available space. The | |
11926 | `SetNonFlexibleGrowMode` method serves this purpose. | |
11927 | ||
11928 | ||
11929 | """ | |
0085ce49 RD |
11930 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11931 | __repr__ = _swig_repr | |
11932 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11933 | """ |
11934 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
11935 | ||
11936 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
11937 | number of columns and rows in the sizer - if either of the parameters | |
11938 | is zero, it will be calculated to from the total number of children in | |
11939 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11940 | define extra space between all children. | |
11941 | """ | |
0085ce49 | 11942 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d14a1e28 | 11943 | self._setOORInfo(self) |
e811c8ce | 11944 | |
248ed943 RD |
11945 | def AddGrowableRow(*args, **kwargs): |
11946 | """ | |
11947 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 11948 | |
248ed943 RD |
11949 | Specifies that row *idx* (starting from zero) should be grown if there |
11950 | is extra space available to the sizer. | |
e811c8ce | 11951 | |
248ed943 RD |
11952 | The *proportion* parameter has the same meaning as the stretch factor |
11953 | for the box sizers except that if all proportions are 0, then all | |
11954 | columns are resized equally (instead of not being resized at all). | |
11955 | """ | |
54f9ee45 | 11956 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
11957 | |
11958 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
11959 | """ |
11960 | RemoveGrowableRow(self, size_t idx) | |
11961 | ||
11962 | Specifies that row *idx* is no longer growable. | |
11963 | """ | |
54f9ee45 | 11964 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
11965 | |
11966 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
11967 | """ |
11968 | AddGrowableCol(self, size_t idx, int proportion=0) | |
11969 | ||
11970 | Specifies that column *idx* (starting from zero) should be grown if | |
11971 | there is extra space available to the sizer. | |
11972 | ||
11973 | The *proportion* parameter has the same meaning as the stretch factor | |
11974 | for the box sizers except that if all proportions are 0, then all | |
11975 | columns are resized equally (instead of not being resized at all). | |
11976 | """ | |
54f9ee45 | 11977 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
11978 | |
11979 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
11980 | """ |
11981 | RemoveGrowableCol(self, size_t idx) | |
11982 | ||
11983 | Specifies that column *idx* is no longer growable. | |
11984 | """ | |
54f9ee45 | 11985 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
11986 | |
11987 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
11988 | """ |
11989 | SetFlexibleDirection(self, int direction) | |
11990 | ||
11991 | Specifies whether the sizer should flexibly resize its columns, rows, | |
11992 | or both. Argument *direction* can be one of the following values. Any | |
11993 | other value is ignored. | |
11994 | ||
11995 | ============== ======================================= | |
11996 | wx.VERTICAL Rows are flexibly sized. | |
11997 | wx.HORIZONTAL Columns are flexibly sized. | |
11998 | wx.BOTH Both rows and columns are flexibly sized | |
11999 | (this is the default value). | |
12000 | ============== ======================================= | |
12001 | ||
12002 | Note that this method does not trigger relayout. | |
12003 | ||
12004 | """ | |
54f9ee45 | 12005 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12006 | |
12007 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12008 | """ |
12009 | GetFlexibleDirection(self) -> int | |
12010 | ||
12011 | Returns a value that specifies whether the sizer | |
12012 | flexibly resizes its columns, rows, or both (default). | |
12013 | ||
12014 | :see: `SetFlexibleDirection` | |
12015 | """ | |
54f9ee45 | 12016 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12017 | |
12018 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12019 | """ |
12020 | SetNonFlexibleGrowMode(self, int mode) | |
12021 | ||
12022 | Specifies how the sizer should grow in the non-flexible direction if | |
12023 | there is one (so `SetFlexibleDirection` must have been called | |
12024 | previously). Argument *mode* can be one of the following values: | |
12025 | ||
12026 | ========================== ================================================= | |
12027 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12028 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12029 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12030 | case equal sizing applies to minimum sizes of | |
12031 | columns or rows (this is the default value). | |
12032 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12033 | the non flexible direction, whether they are | |
12034 | growable or not in the flexbile direction. | |
12035 | ========================== ================================================= | |
12036 | ||
12037 | Note that this method does not trigger relayout. | |
12038 | ||
12039 | ||
12040 | """ | |
54f9ee45 | 12041 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12042 | |
12043 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12044 | """ |
12045 | GetNonFlexibleGrowMode(self) -> int | |
12046 | ||
12047 | Returns the value that specifies how the sizer grows in the | |
12048 | non-flexible direction if there is one. | |
12049 | ||
12050 | :see: `SetNonFlexibleGrowMode` | |
12051 | """ | |
54f9ee45 | 12052 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12053 | |
12054 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12055 | """ |
12056 | GetRowHeights(self) -> list | |
12057 | ||
12058 | Returns a list of integers representing the heights of each of the | |
12059 | rows in the sizer. | |
12060 | """ | |
54f9ee45 | 12061 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
12062 | |
12063 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12064 | """ |
12065 | GetColWidths(self) -> list | |
12066 | ||
12067 | Returns a list of integers representing the widths of each of the | |
12068 | columns in the sizer. | |
12069 | """ | |
54f9ee45 | 12070 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 12071 | |
2131d850 | 12072 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d14a1e28 | 12073 | |
e505d15e RD |
12074 | class StdDialogButtonSizer(BoxSizer): |
12075 | """ | |
12076 | A special sizer that knows how to order and position standard buttons | |
12077 | in order to conform to the current platform's standards. You simply | |
12078 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12079 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
12080 | will take care of the rest. |
12081 | ||
12082 | """ | |
0085ce49 RD |
12083 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12084 | __repr__ = _swig_repr | |
12085 | def __init__(self, *args, **kwargs): | |
e505d15e | 12086 | """__init__(self) -> StdDialogButtonSizer""" |
0085ce49 | 12087 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
e505d15e RD |
12088 | def AddButton(*args, **kwargs): |
12089 | """ | |
12090 | AddButton(self, wxButton button) | |
12091 | ||
12092 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12093 | method in the base class. | |
12094 | """ | |
12095 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
12096 | ||
53aa7709 | 12097 | def Realize(*args, **kwargs): |
e505d15e | 12098 | """ |
53aa7709 | 12099 | Realize(self) |
e505d15e RD |
12100 | |
12101 | This funciton needs to be called after all the buttons have been added | |
12102 | to the sizer. It will reorder them and position them in a platform | |
12103 | specifc manner. | |
12104 | """ | |
53aa7709 | 12105 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12106 | |
12107 | def SetAffirmativeButton(*args, **kwargs): | |
12108 | """SetAffirmativeButton(self, wxButton button)""" | |
12109 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
12110 | ||
12111 | def SetNegativeButton(*args, **kwargs): | |
12112 | """SetNegativeButton(self, wxButton button)""" | |
12113 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
12114 | ||
12115 | def SetCancelButton(*args, **kwargs): | |
12116 | """SetCancelButton(self, wxButton button)""" | |
12117 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
12118 | |
12119 | def GetAffirmativeButton(*args, **kwargs): | |
12120 | """GetAffirmativeButton(self) -> wxButton""" | |
12121 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
12122 | ||
12123 | def GetApplyButton(*args, **kwargs): | |
12124 | """GetApplyButton(self) -> wxButton""" | |
12125 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
12126 | ||
12127 | def GetNegativeButton(*args, **kwargs): | |
12128 | """GetNegativeButton(self) -> wxButton""" | |
12129 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
12130 | ||
12131 | def GetCancelButton(*args, **kwargs): | |
12132 | """GetCancelButton(self) -> wxButton""" | |
12133 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
12134 | ||
12135 | def GetHelpButton(*args, **kwargs): | |
12136 | """GetHelpButton(self) -> wxButton""" | |
12137 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
12138 | ||
2131d850 | 12139 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
e505d15e | 12140 | |
d14a1e28 RD |
12141 | #--------------------------------------------------------------------------- |
12142 | ||
12143 | class GBPosition(object): | |
248ed943 RD |
12144 | """ |
12145 | This class represents the position of an item in a virtual grid of | |
12146 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12147 | typemaps that will automatically convert from a 2-element sequence of | |
12148 | integers to a wx.GBPosition, so you can use the more pythonic | |
12149 | representation of the position nearly transparently in Python code. | |
12150 | """ | |
0085ce49 RD |
12151 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12152 | __repr__ = _swig_repr | |
12153 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12154 | """ |
12155 | __init__(self, int row=0, int col=0) -> GBPosition | |
12156 | ||
12157 | This class represents the position of an item in a virtual grid of | |
12158 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12159 | typemaps that will automatically convert from a 2-element sequence of | |
12160 | integers to a wx.GBPosition, so you can use the more pythonic | |
12161 | representation of the position nearly transparently in Python code. | |
12162 | """ | |
0085ce49 RD |
12163 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
12164 | __swig_destroy__ = _core_.delete_GBPosition | |
12165 | __del__ = lambda self : None; | |
e811c8ce | 12166 | def GetRow(*args, **kwargs): |
a95a7133 | 12167 | """GetRow(self) -> int""" |
54f9ee45 | 12168 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
12169 | |
12170 | def GetCol(*args, **kwargs): | |
a95a7133 | 12171 | """GetCol(self) -> int""" |
54f9ee45 | 12172 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
12173 | |
12174 | def SetRow(*args, **kwargs): | |
a95a7133 | 12175 | """SetRow(self, int row)""" |
54f9ee45 | 12176 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
12177 | |
12178 | def SetCol(*args, **kwargs): | |
a95a7133 | 12179 | """SetCol(self, int col)""" |
54f9ee45 | 12180 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
12181 | |
12182 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12183 | """ |
12184 | __eq__(self, PyObject other) -> bool | |
12185 | ||
12186 | Compare GBPosition for equality. | |
12187 | """ | |
54f9ee45 | 12188 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
12189 | |
12190 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12191 | """ |
12192 | __ne__(self, PyObject other) -> bool | |
12193 | ||
12194 | Compare GBPosition for inequality. | |
12195 | """ | |
54f9ee45 | 12196 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
12197 | |
12198 | def Set(*args, **kwargs): | |
a95a7133 | 12199 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 12200 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
12201 | |
12202 | def Get(*args, **kwargs): | |
a95a7133 | 12203 | """Get(self) -> PyObject""" |
54f9ee45 | 12204 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 12205 | |
41e2b43e | 12206 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12207 | def __str__(self): return str(self.Get()) |
12208 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12209 | def __len__(self): return len(self.Get()) | |
12210 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12211 | def __setitem__(self, index, val): |
12212 | if index == 0: self.SetRow(val) | |
12213 | elif index == 1: self.SetCol(val) | |
12214 | else: raise IndexError | |
e811c8ce | 12215 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12216 | __safe_for_unpickling__ = True |
12217 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
12218 | |
12219 | row = property(GetRow, SetRow) | |
12220 | col = property(GetCol, SetCol) | |
12221 | ||
2131d850 | 12222 | _core_.GBPosition_swigregister(GBPosition) |
d14a1e28 RD |
12223 | |
12224 | class GBSpan(object): | |
248ed943 RD |
12225 | """ |
12226 | This class is used to hold the row and column spanning attributes of | |
12227 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12228 | automatically convert from a 2-element sequence of integers to a | |
12229 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12230 | nearly transparently in Python code. | |
12231 | ||
12232 | """ | |
0085ce49 RD |
12233 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12234 | __repr__ = _swig_repr | |
12235 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12236 | """ |
12237 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
12238 | ||
12239 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12240 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12241 | cell in each direction. | |
12242 | """ | |
0085ce49 RD |
12243 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
12244 | __swig_destroy__ = _core_.delete_GBSpan | |
12245 | __del__ = lambda self : None; | |
e811c8ce | 12246 | def GetRowspan(*args, **kwargs): |
a95a7133 | 12247 | """GetRowspan(self) -> int""" |
54f9ee45 | 12248 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
12249 | |
12250 | def GetColspan(*args, **kwargs): | |
a95a7133 | 12251 | """GetColspan(self) -> int""" |
54f9ee45 | 12252 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
12253 | |
12254 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 12255 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 12256 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
12257 | |
12258 | def SetColspan(*args, **kwargs): | |
a95a7133 | 12259 | """SetColspan(self, int colspan)""" |
54f9ee45 | 12260 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
12261 | |
12262 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12263 | """ |
12264 | __eq__(self, PyObject other) -> bool | |
12265 | ||
12266 | Compare wxGBSpan for equality. | |
12267 | """ | |
54f9ee45 | 12268 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
12269 | |
12270 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12271 | """ |
12272 | __ne__(self, PyObject other) -> bool | |
12273 | ||
12274 | Compare GBSpan for inequality. | |
12275 | """ | |
54f9ee45 | 12276 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
12277 | |
12278 | def Set(*args, **kwargs): | |
a95a7133 | 12279 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 12280 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
12281 | |
12282 | def Get(*args, **kwargs): | |
a95a7133 | 12283 | """Get(self) -> PyObject""" |
54f9ee45 | 12284 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 12285 | |
41e2b43e | 12286 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12287 | def __str__(self): return str(self.Get()) |
12288 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12289 | def __len__(self): return len(self.Get()) | |
12290 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12291 | def __setitem__(self, index, val): |
12292 | if index == 0: self.SetRowspan(val) | |
12293 | elif index == 1: self.SetColspan(val) | |
12294 | else: raise IndexError | |
e811c8ce | 12295 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12296 | __safe_for_unpickling__ = True |
12297 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
12298 | |
12299 | rowspan = property(GetRowspan, SetRowspan) | |
12300 | colspan = property(GetColspan, SetColspan) | |
12301 | ||
2131d850 | 12302 | _core_.GBSpan_swigregister(GBSpan) |
d14a1e28 RD |
12303 | |
12304 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12305 | """ |
12306 | The wx.GBSizerItem class is used to track the additional data about | |
12307 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12308 | and how many rows or columns it spans. | |
12309 | ||
12310 | """ | |
0085ce49 RD |
12311 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12312 | __repr__ = _swig_repr | |
12313 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12314 | """ |
12315 | __init__(self) -> GBSizerItem | |
12316 | ||
12317 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12318 | size will need to be set, as well as a position and span before this | |
12319 | item can be used in a Sizer. | |
12320 | ||
12321 | You will probably never need to create a wx.GBSizerItem directly as they | |
12322 | are created automatically when the sizer's Add method is called. | |
12323 | """ | |
0085ce49 RD |
12324 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
12325 | __swig_destroy__ = _core_.delete_GBSizerItem | |
12326 | __del__ = lambda self : None; | |
e811c8ce | 12327 | def GetPos(*args, **kwargs): |
248ed943 RD |
12328 | """ |
12329 | GetPos(self) -> GBPosition | |
12330 | ||
12331 | Get the grid position of the item | |
12332 | """ | |
54f9ee45 | 12333 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
12334 | |
12335 | def GetPosTuple(self): return self.GetPos().Get() | |
12336 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12337 | """ |
12338 | GetSpan(self) -> GBSpan | |
12339 | ||
12340 | Get the row and column spanning of the item | |
12341 | """ | |
54f9ee45 | 12342 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
12343 | |
12344 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12345 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12346 | """ |
12347 | SetPos(self, GBPosition pos) -> bool | |
12348 | ||
12349 | If the item is already a member of a sizer then first ensure that | |
12350 | there is no other item that would intersect with this one at the new | |
12351 | position, then set the new position. Returns True if the change is | |
12352 | successful and after the next Layout() the item will be moved. | |
12353 | """ | |
54f9ee45 | 12354 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
12355 | |
12356 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12357 | """ |
12358 | SetSpan(self, GBSpan span) -> bool | |
12359 | ||
12360 | If the item is already a member of a sizer then first ensure that | |
12361 | there is no other item that would intersect with this one with its new | |
12362 | spanning size, then set the new spanning. Returns True if the change | |
12363 | is successful and after the next Layout() the item will be resized. | |
12364 | ||
12365 | """ | |
54f9ee45 | 12366 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 12367 | |
248ed943 | 12368 | def Intersects(*args, **kwargs): |
0df68c9f | 12369 | """ |
a95a7133 | 12370 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
12371 | |
12372 | Returns True if this item and the other item instersect. | |
0df68c9f | 12373 | """ |
248ed943 RD |
12374 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12375 | ||
12376 | def IntersectsPos(*args, **kwargs): | |
12377 | """ | |
12378 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12379 | ||
12380 | Returns True if the given pos/span would intersect with this item. | |
12381 | """ | |
12382 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
12383 | |
12384 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12385 | """ |
12386 | GetEndPos(self) -> GBPosition | |
12387 | ||
12388 | Get the row and column of the endpoint of this item. | |
12389 | """ | |
54f9ee45 | 12390 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
12391 | |
12392 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12393 | """ |
12394 | GetGBSizer(self) -> GridBagSizer | |
12395 | ||
12396 | Get the sizer this item is a member of. | |
12397 | """ | |
54f9ee45 | 12398 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
12399 | |
12400 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12401 | """ |
12402 | SetGBSizer(self, GridBagSizer sizer) | |
12403 | ||
12404 | Set the sizer this item is a member of. | |
12405 | """ | |
54f9ee45 | 12406 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 12407 | |
2131d850 | 12408 | _core_.GBSizerItem_swigregister(GBSizerItem) |
d14a1e28 RD |
12409 | DefaultSpan = cvar.DefaultSpan |
12410 | ||
12411 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
12412 | """ |
12413 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12414 | int border, PyObject userData=None) -> GBSizerItem |
12415 | ||
12416 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 12417 | """ |
54f9ee45 | 12418 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12419 | return val |
12420 | ||
12421 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12422 | """ |
12423 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12424 | int border, PyObject userData=None) -> GBSizerItem |
12425 | ||
12426 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 12427 | """ |
54f9ee45 | 12428 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12429 | return val |
12430 | ||
12431 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
12432 | """ |
12433 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12434 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12435 | ||
12436 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 12437 | """ |
54f9ee45 | 12438 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12439 | return val |
12440 | ||
12441 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12442 | """ |
12443 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12444 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12445 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12446 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12447 | virtual grid is determined by the largest row and column that items are | |
12448 | positioned at, adjusted for spanning. | |
12449 | ||
12450 | """ | |
0085ce49 RD |
12451 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12452 | __repr__ = _swig_repr | |
12453 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12454 | """ |
12455 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12456 | ||
12457 | Constructor, with optional parameters to specify the gap between the | |
12458 | rows and columns. | |
12459 | """ | |
0085ce49 | 12460 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
1823fbb4 RD |
12461 | self._setOORInfo(self) |
12462 | ||
e811c8ce | 12463 | def Add(*args, **kwargs): |
0df68c9f | 12464 | """ |
248ed943 | 12465 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 12466 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12467 | |
12468 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12469 | more than one row or column as specified with *span*. The remaining | |
12470 | args behave similarly to `wx.Sizer.Add`. | |
12471 | ||
12472 | Returns True if the item was successfully placed at the given cell | |
12473 | position, False if something was already there. | |
12474 | ||
0df68c9f | 12475 | """ |
54f9ee45 | 12476 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
12477 | |
12478 | def AddItem(*args, **kwargs): | |
248ed943 | 12479 | """ |
d3b6e4ff | 12480 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12481 | |
12482 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12483 | the item was successfully placed at its given cell position, False if | |
12484 | something was already there. | |
12485 | """ | |
54f9ee45 | 12486 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 12487 | |
84f85550 RD |
12488 | def GetCellSize(*args, **kwargs): |
12489 | """ | |
12490 | GetCellSize(self, int row, int col) -> Size | |
12491 | ||
12492 | Get the size of the specified cell, including hgap and | |
12493 | vgap. Only valid after a Layout. | |
12494 | """ | |
12495 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12496 | ||
e811c8ce | 12497 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12498 | """ |
12499 | GetEmptyCellSize(self) -> Size | |
12500 | ||
12501 | Get the size used for cells in the grid with no item. | |
12502 | """ | |
54f9ee45 | 12503 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12504 | |
12505 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12506 | """ |
12507 | SetEmptyCellSize(self, Size sz) | |
12508 | ||
12509 | Set the size used for cells in the grid with no item. | |
12510 | """ | |
54f9ee45 | 12511 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12512 | |
12513 | def GetItemPosition(*args): | |
0df68c9f | 12514 | """ |
248ed943 RD |
12515 | GetItemPosition(self, item) -> GBPosition |
12516 | ||
12517 | Get the grid position of the specified *item* where *item* is either a | |
12518 | window or subsizer that is a member of this sizer, or a zero-based | |
12519 | index of an item. | |
0df68c9f | 12520 | """ |
54f9ee45 | 12521 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
12522 | |
12523 | def SetItemPosition(*args): | |
0df68c9f | 12524 | """ |
248ed943 RD |
12525 | SetItemPosition(self, item, GBPosition pos) -> bool |
12526 | ||
12527 | Set the grid position of the specified *item* where *item* is either a | |
12528 | window or subsizer that is a member of this sizer, or a zero-based | |
12529 | index of an item. Returns True on success. If the move is not | |
12530 | allowed (because an item is already there) then False is returned. | |
12531 | ||
0df68c9f | 12532 | """ |
54f9ee45 | 12533 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
12534 | |
12535 | def GetItemSpan(*args): | |
0df68c9f | 12536 | """ |
248ed943 RD |
12537 | GetItemSpan(self, item) -> GBSpan |
12538 | ||
12539 | Get the row/col spanning of the specified *item* where *item* is | |
12540 | either a window or subsizer that is a member of this sizer, or a | |
12541 | zero-based index of an item. | |
0df68c9f | 12542 | """ |
54f9ee45 | 12543 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
12544 | |
12545 | def SetItemSpan(*args): | |
0df68c9f | 12546 | """ |
248ed943 RD |
12547 | SetItemSpan(self, item, GBSpan span) -> bool |
12548 | ||
12549 | Set the row/col spanning of the specified *item* where *item* is | |
12550 | either a window or subsizer that is a member of this sizer, or a | |
12551 | zero-based index of an item. Returns True on success. If the move is | |
12552 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 12553 | """ |
54f9ee45 | 12554 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
12555 | |
12556 | def FindItem(*args): | |
0df68c9f | 12557 | """ |
248ed943 RD |
12558 | FindItem(self, item) -> GBSizerItem |
12559 | ||
12560 | Find the sizer item for the given window or subsizer, returns None if | |
12561 | not found. (non-recursive) | |
0df68c9f | 12562 | """ |
54f9ee45 | 12563 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce RD |
12564 | |
12565 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
12566 | """ |
12567 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
12568 | ||
12569 | Return the sizer item for the given grid cell, or None if there is no | |
12570 | item at that position. (non-recursive) | |
12571 | """ | |
54f9ee45 | 12572 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
12573 | |
12574 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
12575 | """ |
12576 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
12577 | ||
12578 | Return the sizer item located at the point given in *pt*, or None if | |
12579 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12580 | to the client coordinates of the window using the sizer for | |
12581 | layout. (non-recursive) | |
12582 | """ | |
54f9ee45 | 12583 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 12584 | |
248ed943 RD |
12585 | def CheckForIntersection(*args, **kwargs): |
12586 | """ | |
12587 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 12588 | |
248ed943 RD |
12589 | Look at all items and see if any intersect (or would overlap) the |
12590 | given *item*. Returns True if so, False if there would be no overlap. | |
12591 | If an *excludeItem* is given then it will not be checked for | |
12592 | intersection, for example it may be the item we are checking the | |
12593 | position of. | |
e811c8ce | 12594 | |
248ed943 RD |
12595 | """ |
12596 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 12597 | |
248ed943 | 12598 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 12599 | """ |
248ed943 RD |
12600 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
12601 | ||
12602 | Look at all items and see if any intersect (or would overlap) the | |
12603 | given position and span. Returns True if so, False if there would be | |
12604 | no overlap. If an *excludeItem* is given then it will not be checked | |
12605 | for intersection, for example it may be the item we are checking the | |
12606 | position of. | |
0df68c9f | 12607 | """ |
248ed943 | 12608 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 12609 | |
2131d850 | 12610 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d14a1e28 RD |
12611 | |
12612 | #--------------------------------------------------------------------------- | |
12613 | ||
54f9ee45 RD |
12614 | Left = _core_.Left |
12615 | Top = _core_.Top | |
12616 | Right = _core_.Right | |
12617 | Bottom = _core_.Bottom | |
12618 | Width = _core_.Width | |
12619 | Height = _core_.Height | |
12620 | Centre = _core_.Centre | |
12621 | Center = _core_.Center | |
12622 | CentreX = _core_.CentreX | |
12623 | CentreY = _core_.CentreY | |
12624 | Unconstrained = _core_.Unconstrained | |
12625 | AsIs = _core_.AsIs | |
12626 | PercentOf = _core_.PercentOf | |
12627 | Above = _core_.Above | |
12628 | Below = _core_.Below | |
12629 | LeftOf = _core_.LeftOf | |
12630 | RightOf = _core_.RightOf | |
12631 | SameAs = _core_.SameAs | |
12632 | Absolute = _core_.Absolute | |
d14a1e28 | 12633 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 12634 | """ |
41e2b43e RD |
12635 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
12636 | one of eight possible constraints that a window can be involved in. | |
12637 | You will never need to create an instance of | |
12638 | wx.IndividualLayoutConstraint, rather you should create a | |
12639 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 12640 | that it contains. |
15afbcd0 | 12641 | """ |
0085ce49 RD |
12642 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12643 | def __init__(self): raise AttributeError, "No constructor defined" | |
12644 | __repr__ = _swig_repr | |
e811c8ce | 12645 | def Set(*args, **kwargs): |
41e2b43e RD |
12646 | """ |
12647 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
12648 | ||
12649 | Sets the properties of the constraint. Normally called by one of the | |
12650 | convenience functions such as Above, RightOf, SameAs. | |
12651 | """ | |
54f9ee45 | 12652 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
12653 | |
12654 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 12655 | """ |
a95a7133 | 12656 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 12657 | |
41e2b43e RD |
12658 | Constrains this edge to be to the left of the given window, with an |
12659 | optional margin. Implicitly, this is relative to the left edge of the | |
12660 | other window. | |
15afbcd0 | 12661 | """ |
54f9ee45 | 12662 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
12663 | |
12664 | def RightOf(*args, **kwargs): | |
15afbcd0 | 12665 | """ |
a95a7133 | 12666 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 12667 | |
41e2b43e RD |
12668 | Constrains this edge to be to the right of the given window, with an |
12669 | optional margin. Implicitly, this is relative to the right edge of the | |
12670 | other window. | |
15afbcd0 | 12671 | """ |
54f9ee45 | 12672 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
12673 | |
12674 | def Above(*args, **kwargs): | |
15afbcd0 | 12675 | """ |
a95a7133 | 12676 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 12677 | |
41e2b43e RD |
12678 | Constrains this edge to be above the given window, with an optional |
12679 | margin. Implicitly, this is relative to the top edge of the other | |
12680 | window. | |
15afbcd0 | 12681 | """ |
54f9ee45 | 12682 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
12683 | |
12684 | def Below(*args, **kwargs): | |
15afbcd0 | 12685 | """ |
a95a7133 | 12686 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 12687 | |
41e2b43e RD |
12688 | Constrains this edge to be below the given window, with an optional |
12689 | margin. Implicitly, this is relative to the bottom edge of the other | |
12690 | window. | |
15afbcd0 | 12691 | """ |
54f9ee45 | 12692 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
12693 | |
12694 | def SameAs(*args, **kwargs): | |
15afbcd0 | 12695 | """ |
a95a7133 | 12696 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 12697 | |
41e2b43e RD |
12698 | Constrains this edge or dimension to be to the same as the edge of the |
12699 | given window, with an optional margin. | |
15afbcd0 | 12700 | """ |
54f9ee45 | 12701 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
12702 | |
12703 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 12704 | """ |
a95a7133 | 12705 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 12706 | |
41e2b43e RD |
12707 | Constrains this edge or dimension to be to a percentage of the given |
12708 | window, with an optional margin. | |
15afbcd0 | 12709 | """ |
54f9ee45 | 12710 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
12711 | |
12712 | def Absolute(*args, **kwargs): | |
15afbcd0 | 12713 | """ |
a95a7133 | 12714 | Absolute(self, int val) |
15afbcd0 | 12715 | |
41e2b43e | 12716 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 12717 | """ |
54f9ee45 | 12718 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
12719 | |
12720 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 12721 | """ |
a95a7133 | 12722 | Unconstrained(self) |
15afbcd0 | 12723 | |
41e2b43e RD |
12724 | Sets this edge or dimension to be unconstrained, that is, dependent on |
12725 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 12726 | """ |
54f9ee45 | 12727 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
12728 | |
12729 | def AsIs(*args, **kwargs): | |
15afbcd0 | 12730 | """ |
a95a7133 | 12731 | AsIs(self) |
15afbcd0 | 12732 | |
41e2b43e RD |
12733 | Sets this edge or constraint to be whatever the window's value is at |
12734 | the moment. If either of the width and height constraints are *as is*, | |
12735 | the window will not be resized, but moved instead. This is important | |
12736 | when considering panel items which are intended to have a default | |
12737 | size, such as a button, which may take its size from the size of the | |
12738 | button label. | |
15afbcd0 | 12739 | """ |
54f9ee45 | 12740 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
12741 | |
12742 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 12743 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 12744 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
12745 | |
12746 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 12747 | """GetMyEdge(self) -> int""" |
54f9ee45 | 12748 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
12749 | |
12750 | def SetEdge(*args, **kwargs): | |
a95a7133 | 12751 | """SetEdge(self, int which)""" |
54f9ee45 | 12752 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
12753 | |
12754 | def SetValue(*args, **kwargs): | |
a95a7133 | 12755 | """SetValue(self, int v)""" |
54f9ee45 | 12756 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
12757 | |
12758 | def GetMargin(*args, **kwargs): | |
a95a7133 | 12759 | """GetMargin(self) -> int""" |
54f9ee45 | 12760 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
12761 | |
12762 | def SetMargin(*args, **kwargs): | |
a95a7133 | 12763 | """SetMargin(self, int m)""" |
54f9ee45 | 12764 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
12765 | |
12766 | def GetValue(*args, **kwargs): | |
a95a7133 | 12767 | """GetValue(self) -> int""" |
54f9ee45 | 12768 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
12769 | |
12770 | def GetPercent(*args, **kwargs): | |
a95a7133 | 12771 | """GetPercent(self) -> int""" |
54f9ee45 | 12772 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
12773 | |
12774 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 12775 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 12776 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
12777 | |
12778 | def GetDone(*args, **kwargs): | |
a95a7133 | 12779 | """GetDone(self) -> bool""" |
54f9ee45 | 12780 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
12781 | |
12782 | def SetDone(*args, **kwargs): | |
a95a7133 | 12783 | """SetDone(self, bool d)""" |
54f9ee45 | 12784 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
12785 | |
12786 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 12787 | """GetRelationship(self) -> int""" |
54f9ee45 | 12788 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
12789 | |
12790 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 12791 | """SetRelationship(self, int r)""" |
54f9ee45 | 12792 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
12793 | |
12794 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 12795 | """ |
a95a7133 | 12796 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
12797 | |
12798 | Reset constraint if it mentions otherWin | |
12799 | """ | |
54f9ee45 | 12800 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
12801 | |
12802 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 12803 | """ |
a95a7133 | 12804 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
12805 | |
12806 | Try to satisfy constraint | |
12807 | """ | |
54f9ee45 | 12808 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
12809 | |
12810 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 12811 | """ |
a95a7133 | 12812 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
12813 | |
12814 | Get the value of this edge or dimension, or if this | |
12815 | is not determinable, -1. | |
12816 | """ | |
54f9ee45 | 12817 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 12818 | |
2131d850 | 12819 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d14a1e28 RD |
12820 | |
12821 | class LayoutConstraints(Object): | |
15afbcd0 | 12822 | """ |
41e2b43e RD |
12823 | **Note:** constraints are now deprecated and you should use sizers |
12824 | instead. | |
15afbcd0 | 12825 | |
41e2b43e RD |
12826 | Objects of this class can be associated with a window to define its |
12827 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
12828 | |
12829 | The class consists of the following eight constraints of class | |
12830 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
12831 | directly to set the appropriate constraints. | |
12832 | ||
12833 | * left: represents the left hand edge of the window | |
12834 | * right: represents the right hand edge of the window | |
12835 | * top: represents the top edge of the window | |
12836 | * bottom: represents the bottom edge of the window | |
12837 | * width: represents the width of the window | |
12838 | * height: represents the height of the window | |
12839 | * centreX: represents the horizontal centre point of the window | |
12840 | * centreY: represents the vertical centre point of the window | |
12841 | ||
41e2b43e RD |
12842 | Most constraints are initially set to have the relationship |
12843 | wxUnconstrained, which means that their values should be calculated by | |
12844 | looking at known constraints. The exceptions are width and height, | |
12845 | which are set to wxAsIs to ensure that if the user does not specify a | |
12846 | constraint, the existing width and height will be used, to be | |
12847 | compatible with panel items which often have take a default size. If | |
12848 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
12849 | ||
12850 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
12851 | |
12852 | """ | |
0085ce49 RD |
12853 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12854 | __repr__ = _swig_repr | |
54f9ee45 RD |
12855 | left = property(_core_.LayoutConstraints_left_get) |
12856 | top = property(_core_.LayoutConstraints_top_get) | |
12857 | right = property(_core_.LayoutConstraints_right_get) | |
12858 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
12859 | width = property(_core_.LayoutConstraints_width_get) | |
12860 | height = property(_core_.LayoutConstraints_height_get) | |
12861 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
12862 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
0085ce49 | 12863 | def __init__(self, *args, **kwargs): |
a95a7133 | 12864 | """__init__(self) -> LayoutConstraints""" |
0085ce49 RD |
12865 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
12866 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
12867 | __del__ = lambda self : None; | |
e811c8ce | 12868 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 12869 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 12870 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
12871 | |
12872 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 12873 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 12874 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 12875 | |
2131d850 | 12876 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d14a1e28 RD |
12877 | |
12878 | #---------------------------------------------------------------------------- | |
12879 | ||
322913ce | 12880 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
12881 | try: |
12882 | True | |
12883 | except NameError: | |
322913ce RD |
12884 | __builtins__.True = 1==1 |
12885 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
12886 | def bool(value): return not not value |
12887 | __builtins__.bool = bool | |
d14a1e28 | 12888 | |
d14a1e28 RD |
12889 | |
12890 | ||
12891 | # workarounds for bad wxRTTI names | |
12892 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
12893 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
12894 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
12895 | ||
12896 | ||
12897 | #---------------------------------------------------------------------------- | |
12898 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 12899 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
12900 | |
12901 | from __version__ import * | |
12902 | __version__ = VERSION_STRING | |
12903 | ||
7bc1e663 RD |
12904 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
12905 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 12906 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 12907 | import warnings |
7bc1e663 | 12908 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 RD |
12909 | |
12910 | #---------------------------------------------------------------------------- | |
12911 | ||
70b7a5fe RD |
12912 | # Set wxPython's default string<-->unicode conversion encoding from |
12913 | # the locale, but only if Python's default hasn't been changed. (We | |
12914 | # assume that if the user has customized it already then that is the | |
12915 | # encoding we need to use as well.) | |
12916 | # | |
12917 | # The encoding selected here is used when string or unicode objects | |
12918 | # need to be converted in order to pass them to wxWidgets. Please be | |
12919 | # aware that the default encoding within the same locale may be | |
12920 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
12921 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
12922 | # between the common latin/roman encodings. | |
396fb509 RD |
12923 | |
12924 | default = _sys.getdefaultencoding() | |
12925 | if default == 'ascii': | |
12926 | import locale | |
12927 | import codecs | |
12928 | try: | |
12929 | default = locale.getdefaultlocale()[1] | |
12930 | codecs.lookup(default) | |
70b7a5fe | 12931 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
12932 | default = _sys.getdefaultencoding() |
12933 | del locale | |
12934 | del codecs | |
5cbf236d RD |
12935 | if default: |
12936 | wx.SetDefaultPyEncoding(default) | |
12937 | del default | |
5cbf236d RD |
12938 | |
12939 | #---------------------------------------------------------------------------- | |
12940 | ||
d14a1e28 RD |
12941 | class PyDeadObjectError(AttributeError): |
12942 | pass | |
12943 | ||
d14a1e28 RD |
12944 | class _wxPyDeadObject(object): |
12945 | """ | |
12946 | Instances of wx objects that are OOR capable will have their __class__ | |
12947 | changed to this class when the C++ object is deleted. This should help | |
12948 | prevent crashes due to referencing a bogus C++ pointer. | |
12949 | """ | |
12950 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
12951 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
12952 | ||
3a04f143 | 12953 | def __repr__(self): |
d14a1e28 RD |
12954 | if not hasattr(self, "_name"): |
12955 | self._name = "[unknown]" | |
12956 | return self.reprStr % self._name | |
12957 | ||
3a04f143 | 12958 | def __getattr__(self, *args): |
d14a1e28 RD |
12959 | if not hasattr(self, "_name"): |
12960 | self._name = "[unknown]" | |
3a04f143 RD |
12961 | raise PyDeadObjectError(self.attrStr % self._name) |
12962 | ||
12963 | def __nonzero__(self): | |
12964 | return 0 | |
12965 | ||
12966 | ||
12967 | ||
12968 | class PyUnbornObjectError(AttributeError): | |
12969 | pass | |
12970 | ||
12971 | class _wxPyUnbornObject(object): | |
12972 | """ | |
54f9ee45 | 12973 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
12974 | imported, but their C++ instance is not created until the wx.App |
12975 | object is created and initialized. These object instances will | |
12976 | temporarily have their __class__ changed to this class so an | |
12977 | exception will be raised if they are used before the C++ instance | |
12978 | is ready. | |
12979 | """ | |
12980 | ||
12981 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
12982 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
12983 | ||
12984 | def __repr__(self): | |
12985 | #if not hasattr(self, "_name"): | |
12986 | # self._name = "[unknown]" | |
12987 | return self.reprStr #% self._name | |
12988 | ||
12989 | def __getattr__(self, *args): | |
12990 | #if not hasattr(self, "_name"): | |
12991 | # self._name = "[unknown]" | |
12992 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
12993 | |
12994 | def __nonzero__(self): | |
12995 | return 0 | |
12996 | ||
12997 | ||
12998 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
12999 | |
13000 | def CallAfter(callable, *args, **kw): | |
13001 | """ | |
13002 | Call the specified function after the current and pending event | |
13003 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
13004 | method calls from non-GUI threads. Any extra positional or |
13005 | keyword args are passed on to the callable when it is called. | |
13006 | ||
13007 | :see: `wx.FutureCall` | |
d14a1e28 RD |
13008 | """ |
13009 | app = wx.GetApp() | |
dfbb5885 | 13010 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 13011 | |
148275d3 RD |
13012 | if not hasattr(app, "_CallAfterId"): |
13013 | app._CallAfterId = wx.NewEventType() | |
13014 | app.Connect(-1, -1, app._CallAfterId, | |
13015 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 13016 | evt = wx.PyEvent() |
148275d3 | 13017 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
13018 | evt.callable = callable |
13019 | evt.args = args | |
13020 | evt.kw = kw | |
13021 | wx.PostEvent(app, evt) | |
13022 | ||
d14a1e28 RD |
13023 | #---------------------------------------------------------------------------- |
13024 | ||
13025 | ||
13026 | class FutureCall: | |
13027 | """ | |
8ac8dba0 | 13028 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
13029 | object once after the given amount of milliseconds, passing any |
13030 | positional or keyword args. The return value of the callable is | |
61863841 | 13031 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
13032 | |
13033 | If you don't need to get the return value or restart the timer | |
13034 | then there is no need to hold a reference to this object. It will | |
13035 | hold a reference to itself while the timer is running (the timer | |
13036 | has a reference to self.Notify) but the cycle will be broken when | |
13037 | the timer completes, automatically cleaning up the wx.FutureCall | |
13038 | object. | |
61863841 RD |
13039 | |
13040 | :see: `wx.CallAfter` | |
d14a1e28 RD |
13041 | """ |
13042 | def __init__(self, millis, callable, *args, **kwargs): | |
13043 | self.millis = millis | |
13044 | self.callable = callable | |
13045 | self.SetArgs(*args, **kwargs) | |
13046 | self.runCount = 0 | |
4276dc52 | 13047 | self.running = False |
d14a1e28 RD |
13048 | self.hasRun = False |
13049 | self.result = None | |
13050 | self.timer = None | |
13051 | self.Start() | |
13052 | ||
13053 | def __del__(self): | |
13054 | self.Stop() | |
13055 | ||
13056 | ||
13057 | def Start(self, millis=None, *args, **kwargs): | |
13058 | """ | |
13059 | (Re)start the timer | |
13060 | """ | |
13061 | self.hasRun = False | |
13062 | if millis is not None: | |
13063 | self.millis = millis | |
13064 | if args or kwargs: | |
13065 | self.SetArgs(*args, **kwargs) | |
13066 | self.Stop() | |
13067 | self.timer = wx.PyTimer(self.Notify) | |
13068 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 13069 | self.running = True |
d14a1e28 RD |
13070 | Restart = Start |
13071 | ||
13072 | ||
13073 | def Stop(self): | |
13074 | """ | |
13075 | Stop and destroy the timer. | |
13076 | """ | |
13077 | if self.timer is not None: | |
13078 | self.timer.Stop() | |
13079 | self.timer = None | |
13080 | ||
13081 | ||
13082 | def GetInterval(self): | |
13083 | if self.timer is not None: | |
13084 | return self.timer.GetInterval() | |
13085 | else: | |
13086 | return 0 | |
13087 | ||
13088 | ||
13089 | def IsRunning(self): | |
13090 | return self.timer is not None and self.timer.IsRunning() | |
13091 | ||
13092 | ||
13093 | def SetArgs(self, *args, **kwargs): | |
13094 | """ | |
13095 | (Re)set the args passed to the callable object. This is | |
13096 | useful in conjunction with Restart if you want to schedule a | |
13097 | new call to the same callable object but with different | |
13098 | parameters. | |
13099 | """ | |
13100 | self.args = args | |
13101 | self.kwargs = kwargs | |
13102 | ||
13103 | ||
13104 | def HasRun(self): | |
13105 | return self.hasRun | |
13106 | ||
13107 | def GetResult(self): | |
13108 | return self.result | |
13109 | ||
13110 | def Notify(self): | |
13111 | """ | |
13112 | The timer has expired so call the callable. | |
13113 | """ | |
13114 | if self.callable and getattr(self.callable, 'im_self', True): | |
13115 | self.runCount += 1 | |
4276dc52 | 13116 | self.running = False |
d14a1e28 RD |
13117 | self.result = self.callable(*self.args, **self.kwargs) |
13118 | self.hasRun = True | |
4276dc52 RD |
13119 | if not self.running: |
13120 | # if it wasn't restarted, then cleanup | |
13121 | wx.CallAfter(self.Stop) | |
d14a1e28 RD |
13122 | |
13123 | ||
a95a7133 RD |
13124 | |
13125 | #---------------------------------------------------------------------------- | |
13126 | # Control which items in this module should be documented by epydoc. | |
13127 | # We allow only classes and functions, which will help reduce the size | |
13128 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13129 | # and etc that don't make much sense by themselves, but are instead | |
13130 | # documented (or will be) as part of the classes/functions/methods | |
13131 | # where they should be used. | |
13132 | ||
66c033b4 RD |
13133 | class __DocFilter: |
13134 | """ | |
13135 | A filter for epydoc that only allows non-Ptr classes and | |
34e0a3bb | 13136 | functions, in order to reduce the clutter in the API docs. |
66c033b4 RD |
13137 | """ |
13138 | def __init__(self, globals): | |
13139 | self._globals = globals | |
13140 | ||
13141 | def __call__(self, name): | |
13142 | import types | |
13143 | obj = self._globals.get(name, None) | |
34e0a3bb RD |
13144 | |
13145 | # only document classes and function | |
66c033b4 RD |
13146 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: |
13147 | return False | |
34e0a3bb RD |
13148 | |
13149 | # skip other things that are private or will be documented as part of somethign else | |
0085ce49 | 13150 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
66c033b4 | 13151 | return False |
34e0a3bb RD |
13152 | |
13153 | # skip functions that are duplicates of static functions in a class | |
13154 | if name.find('_') != -1: | |
13155 | cls = self._globals.get(name.split('_')[0], None) | |
13156 | methname = name.split('_')[1] | |
13157 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
13158 | return False | |
13159 | ||
66c033b4 | 13160 | return True |
a95a7133 | 13161 | |
d14a1e28 RD |
13162 | #---------------------------------------------------------------------------- |
13163 | #---------------------------------------------------------------------------- | |
13164 | ||
13165 | # Import other modules in this package that should show up in the | |
13166 | # "core" wx namespace | |
54f9ee45 RD |
13167 | from _gdi import * |
13168 | from _windows import * | |
13169 | from _controls import * | |
13170 | from _misc import * | |
d14a1e28 RD |
13171 | |
13172 | #---------------------------------------------------------------------------- | |
13173 | #---------------------------------------------------------------------------- | |
13174 | ||
13175 | ||
32fe5131 | 13176 |