comparison engine/extensions/pychan/widgets/slider.py @ 255:51cc05d862f2

Merged editor_rewrite branch to trunk. This contains changes that may break compatibility against existing clients. For a list of changes that may affect your client, see: http://wiki.fifengine.de/Changes_to_pychan_and_FIFE_in_editor_rewrite_branch
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 08 Jun 2009 16:00:02 +0000
parents a2d5e2721489
children 48c99636453e
comparison
equal deleted inserted replaced
254:10b5f7f36dd4 255:51cc05d862f2
23 23
24 HORIZONTAL = fife.Slider.HORIZONTAL 24 HORIZONTAL = fife.Slider.HORIZONTAL
25 VERTICAL = fife.Slider.VERTICAL 25 VERTICAL = fife.Slider.VERTICAL
26 26
27 ATTRIBUTES = Widget.ATTRIBUTES + [IntAttr('orientation'), FloatAttr('scale_start'), FloatAttr('scale_end')] 27 ATTRIBUTES = Widget.ATTRIBUTES + [IntAttr('orientation'), FloatAttr('scale_start'), FloatAttr('scale_end')]
28 DEFAULT_HEXPAND = 1
29 DEFAULT_VEXPAND = 0
28 30
29 def __init__(self, scaleStart=0.0, scaleEnd=1.0, orientation=HORIZONTAL, **kwargs): 31 def __init__(self, scaleStart=0.0, scaleEnd=1.0, orientation=HORIZONTAL, min_size=(10,10),**kwargs):
30 self.real_widget = fife.Slider(scaleStart, scaleEnd) 32 self.real_widget = fife.Slider(scaleStart, scaleEnd)
31 self.orientation = orientation 33 self.orientation = orientation
32 self.setOrientation(self.orientation) 34 self.setOrientation(self.orientation)
33 super(Slider, self).__init__(**kwargs) 35 super(Slider, self).__init__(min_size=min_size,**kwargs)
36
37 self.accepts_data = True
38 self._realSetData = self.setValue
39 self._realGetData = self.getValue
34 40
35 def _setScale(self, start, end): 41 def _setScale(self, start, end):
36 """setScale(self, double scaleStart, double scaleEnd)""" 42 """setScale(self, double scaleStart, double scaleEnd)"""
37 if type(start) != float: 43 if type(start) != float:
38 raise RuntimeError("Slider expects float for start scale") 44 raise RuntimeError("Slider expects float for start scale")