]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/py/wxd/Parameters.py
doc tweaks, typo fixed, etc.
[wxWidgets.git] / wxPython / wx / py / 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 'HORIZONTAL',
40 'HSCROLL',
41 'NO_BORDER',
42 'NULL',
43 'NullColour',
44 'PyFrameNameStr',
45 'PyNOTEBOOK_NAME',
46 'PyPanelNameStr',
47 'PyStatusLineNameStr',
48 'PySTCNameStr',
49 'PyToolBarNameStr',
50 'SIZE_AUTO',
51 'SIZE_USE_EXISTING',
52 'ST_SIZEGRIP',
53 'TAB_TRAVERSAL',
54 'TB_HORIZONTAL',
55 'VSCROLL',
56 )
57
58 ## Create classes, then instances, like this:
59
60 ## class BOTH(Param): pass
61 ## BOTH = BOTH()
62
63 for _param in _params:
64 exec 'class %s(_Param): pass' % _param
65 exec '%s = %s()' % (_param, _param)
66
67 del _param
68 del _params
69 del _Param