Exemplo n.º 1
0
 def createWidget(self, parent):
     if self.allmarked:
         widget = eLabel(parent, -2)
     else:
         widget = eLabel(parent, self.currPos - self.offset)
     widget.setNoWrap(True)
     return widget
Exemplo n.º 2
0
 def postWidgetCreate(self, instance):
     instance.setWrapAround(True)
     self.selectionChanged_conn = instance.selectionChanged.connect(
         self.selectionChanged)
     instance.setContent(self.l)
     self._textRenderer = eLabel(instance)
     self._textRenderer.hide()
Exemplo n.º 3
0
    def applySkin(self, desktop, parent):
        ret = False
        if self.skinAttributes is not None:
            widget_attribs = []
            scrollbar_attribs = []
            for attrib, value in self.skinAttributes:
                if 'borderColor' in attrib or 'borderWidth' in attrib:
                    scrollbar_attribs.append((attrib, value))
                if 'transparent' in attrib or 'backgroundColor' in attrib:
                    widget_attribs.append((attrib, value))
                if 'split' in attrib:
                    self.split = int(value)
                    if self.split:
                        self.right_text = eLabel(self.instance)
                if 'colposition' in attrib:
                    self.column = int(value)
                if 'dividechar' in attrib:
                    self.splitchar = value

            if self.split:
                skin.applyAllAttributes(
                    self.long_text, desktop,
                    self.skinAttributes + [('halign', 'left')], parent.scale)
                skin.applyAllAttributes(
                    self.right_text, desktop, self.skinAttributes +
                    [('transparent', '1'),
                     ('halign', 'left' and self.column or 'right')],
                    parent.scale)
            else:
                skin.applyAllAttributes(self.long_text, desktop,
                                        self.skinAttributes, parent.scale)
            skin.applyAllAttributes(self.instance, desktop, widget_attribs,
                                    parent.scale)
            skin.applyAllAttributes(self.scrollbar, desktop,
                                    scrollbar_attribs + widget_attribs,
                                    parent.scale)
            ret = True
        s = self.long_text.size()
        self.instance.move(self.long_text.position())
        lineheight = fontRenderClass.getInstance().getLineHeight(
            self.long_text.getFont())
        if not lineheight:
            lineheight = 30
        lines = int(s.height() / lineheight)
        self.pageHeight = int(lines * lineheight)
        self.instance.resize(
            eSize(s.width(), self.pageHeight + int(lineheight / 6)))
        self.scrollbar.move(ePoint(s.width() - 10, 0))
        self.scrollbar.resize(eSize(10, self.pageHeight + int(lineheight / 6)))
        self.scrollbar.setOrientation(eSlider.orVertical)
        self.scrollbar.setRange(0, 100)
        self.scrollbar.setBorderWidth(1)
        self.long_text.move(ePoint(0, 0))
        self.long_text.resize(eSize(s.width() - 30, self.pageHeight * 40))
        if self.split:
            self.right_text.move(ePoint(self.column, 0))
            self.right_text.resize(
                eSize(s.width() - self.column - 30, self.pageHeight * 40))
        self.setText(self.message)
        return ret
