comparison src/tools/common/template_xmlui.py @ 2397:7fff98d64ab5

core (XMLUI), template(XMLUI): added flags to ListWidget: following flags have been added: - noselect: list selection is not allowed (options are the important data) - extensible: user can add elements to the list - reducible: user can remove elements from the list - inline: presentation hint: the list should be displayed horizontally
author Goffi <goffi@goffi.org>
date Fri, 27 Oct 2017 18:03:35 +0200
parents 42a54cbc1872
children 8253ea069781
comparison
equal deleted inserted replaced
2396:66baa687c682 2397:7fff98d64ab5
78 ret = [] 78 ret = []
79 for value,label in self.options: 79 for value,label in self.options:
80 if value in self.selected: 80 if value in self.selected:
81 ret.append(label) 81 ret.append(label)
82 return ret 82 return ret
83
84 @property
85 def inline(self):
86 return u'inline' in self.style
87
88 @property
89 def no_select(self):
90 return u'noselect' in self.style
83 91
84 92
85 class EmptyWidget(xmlui.EmptyWidget, Widget): 93 class EmptyWidget(xmlui.EmptyWidget, Widget):
86 94
87 def __init__(self, _xmlui_parent): 95 def __init__(self, _xmlui_parent):