From 513a789819efefc582cbabe6a1800f0625605226 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 12 Apr 2007 19:58:31 +0000 Subject: [PATCH 1/1] add StaticMultiList for MultiContentList-styled content --- lib/python/Components/Converter/Makefile.am | 4 ++-- .../Components/Converter/StaticMultiList.py | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 lib/python/Components/Converter/StaticMultiList.py diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index a5d95f53..d525c0ae 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -3,5 +3,5 @@ installdir = $(LIBDIR)/enigma2/python/Components/Converter install_PYTHON = \ __init__.py ClockToText.py Converter.py EventName.py StaticText.py EventTime.py \ Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \ - ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py - + ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \ + StaticMultiList.py diff --git a/lib/python/Components/Converter/StaticMultiList.py b/lib/python/Components/Converter/StaticMultiList.py new file mode 100644 index 00000000..d02ff336 --- /dev/null +++ b/lib/python/Components/Converter/StaticMultiList.py @@ -0,0 +1,24 @@ +from enigma import eListboxPythonMultiContent +from Components.Converter.StringList import StringList + +class StaticMultiList(StringList): + """Turns a python list in 'multi list format' into a list which can be used in a listbox.""" + def changed(self, what): + if not self.content: + self.content = eListboxPythonMultiContent() + + if self.source: + # setup the required item height, as given by the source. + self.content.setItemHeight(self.source.item_height) + + # also setup fonts (also given by source) + index = 0 + for f in self.source.fonts: + self.content.setFont(index, f) + index += 1 + + if self.source: + self.content.setList(self.source.list) + + print "downstream_elements:", self.downstream_elements + self.downstream_elements.changed(what) -- 2.30.2