Exemplo n.º 4
0
 def applySkin(self, desktop, parent):
     ret = False
     if self.skinAttributes is not None:
         widget_attribs = []
         scrollbar_attribs = []
         for (attrib, value) in self.skinAttributes:
             if "borderColor" in attrib or "borderWidth" in attrib:
                 scrollbar_attribs.append((attrib, value))
             if "transparent" in attrib or "backgroundColor" in attrib:
                 widget_attribs.append((attrib, value))
             if "split" in attrib:
                 self.split = int(value)
                 if self.split:
                     self.right_text = eLabel(self.instance)
             if "colposition" in attrib:
                 self.column = int(value)
             if "dividechar" in attrib:
                 self.splitchar = value
         if self.split:
             skin.applyAllAttributes(
                 self.long_text, desktop,
                 self.skinAttributes + [("halign", "left")], parent.scale)
             skin.applyAllAttributes(
                 self.right_text, desktop, self.skinAttributes +
                 [("transparent", "1"),
                  ("halign", "left" and self.column or "right")],
                 parent.scale)
         else:
             skin.applyAllAttributes(self.long_text, desktop,
                                     self.skinAttributes, parent.scale)
         skin.applyAllAttributes(self.instance, desktop, widget_attribs,
                                 parent.scale)
         skin.applyAllAttributes(self.scrollbar, desktop,
                                 scrollbar_attribs + widget_attribs,
                                 parent.scale)
         ret = True
     s = self.long_text.size()
     self.instance.move(self.long_text.position())
     lineheight = fontRenderClass.getInstance().getLineHeight(
         self.long_text.getFont())
     if not lineheight:
         lineheight = 30  # assume a random lineheight if nothing is visible
     lines = (int)(s.height() / lineheight)
     self.pageHeight = (int)(lines * lineheight)
     self.instance.resize(
         eSize(s.width(), self.pageHeight + (int)(lineheight / 6)))
     self.scrollbar.move(ePoint(s.width() - 20, 0))
     self.scrollbar.resize(
         eSize(20, self.pageHeight + (int)(lineheight / 6)))
     self.scrollbar.setOrientation(eSlider.orVertical)
     self.scrollbar.setRange(0, 100)
     self.scrollbar.setBorderWidth(1)
     self.long_text.move(ePoint(0, 0))
     self.long_text.resize(eSize(s.width() - 30, self.pageHeight * 16))
     if self.split:
         self.right_text.move(ePoint(self.column, 0))
         self.right_text.resize(
             eSize(s.width() - self.column - 30, self.pageHeight * 16))
     self.setText(self.message)
     return ret
Exemplo n.º 5
0
	def createWidget(self, parent):
		if self.SNR_PERCENTAGE <= self.type <= self.BER_VALUE or self.type == self.LOCK_STATE:
			return eLabel(parent)
		elif self.SNR_BAR <= self.type <= self.BER_BAR:
			self.g = eSlider(parent)
			self.g.setRange(0, 100)
			return self.g
Exemplo n.º 6
0
 def createWidget(self, parent):
     if self.SNR_PERCENTAGE <= self.type <= self.BER_VALUE or self.type == self.LOCK_STATE:
         return eLabel(parent)
     elif self.SNR_BAR <= self.type <= self.BER_BAR:
         self.g = eSlider(parent)
         self.g.setRange(0, 100)
         return self.g
Exemplo n.º 7
0
	def applySkin(self, desktop, parent):
		scrollbarWidth = 20
		scrollbarBorderWidth = 1
		ret = False
		if self.skinAttributes:
			widget_attribs = []
			scrollbar_attribs = []
			for (attrib, value) in self.skinAttributes:
				if "borderColor" in attrib or "borderWidth" in attrib:
					scrollbar_attribs.append((attrib,value))
				if "transparent" in attrib or "backgroundColor" in attrib:
					widget_attribs.append((attrib,value))
				if "scrollbarSliderForegroundColor" in attrib:
					scrollbar_attribs.append((attrib,value))
					self.skinAttributes.remove((attrib, value))
				if "scrollbarSliderBorderColor" in attrib:
					scrollbar_attribs.append((attrib,value))
					self.skinAttributes.remove((attrib, value))
				if "scrollbarSliderPicture" in attrib:
					scrollbar_attribs.append((attrib,value))
					self.skinAttributes.remove((attrib, value))
				if "scrollbarBackgroundPicture" in attrib:
					scrollbar_attribs.append((attrib,value))
					self.skinAttributes.remove((attrib, value))
				if "scrollbarWidth" in attrib:
					scrollbarWidth = int(value)
					self.skinAttributes.remove((attrib, value))
				if "scrollbarSliderBorderWidth" in attrib:
					scrollbarBorderWidth = int(value)
					self.skinAttributes.remove((attrib, value))
				if "split" in attrib:
					self.split = int(value)
					if self.split:
						self.right_text = eLabel(self.instance)
					self.skinAttributes.remove((attrib, value))	
				if "colposition" in attrib:
					self.column = int(value)
				if "dividechar" in attrib:
					self.splitchar = value
			if self.split:
				skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes + [("halign", "left")], parent.scale)
				skin.applyAllAttributes(self.right_text, desktop, self.skinAttributes + [("transparent", "1"), ("halign", "left" if self.column else "right")], parent.scale)
			else:
				skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes, parent.scale)
			skin.applyAllAttributes(self.instance, desktop, widget_attribs, parent.scale)
			skin.applyAllAttributes(self.scrollbar, desktop, scrollbar_attribs + widget_attribs, parent.scale)
			ret = True
		self.pageWidth = self.long_text.size().width()
		lineheight = fontRenderClass.getInstance().getLineHeight(self.long_text.getFont()) or 30 # assume a random lineheight if nothing is visible
		lines = int(self.long_text.size().height() / lineheight)
		self.pageHeight = int(lines * lineheight)
		self.instance.move(self.long_text.position())
		self.instance.resize(eSize(self.pageWidth, self.pageHeight + int(lineheight/6)))
		self.scrollbar.move(ePoint(self.pageWidth - scrollbarWidth, 0))
		self.scrollbar.resize(eSize(scrollbarWidth, self.pageHeight + int(lineheight / 6)))
		self.scrollbar.setOrientation(eSlider.orVertical)
		self.scrollbar.setRange(0, 100)
		self.scrollbar.setBorderWidth(scrollbarBorderWidth)
		self.setText(self.message)
		return ret
