comparison frontends/src/wix/xmlui.py @ 975:b37b1d183ac3

reverted changeset 5c7707c958d8 (revision 969)
author souliane <souliane@mailoo.org>
date Thu, 03 Apr 2014 14:38:48 +0200
parents 5c7707c958d8
children 68faf7d77a42
comparison
equal deleted inserted replaced
974:54cd05f68c7c 975:b37b1d183ac3
40 class WixWidget(object): 40 class WixWidget(object):
41 _xmlui_proportion = 0 41 _xmlui_proportion = 0
42 42
43 43
44 class ValueWidget(WixWidget): 44 class ValueWidget(WixWidget):
45
46 def _xmluiSetValue(self, value):
47 self.SetValue(value)
48
49 def _xmluiGetValue(self): 45 def _xmluiGetValue(self):
50 return self.GetValue() 46 return self.GetValue()
51 47
52 48
53 class EmptyWidget(WixWidget, xmlui.EmptyWidget, wx.Window): 49 class EmptyWidget(WixWidget, xmlui.EmptyWidget, wx.Window):
107 103
108 def __init__(self, parent, state): 104 def __init__(self, parent, state):
109 wx.CheckBox.__init__(self, parent, -1, "", style=wx.CHK_2STATE) 105 wx.CheckBox.__init__(self, parent, -1, "", style=wx.CHK_2STATE)
110 self.SetValue(state) 106 self.SetValue(state)
111 self._xmlui_proportion = 1 107 self._xmlui_proportion = 1
112
113 def _xmluiSetValue(self, value):
114 self.SetValue(value == 'true')
115 108
116 def _xmluiGetValue(self): 109 def _xmluiGetValue(self):
117 return "true" if self.GetValue() else "false" 110 return "true" if self.GetValue() else "false"
118 111
119 112
157 ret = [] 150 ret = []
158 labels = [self.GetString(idx) for idx in self.GetSelections()] 151 labels = [self.GetString(idx) for idx in self.GetSelections()]
159 for label in labels: 152 for label in labels:
160 ret.append(self._xmlui_attr_map[label]) 153 ret.append(self._xmlui_attr_map[label])
161 return ret 154 return ret
162
163 def _xmluiAddValues(self, values, select=True):
164 wx.ListBox.AppendItems(values)
165 if select:
166 self._xmluiSelectValues(values)
167 155
168 156
169 class WixContainer(object): 157 class WixContainer(object):
170 _xmlui_proportion = 1 158 _xmlui_proportion = 1
171 159