tools, frontends (xmlui): add setter methods for widgets + new widget InternalButton to process UI operations

This commit is contained in:
souliane 2014-04-01 21:30:21 +02:00
commit 6608eafb9f

View file

@ -42,6 +42,10 @@ class WixWidget(object):
class ValueWidget(WixWidget):
def _xmluiSetValue(self, value):
self.SetValue(value)
def _xmluiGetValue(self):
return self.GetValue()
@ -106,6 +110,9 @@ class BoolWidget(EventWidget, ValueWidget, xmlui.BoolWidget, wx.CheckBox):
self.SetValue(state)
self._xmlui_proportion = 1
def _xmluiSetValue(self, value):
self.SetValue(value == 'true')
def _xmluiGetValue(self):
return "true" if self.GetValue() else "false"
@ -153,6 +160,11 @@ class ListWidget(EventWidget, WixWidget, xmlui.ListWidget, wx.ListBox):
ret.append(self._xmlui_attr_map[label])
return ret
def _xmluiAddValues(self, values, select=True):
wx.ListBox.AppendItems(values)
if select:
self._xmluiSelectValues(values)
class WixContainer(object):
_xmlui_proportion = 1