Exemplo n.º 8
0
	def postWidgetCreate(self, instance):
		instance.setWrapAround(True)
		instance.setContent(self.l)
		self.selectionChanged_conn = instance.selectionChanged.connect(self.selectionChanged)
		self.setMode(self.mode)
		self.textRenderer = eLabel(self.instance)
		self.textRenderer.resize(eSize(self.getDesktopWith() / 3, 0))
		self.textRenderer.hide()
Exemplo n.º 9
0
 def postWidgetCreate(self, instance):
     for (attrib, value) in self.skinAttributes:
         if attrib == "size":
             x, y = value.split(',')
             self.W, self.H = int(x), int(y)
     self.instance.move(ePoint(0, 0))
     self.instance.resize(eSize(self.W, self.H))
     self.txLabel = eLabel(instance)
Exemplo n.º 10
0
	def postWidgetCreate(self, instance):
		instance.setWrapAround(True)
		instance.setContent(self.l)
		instance.selectionChanged.get().append(self.selectionChanged)
		self.setMode(self.mode)
		self.textRenderer = eLabel(self.instance)
		self.textRenderer.resize(eSize(400,0))
		self.textRenderer.hide()
 def postWidgetCreate(self, instance):
     for (attrib, value) in self.skinAttributes:
         if attrib == "size":
             x, y = value.split(',')
             self.W, self.H = int(x), int(y)
     self.instance.setSize(eSize(self.W, self.H))
     self.testSizeLabel = eLabel(instance)
     self.testSizeLabel.hide()
Exemplo n.º 12
0
 def postWidgetCreate(self, instance):
     for (attrib, value) in self.skinAttributes:
         if attrib == "size":
             x, y = value.split(',')
             self.W, self.H = int(x), int(y)
     self.instance.setSize(eSize(self.W, self.H))
     self.test_label = eLabel(instance)
     self.mTimer = eTimer()
     self.mTimer.callback.append(self.movingLoop)
Exemplo n.º 13
0
	def postWidgetCreate(self, instance):
		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				x, y = value.split(',')
				self.W, self.H = int(x), int(y)
		self.instance.setSize( eSize(self.W,self.H) )
		self.test_label = eLabel(instance)
		self.mTimer = eTimer()
		self.mTimer.callback.append(self.movingLoop)
Exemplo n.º 14
0
 def postWidgetCreate(self, instance):
     instance.setWrapAround(True)
     instance.setContent(self.l)
     self.selectionChanged_conn = instance.selectionChanged.connect(
         self.selectionChanged)
     self.setMode(self.mode)
     self.textRenderer = eLabel(self.instance)
     self.textRenderer.resize(eSize(self.getDesktopWith() / 3, 0))
     self.textRenderer.hide()
