Exemple #1
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.Get('typeID', None)
     iskAmount = attributes.Get('iskAmount', 0)
     amount = attributes.Get('amount', 0)
     typeName = evetypes.GetName(typeID)
     mainCont = Container(name='mainCont', parent=self)
     iconCont = Container(name='iconCont',
                          parent=mainCont,
                          align=uiconst.TOLEFT,
                          width=18)
     textCont = Container(name='textCont',
                          parent=mainCont,
                          align=uiconst.TOALL,
                          padding=const.defaultPadding)
     icon = Icon(parent=iconCont,
                 align=uiconst.TOALL,
                 size=18,
                 typeID=typeID,
                 ignoreSize=True)
     icon.OnClick = (self.ShowInfo, None, typeID)
     icon.hint = typeName
     iskLabel = EveLabelSmall(text=FmtISK(iskAmount, 0),
                              parent=textCont,
                              align=uiconst.TORIGHT,
                              maxLines=1)
     amountLabel = EveLabelSmall(text='%ix' % amount,
                                 parent=textCont,
                                 align=uiconst.TOLEFT,
                                 maxLines=1)
     if amount == 0:
         mainCont.opacity = 0.5
Exemple #2
0
 def AddRow(self, idx):
     labelPath, what, iconNo, labelHintPath = rowsInfo[idx]
     rowName = 'row_%s' % what
     row = Container(name='row_%s' % rowName,
                     parent=self,
                     align=uiconst.TOTOP,
                     height=32)
     mainIcon = Icon(icon=iconNo,
                     parent=row,
                     pos=(0, 0, 32, 32),
                     ignoreSize=True)
     mainIcon.hint = GetByLabel(labelPath)
     statusLabel = Label(text='',
                         parent=row,
                         left=mainIcon.left + mainIcon.width,
                         state=uiconst.UI_NORMAL,
                         align=uiconst.CENTERLEFT,
                         width=62)
     statusLabel.hint = GetByLabel(labelHintPath)
     self.statsLabelsByIdentifier[what] = statusLabel
     dmgContainer = Container(parent=row,
                              name='dmgContainer',
                              left=self.col1Width)
     gaugeCont = DamageGaugeContainerFitting(parent=dmgContainer)
     self.statsContsByIdentifier[what] = gaugeCont
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.Get('typeID', None)
     iskAmount = attributes.Get('iskAmount', 0)
     amount = attributes.Get('amount', 0)
     typeName = evetypes.GetName(typeID)
     mainCont = Container(name='mainCont', parent=self)
     iconCont = Container(name='iconCont', parent=mainCont, align=uiconst.TOLEFT, width=18)
     textCont = Container(name='textCont', parent=mainCont, align=uiconst.TOALL, padding=const.defaultPadding)
     icon = Icon(parent=iconCont, align=uiconst.TOALL, size=18, typeID=typeID, ignoreSize=True)
     icon.OnClick = (self.ShowInfo, None, typeID)
     icon.hint = typeName
     iskLabel = EveLabelSmall(text=FmtISK(iskAmount, 0), parent=textCont, align=uiconst.TORIGHT, maxLines=1)
     amountLabel = EveLabelSmall(text='%ix' % amount, parent=textCont, align=uiconst.TOLEFT, maxLines=1)
     if amount == 0:
         mainCont.opacity = 0.5
Exemple #4
0
 def Load(self, attributeValues, mouseExitFunc=None, onClickFunc=None):
     if not attributeValues:
         return
     self.attributeValues = attributeValues
     self.innerContainers = {}
     self.Flush()
     containerPercentage = 1.0 / len(attributeValues)
     for attributeID, value in attributeValues:
         innerCont = Container(parent=self,
                               name='container_%s' % attributeID,
                               width=containerPercentage,
                               align=uiconst.TOLEFT_PROP,
                               clipChildren=True)
         self.innerContainers[attributeID] = innerCont
         iconCont = Container(parent=innerCont,
                              name='iconCont',
                              width=self.iconSize,
                              align=uiconst.TOLEFT,
                              state=uiconst.UI_PICKCHILDREN)
         icon = Icon(parent=iconCont,
                     pos=(0, 0, self.iconSize, self.iconSize),
                     align=uiconst.CENTERLEFT,
                     idx=0,
                     ignoreSize=True,
                     state=uiconst.UI_NORMAL)
         if mouseExitFunc:
             icon.OnMouseExit = mouseExitFunc
         if onClickFunc:
             icon.OnClick = (onClickFunc, attributeID)
         labelText = value or '-'
         innerCont.label = EveLabelSmall(parent=innerCont,
                                         text=labelText,
                                         align=uiconst.CENTERLEFT,
                                         left=self.iconSize)
         attributeInfo = cfg.dgmattribs.Get(attributeID)
         iconID = attributeInfo.iconID
         icon.LoadIcon(iconID, ignoreSize=True)
         icon.hint = attributeInfo.displayName
         tooltipTitleText, tooltipDescriptionText = GetAttributeTooltipTitleAndDescription(
             attributeID)
         if tooltipDescriptionText:
             SetTooltipHeaderAndDescription(
                 targetObject=icon,
                 headerText=tooltipTitleText,
                 descriptionText=tooltipDescriptionText)