]> git.saurik.com Git - wxWidgets.git/blame - wxPython/wx/py/wxd/Parameters.py
updated Joystick demo, is now wxDesigner-less
[wxWidgets.git] / wxPython / wx / py / wxd / Parameters.py
CommitLineData
1e4a197e
RD
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
15class _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',
1fded56b 39 'HORIZONTAL',
1e4a197e
RD
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
63for _param in _params:
64 exec 'class %s(_Param): pass' % _param
65 exec '%s = %s()' % (_param, _param)
66
67del _param
68del _params
69del _Param