Exemplo n.º 15
0
	def applySkin(self, desktop, parent):
		scrollbarWidth = 20
		scrollbarBorderWidth = 1
		ret = False
		if self.skinAttributes:
			widget_attribs = []
			scrollbar_attribs = []
			scrollbarAttrib = ["borderColor", "borderWidth", "scrollbarSliderForegroundColor", "scrollbarSliderBorderColor"]
			for (attrib, value) in self.skinAttributes[:]:
				if attrib in scrollbarAttrib:
					scrollbar_attribs.append((attrib, value))
					self.skinAttributes.remove((attrib, value))
				elif attrib in ("scrollbarSliderPicture", "sliderPixmap"):
					self.scrollbar.setPixmap(loadPixmap(value, desktop))
					self.skinAttributes.remove((attrib, value))
				elif attrib in ("scrollbarBackgroundPicture", "scrollbarbackgroundPixmap"):
					self.scrollbar.setBackgroundPixmap(loadPixmap(value, desktop))
					self.skinAttributes.remove((attrib, value))
				elif "transparent" in attrib or "backgroundColor" in attrib:
					widget_attribs.append((attrib, value))
				elif "scrollbarWidth" in attrib:
					scrollbarWidth = int(value)
					self.skinAttributes.remove((attrib, value))
				elif "scrollbarSliderBorderWidth" in attrib:
					scrollbarBorderWidth = int(value)
					self.skinAttributes.remove((attrib, value))
				elif "split" in attrib:
					self.split = 1 if value.lower() in ("1", "enabled", "on", "split", "true", "yes") else 0
					if self.split:
						self.right_text = eLabel(self.instance)
					self.skinAttributes.remove((attrib, value))
				elif "colposition" in attrib or "colPosition" in attrib:
					self.column = int(value)
				elif "dividechar" in attrib or "divideChar" in attrib:
					self.splitchar = value
			if self.split:
				applyAllAttributes(self.long_text, desktop, self.skinAttributes + [("halign", "left")], parent.scale)
				applyAllAttributes(self.right_text, desktop, self.skinAttributes + [("transparent", "1"), ("halign", "left" if self.column else "right")], parent.scale)
			else:
				applyAllAttributes(self.long_text, desktop, self.skinAttributes, parent.scale)
			applyAllAttributes(self.instance, desktop, widget_attribs, parent.scale)
			applyAllAttributes(self.scrollbar, desktop, scrollbar_attribs + widget_attribs, parent.scale)
			ret = True
		self.pageWidth = self.long_text.size().width()
		lineheight = fontRenderClass.getInstance().getLineHeight(self.long_text.getFont()) or 30 # assume a random lineheight if nothing is visible
		lines = int(self.long_text.size().height() / lineheight)
		self.pageHeight = int(lines * lineheight)
		self.instance.move(self.long_text.position())
		self.instance.resize(eSize(self.pageWidth, self.pageHeight + int(lineheight / 6)))
		self.long_text.resize(eSize(self.pageWidth - 30, self.pageHeight + int(lineheight / 6)))
		self.scrollbar.move(ePoint(self.pageWidth - scrollbarWidth, 0))
		self.scrollbar.resize(eSize(scrollbarWidth, self.pageHeight + int(lineheight / 6)))
		self.scrollbar.setOrientation(eSlider.orVertical)
		self.scrollbar.setRange(0, 100)
		self.scrollbar.setBorderWidth(scrollbarBorderWidth)
		self.setText(self.message)
		return ret
Exemplo n.º 16
0
 def postWidgetCreate(self, instance):
     for (attrib, value) in self.skinAttributes:
         if attrib == "size":
             x, y = value.split(',')
             self.W, self.H = int(x), int(y)
     self.instance.move(ePoint(0, 0))
     self.instance.resize(eSize(self.W, self.H))
     self.scroll_label = eLabel(instance)
     self.__timer = eTimer()
     self.__timer_conn = None
     self.__timer_conn = self.__timer.timeout.connect(self.movingLoop)
Exemplo n.º 17
0
    def postWidgetCreate(self, instance):
        for attrib, value in self.skinAttributes:
            if attrib == 'size':
                x, y = value.split(',')
                self.W, self.H = int(x), int(y)

        self.instance.move(ePoint(0, 0))
        self.instance.resize(eSize(self.W, self.H))
        self.scroll_label = eLabel(instance)
        self.mTimer = eTimer()
        self.mTimer.callback.append(self.movingLoop)
