]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/wxd/Parameters.py
2bc3c79592f70ad987f6db413cea3b9a03eda93b
[wxWidgets.git] / wxPython / wxPython / lib / PyCrust / wxd / Parameters.py
1 """Decorator classes for documentation and shell scripting.
2 """
3
4 __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
5 __cvsid__ = "$Id$"
6 __revision__ = "$Revision$"[11:-2]
7
8
9 # These are not the real wxPython classes. These are Python versions
10 # for documentation purposes. They are also used to apply docstrings
11 # to the real wxPython classes, which are SWIG-generated wrappers for
12 # C-language classes.
13
14
15 class _Param:
16 """Used by this module to represent default wxPython parameter values,
17 including parameter representations like style=wx.HSCROLL|wx.VSCROLL."""
18
19 def __init__(self, value=None):
20 if value is None:
21 value = 'wx.' + self.__class__.__name__
22 self.value = value
23
24 def __repr__(self):
25 return self.value
26
27 def __or__(self, other):
28 value = '%s|%s' % (self, other)
29 return self.__class__(value)
30
31 _params = (
32 'BOTH',
33 'DEFAULT_FRAME_STYLE',
34 'DefaultPosition',
35 'DefaultSize',
36 'DefaultValidator',
37 'EmptyString',
38 'EVT_NULL',
39 'HSCROLL',
40 'NO_BORDER',
41 'NULL',
42 'NullColour',
43 'PyFrameNameStr',
44 'PyNOTEBOOK_NAME',
45 'PyPanelNameStr',
46 'PyStatusLineNameStr',
47 'PySTCNameStr',
48 'PyToolBarNameStr',
49 'SIZE_AUTO',
50 'SIZE_USE_EXISTING',
51 'ST_SIZEGRIP',
52 'TAB_TRAVERSAL',
53 'TB_HORIZONTAL',
54 'VSCROLL',
55 )
56
57 ## Create classes, then instances, like this:
58
59 ## class BOTH(Param): pass
60 ## BOTH = BOTH()
61
62 for _param in _params:
63 exec 'class %s(_Param): pass' % _param
64 exec '%s = %s()' % (_param, _param)
65
66 del _param
67 del _params
68 del _Param