comparison frontends/src/wix/xmlui.py @ 1220:f91e7028e2c3

memory (params), tools (xml_tools), plugins, frontends: add "int" parameter type with "min" and "max" attributes
author souliane <souliane@mailoo.org>
date Fri, 03 Oct 2014 12:27:43 +0200
parents e2e1e27a3680
children
comparison
equal deleted inserted replaced
1219:16484ebb695b 1220:f91e7028e2c3
123 def _xmluiSetValue(self, value): 123 def _xmluiSetValue(self, value):
124 self.SetValue(value == 'true') 124 self.SetValue(value == 'true')
125 125
126 def _xmluiGetValue(self): 126 def _xmluiGetValue(self):
127 return "true" if self.GetValue() else "false" 127 return "true" if self.GetValue() else "false"
128
129
130 # TODO: use wx.SpinCtrl instead of wx.TextCtrl
131 class IntWidget(EventWidget, ValueWidget, xmlui.IntWidget, wx.TextCtrl):
132 _xmlui_change_event = wx.EVT_TEXT
133
134 def __init__(self, _xmlui_parent, value, read_only=False):
135 style = wx.TE_READONLY if read_only else 0
136 wx.TextCtrl.__init__(self, _xmlui_parent, -1, value, style=style)
137 self._xmlui_proportion = 1
128 138
129 139
130 class ButtonWidget(EventWidget, WixWidget, xmlui.ButtonWidget, wx.Button): 140 class ButtonWidget(EventWidget, WixWidget, xmlui.ButtonWidget, wx.Button):
131 _xmlui_change_event = wx.EVT_BUTTON 141 _xmlui_change_event = wx.EVT_BUTTON
132 142