Exemplo n.º 18
0
    def postWidgetCreate(self, instance):
        for attrib, value in self.skinAttributes:
            if attrib == 'size':
                x, y = value.split(',')
                self.W, self.H = int(x), int(y)

        self.instance.move(ePoint(0, 0))
        self.instance.resize(eSize(self.W, self.H))
        self.scroll_label = eLabel(instance)
        self.mTimer = eTimer()
        self.mTimer.callback.append(self.movingLoop)
Exemplo n.º 19
0
    def applySkin(self, desktop, parent):
        ret = False
        if self.skinAttributes is not None:
            widget_attribs = []
            scrollbar_attribs = []
            for attrib, value in self.skinAttributes:
                if 'borderColor' in attrib or 'borderWidth' in attrib:
                    scrollbar_attribs.append((attrib, value))
                if 'transparent' in attrib or 'backgroundColor' in attrib:
                    widget_attribs.append((attrib, value))
                if 'split' in attrib:
                    self.split = int(value)
                    if self.split:
                        self.right_text = eLabel(self.instance)
                if 'colposition' in attrib:
                    self.column = int(value)
                if 'dividechar' in attrib:
                    self.splitchar = value

            if self.split:
                skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes + [('halign', 'left')], parent.scale)
                skin.applyAllAttributes(self.right_text, desktop, self.skinAttributes + [('transparent', '1'), ('halign', 'left' and self.column or 'right')], parent.scale)
            else:
                skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes, parent.scale)
            skin.applyAllAttributes(self.instance, desktop, widget_attribs, parent.scale)
            skin.applyAllAttributes(self.scrollbar, desktop, scrollbar_attribs + widget_attribs, parent.scale)
            ret = True
        s = self.long_text.size()
        self.instance.move(self.long_text.position())
        lineheight = fontRenderClass.getInstance().getLineHeight(self.long_text.getFont())
        if not lineheight:
            lineheight = 30
        lines = int(s.height() / lineheight)
        self.pageHeight = int(lines * lineheight)
        self.instance.resize(eSize(s.width(), self.pageHeight + int(lineheight / 6)))
        self.scrollbar.move(ePoint(s.width() - 10, 0))
        self.scrollbar.resize(eSize(10, self.pageHeight + int(lineheight / 6)))
        self.scrollbar.setOrientation(eSlider.orVertical)
        self.scrollbar.setRange(0, 100)
        self.scrollbar.setBorderWidth(1)
        self.long_text.move(ePoint(0, 0))
        self.long_text.resize(eSize(s.width() - 30, self.pageHeight * 40))
        if self.split:
            self.right_text.move(ePoint(self.column, 0))
            self.right_text.resize(eSize(s.width() - self.column - 30, self.pageHeight * 40))
        self.setText(self.message)
        return ret
Exemplo n.º 20
0
	def applySkin(self, desktop, parent):
		ret = False
		if self.skinAttributes is not None:
			widget_attribs = [ ]
			scrollbar_attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if "borderColor" in attrib or "borderWidth" in attrib:
					scrollbar_attribs.append((attrib,value))
				if "transparent" in attrib or "backgroundColor" in attrib:
					widget_attribs.append((attrib,value))
				if "split" in attrib:
					self.split = int(value)
					if self.split:
						self.right_text = eLabel(self.instance)
				if "colposition" in attrib:
					self.column = int(value)
				if "dividechar" in attrib:
					self.splitchar = value
			if self.split:
				skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes + [("halign", "left")], parent.scale)
				skin.applyAllAttributes(self.right_text, desktop, self.skinAttributes + [("transparent", "1"), ("halign", "left" and self.column or "right")], parent.scale)
			else:
				skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes, parent.scale)
			skin.applyAllAttributes(self.instance, desktop, widget_attribs, parent.scale)
			skin.applyAllAttributes(self.scrollbar, desktop, scrollbar_attribs+widget_attribs, parent.scale)
			ret = True
		s = self.long_text.size()
		self.instance.move(self.long_text.position())
		lineheight=fontRenderClass.getInstance().getLineHeight( self.long_text.getFont() )
		if not lineheight:
			lineheight = 30 # assume a random lineheight if nothing is visible
		lines = (int)(s.height() / lineheight)
		self.pageHeight = (int)(lines * lineheight)
		self.instance.resize(eSize(s.width(), self.pageHeight+(int)(lineheight/6)))
		self.scrollbar.move(ePoint(s.width()-20,0))
		self.scrollbar.resize(eSize(20,self.pageHeight+(int)(lineheight/6)))
		self.scrollbar.setOrientation(eSlider.orVertical);
		self.scrollbar.setRange(0,100)
		self.scrollbar.setBorderWidth(1)
		self.long_text.move(ePoint(0,0))
		self.long_text.resize(eSize(s.width()-30, self.pageHeight*16))
		if self.split:
			self.right_text.move(ePoint(self.column,0))
			self.right_text.resize(eSize(s.width()-self.column-30, self.pageHeight*16))
		self.setText(self.message)
		return ret
Exemplo n.º 21
0
	def postWidgetCreate(self, instance):
		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				x, y = value.split(',')
				self.W, self.H = int(x), int(y)
		self.instance.move(ePoint(0,0))
		self.instance.resize( eSize(self.W,self.H) )
		self.scroll_label = eLabel(instance)
		self.mTimer = eTimer()
		

		try:
			#from boxbranding import getImageDistro, getImageVersion, getOEVersion
			self.mTimer.callback.append(self.movingLoop)
		except:
			try:
				if getBoxBrand() == "dreambox":
					self.mTimer_conn = self.mTimer.timeout.connect(self.movingLoop)
			except:
				pass
Exemplo n.º 22
0
	def parseData(self, data):
		self.textRenderer = eLabel(self.instance)
		self.textRenderer.hide()
		topChannelsJson = json.loads(data)
		try:
			lastp = round((float(topChannelsJson["_total"]) / limit) + 0.5)
			self.lastpage = int(lastp)
			self['page'].setText(str(self.page) + ' / ' + str(self.lastpage))
		except:
			self.lastpage = 999
			self['page'].setText(str(self.page))
		for node in topChannelsJson["streams"]:
			length = self._calcTextWidth(str(node["channel"]["display_name"]))
			if length != -1:
				title = str(node["channel"]["display_name"])
			else:
				title = str(node["channel"]["name"])
			self.channelList.append((title, str(node["channel"]["name"]), str(node["preview"]["large"])))
		self.ml.moveToIndex(0)
		self.ml.setList(map(self._defaultlistleft, self.channelList))
		self.keyLocked = False
		self.showInfos()
Exemplo n.º 23
0
 def postWidgetCreate(self, instance):
     self.long_text = eLabel(instance)
Exemplo n.º 24
0
 def createWidget(self, parent):
     if self.allmarked:
         return eLabel(parent, -2)
     else:
         return eLabel(parent, self.currPos - self.offset)
Exemplo n.º 25
0
 def createWidget(self, parent):
     return eLabel(parent)
Exemplo n.º 26
0
def getTextBoundarySize(instance, font, targetSize, text):
    dummy = eLabel(instance)
    dummy.setFont(font)
    dummy.resize(targetSize)
    dummy.setText(text)
    return dummy.calculateSize()
Exemplo n.º 27
0
 def postWidgetCreate(self, instance):
     self.long_text = eLabel(instance)
Exemplo n.º 28
0
 def GUIcreate(self, parent):
     self.instance = eWidget(parent)
     self.leftText = eLabel(self.instance)
     self.rightText = eLabel(self.instance)
     self.slider = eSlider(self.instance)
     self.slider.setIsScrollbar()
Exemplo n.º 29
0
    def applySkin(self, desktop, parent):
        scrollbarWidth = 10
        itemHeight = 30
        scrollbarBorderWidth = 1
        ret = False
        if self.skinAttributes:
            widget_attribs = []
            scrollbar_attribs = []
            remove_attribs = []
            for attrib, value in self.skinAttributes:
                if 'itemHeight' in attrib:
                    itemHeight = int(value)
                    remove_attribs.append((attrib, value))
                if 'scrollbarMode' in attrib:
                    self.scrollbarmode = value
                    remove_attribs.append((attrib, value))
                if 'borderColor' in attrib or 'borderWidth' in attrib:
                    scrollbar_attribs.append((attrib, value))
                if 'transparent' in attrib or 'backgroundColor' in attrib:
                    widget_attribs.append((attrib, value))
                if 'scrollbarSliderForegroundColor' in attrib:
                    scrollbar_attribs.append((attrib, value))
                    remove_attribs.append((attrib, value))
                if 'scrollbarSliderBorderColor' in attrib:
                    scrollbar_attribs.append((attrib, value))
                    remove_attribs.append((attrib, value))
                if 'scrollbarSliderPicture' in attrib:
                    scrollbar_attribs.append((attrib, value))
                    remove_attribs.append((attrib, value))
                if 'scrollbarBackgroundPicture' in attrib:
                    scrollbar_attribs.append((attrib, value))
                    remove_attribs.append((attrib, value))
                if 'scrollbarWidth' in attrib:
                    scrollbarWidth = int(value)
                    remove_attribs.append((attrib, value))
                if 'scrollbarSliderBorderWidth' in attrib:
                    scrollbarBorderWidth = int(value)
                    remove_attribs.append((attrib, value))
                if 'split' in attrib:
                    self.split = int(value)
                    if self.split:
                        self.right_text = eLabel(self.instance)
                    self.skinAttributes.remove((attrib, value))
                if 'colposition' in attrib:
                    self.column = int(value)
                if 'dividechar' in attrib:
                    self.splitchar = value

            for attrib, value in remove_attribs:
                self.skinAttributes.remove((attrib, value))

            if self.split:
                skin.applyAllAttributes(
                    self.long_text, desktop,
                    self.skinAttributes + [('halign', 'left')], parent.scale)
                skin.applyAllAttributes(
                    self.right_text, desktop, self.skinAttributes +
                    [('transparent', '1'),
                     ('halign', 'left' if self.column else 'right')],
                    parent.scale)
            else:
                skin.applyAllAttributes(self.long_text, desktop,
                                        self.skinAttributes, parent.scale)
            skin.applyAllAttributes(self.instance, desktop, widget_attribs,
                                    parent.scale)
            skin.applyAllAttributes(self.scrollbar, desktop,
                                    scrollbar_attribs + widget_attribs,
                                    parent.scale)
            ret = True
        self.pageWidth = self.long_text.size().width()
        self.lineheight = fontRenderClass.getInstance().getLineHeight(
            self.long_text.getFont()) or itemHeight
        lines = int(self.long_text.size().height() / self.lineheight)
        self.pageHeight = int(lines * self.lineheight)
        self.instance.move(self.long_text.position())
        self.instance.resize(
            eSize(self.pageWidth, self.pageHeight + int(self.lineheight / 6)))
        self.scrollbar.move(ePoint(self.pageWidth - scrollbarWidth, 0))
        self.scrollbar.resize(
            eSize(scrollbarWidth, self.pageHeight + int(self.lineheight / 6)))
        self.scrollbar.setOrientation(eSlider.orVertical)
        self.scrollbar.setRange(0, 100)
        self.scrollbar.setBorderWidth(scrollbarBorderWidth)
        self.setText(self.message)
        return ret
Exemplo n.º 30
0
def getTextBoundarySize(instance, font, targetSize, text):
    dummy = eLabel(instance)
    dummy.setFont(font)
    dummy.resize(targetSize)
    dummy.setText(text)
    return dummy.calculateSize()
Exemplo n.º 31
0
	def postWidgetCreate(self, instance):
		self.testSizeLabel = eLabel(instance)
		self.testSizeLabel.hide()
Exemplo n.º 32
0
 def postWidgetCreate(self, instance):
     self.long_text = eLabel(instance)
     self.scrollbar = eSlider(instance)
Exemplo n.º 33
0
	def GUIcreate(self, parent):
		self.instance = eWidget(parent)
		self.scrollbar = eSlider(self.instance)
		self.long_text = eLabel(self.instance)
Exemplo n.º 34
0
	def postWidgetCreate(self, instance):
		self.testSizeLabel = eLabel(instance)
		self.testSizeLabel.hide()
Exemplo n.º 35
0
 def GUIcreate(self, parent):
     self.instance = eWidget(parent)
     self.scrollbar = eSlider(self.instance)
     self.long_text = eLabel(self.instance)
Exemplo n.º 36
0
 def createWidget(self, parent):
     if self.allmarked:
         return eLabel(parent, -2)
     else:
         return eLabel(parent, self.currPos - self.offset)
Exemplo n.º 37
0
 def applySkin(self, desktop, parent):
     scrollbarWidth = 10
     itemHeight = 30
     scrollbarBorderWidth = 1
     ret = False
     if self.skinAttributes:
         widget_attribs = []
         scrollbar_attribs = []
         remove_attribs = []
         for (attrib, value) in self.skinAttributes:
             if "itemHeight" in attrib:
                 itemHeight = int(value)
                 remove_attribs.append((attrib, value))
             if "scrollbarMode" in attrib:
                 self.scrollbarmode = value
                 remove_attribs.append((attrib, value))
             if "borderColor" in attrib or "borderWidth" in attrib:
                 scrollbar_attribs.append((attrib, value))
             if "transparent" in attrib or "backgroundColor" in attrib:
                 widget_attribs.append((attrib, value))
             if "scrollbarSliderForegroundColor" in attrib:
                 scrollbar_attribs.append((attrib, value))
                 remove_attribs.append((attrib, value))
             if "scrollbarSliderBorderColor" in attrib:
                 scrollbar_attribs.append((attrib, value))
                 remove_attribs.append((attrib, value))
             if "scrollbarSliderPicture" in attrib:
                 scrollbar_attribs.append((attrib, value))
                 remove_attribs.append((attrib, value))
             if "scrollbarBackgroundPicture" in attrib:
                 scrollbar_attribs.append((attrib, value))
                 remove_attribs.append((attrib, value))
             if "scrollbarWidth" in attrib:
                 scrollbarWidth = int(value)
                 remove_attribs.append((attrib, value))
             if "scrollbarSliderBorderWidth" in attrib:
                 scrollbarBorderWidth = int(value)
                 remove_attribs.append((attrib, value))
             if "split" in attrib:
                 self.split = int(value)
                 if self.split:
                     self.right_text = eLabel(self.instance)
                 self.skinAttributes.remove((attrib, value))
             if "colposition" in attrib:
                 self.column = int(value)
             if "dividechar" in attrib:
                 self.splitchar = value
         for (attrib, value) in remove_attribs:
             self.skinAttributes.remove((attrib, value))
         if self.split:
             skin.applyAllAttributes(
                 self.long_text, desktop,
                 self.skinAttributes + [("halign", "left")], parent.scale)
             skin.applyAllAttributes(
                 self.right_text, desktop, self.skinAttributes +
                 [("transparent", "1"),
                  ("halign", "left" if self.column else "right")],
                 parent.scale)
         else:
             skin.applyAllAttributes(self.long_text, desktop,
                                     self.skinAttributes, parent.scale)
         skin.applyAllAttributes(self.instance, desktop, widget_attribs,
                                 parent.scale)
         skin.applyAllAttributes(self.scrollbar, desktop,
                                 scrollbar_attribs + widget_attribs,
                                 parent.scale)
         ret = True
     self.pageWidth = self.long_text.size().width()
     self.lineheight = fontRenderClass.getInstance().getLineHeight(
         self.long_text.getFont()
     ) or itemHeight  # assume a random lineheight if nothing is visible
     lines = int(self.long_text.size().height() / self.lineheight)
     self.pageHeight = int(lines * self.lineheight)
     self.instance.move(self.long_text.position())
     self.instance.resize(
         eSize(self.pageWidth, self.pageHeight + int(self.lineheight / 6)))
     self.scrollbar.move(ePoint(self.pageWidth - scrollbarWidth, 0))
     self.scrollbar.resize(
         eSize(scrollbarWidth, self.pageHeight + int(self.lineheight / 6)))
     self.scrollbar.setOrientation(eSlider.orVertical)
     self.scrollbar.setRange(0, 100)
     self.scrollbar.setBorderWidth(scrollbarBorderWidth)
     self.setText(self.message)
     return ret
Exemplo n.º 38
0
 def createWidget(self, parent):
     return eLabel(parent)
Exemplo n.º 39
0
	def postWidgetCreate(self, instance):
		instance.setWrapAround(True)
		self.selectionChanged_conn = instance.selectionChanged.connect(self.selectionChanged)
		instance.setContent(self.l)
		self._textRenderer = eLabel(instance)
		self._textRenderer.hide()