Exemplo n.º 1
0
class MegaMenuEntry(Container):
    default_align = uiconst.TOPLEFT
    default_state = uiconst.UI_NORMAL
    default_height = 24
    sidePadding = 30

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.hiliteFill = Fill(bgParent=self, opacity=0.0)
        entryInfo = attributes.entryInfo
        self.callback = entryInfo['callback']
        self.callbackArgs = entryInfo['args']
        entryInfoDict = attributes.entryInfo
        text = entryInfoDict['text']
        self.textLabel = EveLabelSmall(parent=self,
                                       text=text,
                                       align=uiconst.CENTER)
        self.width = self.textLabel.textwidth + self.sidePadding
        self.height = max(self.default_height, self.textLabel.textheight + 4)

    def OnMouseEnter(self, *args):
        self.hiliteFill.opacity = 0.2
        self.textLabel.SetRGB(1, 0, 0, 1)

    def OnMouseExit(self, *args):
        self.hiliteFill.opacity = 0.0
        self.textLabel.SetRGB(1, 1, 1, 1)

    def OnClick(self, *args):
        if self.callback:
            self.callback(self.callbackArgs)
Exemplo n.º 2
0
 def CreateSecurityFilter(self):
     secCont = Container(parent=self.sr.main,
                         height=20,
                         padding=2,
                         align=uiconst.TOTOP)
     EveLabelSmall(parent=secCont,
                   text='Security Band:',
                   align=uiconst.TOLEFT,
                   padding=4)
     EveLabelSmall(parent=secCont,
                   text='Min Security',
                   align=uiconst.TOLEFT,
                   padding=4)
     self.minSecEdit = SinglelineEdit(parent=secCont,
                                      name='minSec',
                                      width=30,
                                      floats=(-1.0, 1.0, 1),
                                      align=uiconst.TOLEFT,
                                      padTop=-3,
                                      setvalue='-1.0')
     EveLabelSmall(parent=secCont,
                   text='Max Security',
                   align=uiconst.TOLEFT,
                   padding=4)
     self.maxSecEdit = SinglelineEdit(parent=secCont,
                                      name='maxSec',
                                      width=30,
                                      floats=(-1.0, 1.0, 1),
                                      align=uiconst.TOLEFT,
                                      padTop=-3,
                                      setvalue='1.0')
 def ApplyAttributes(self, attributes):
     LayoutGridRow.ApplyAttributes(self, attributes)
     self.markerObject = attributes.markerObject
     self.icon = Sprite(pos=(0, 0, 16, 16),
                        texturePath=self.markerObject.texturePath,
                        state=uiconst.UI_DISABLED)
     self.AddCell(cellObject=self.icon, cellPadding=(3, 1, 4, 1))
     self.highLight = Fill(bgParent=self,
                           color=(1, 1, 1, 0.1),
                           state=uiconst.UI_HIDDEN)
     if self.markerObject.celestialData:
         labelText = cfg.evelocations.Get(
             self.markerObject.celestialData.itemID).name
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         infoIcon = InfoIcon(size=14,
                             align=uiconst.CENTERRIGHT,
                             itemID=self.markerObject.celestialData.itemID,
                             typeID=self.markerObject.celestialData.typeID)
         self.AddCell(cellObject=infoIcon, cellPadding=(0, 1, 1, 1))
     else:
         labelText = self.markerObject.hintString
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         self.FillRow()
Exemplo n.º 4
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
Exemplo n.º 5
0
 def LoadTooltipPanel(self, tooltipPanel, *args, **kwds):
     return
     tooltipPanel.LoadGeneric2ColumnTemplate()
     extraInfo = self.groupData.extraInfo
     tipsHeader = EveLabelSmall(
         text=GetByLabel('UI/Achievements/TipsAndInfoHeader'),
         width=200,
         bold=True)
     tooltipPanel.AddCell(tipsHeader, colSpan=tooltipPanel.columns)
     tipsText = EveLabelSmall(text=GetByLabel(
         self.groupData.groupDescription),
                              align=uiconst.TOTOP)
     tooltipPanel.AddCell(tipsText, colSpan=tooltipPanel.columns)
     for info in extraInfo:
         icon = Sprite(name='icon',
                       parent=tooltipPanel,
                       pos=(0, 0, info['size'], info['size']),
                       texturePath=info['path'],
                       state=uiconst.UI_DISABLED,
                       align=uiconst.TOPLEFT,
                       color=info.get('color', None))
         label = EveLabelSmall(name='tipsHeader',
                               text=info['text'],
                               parent=tooltipPanel,
                               width=180,
                               align=uiconst.CENTERLEFT)
Exemplo n.º 6
0
 def CreateWindow(self):
     self.primeTimeInfo = None
     topCont = Container(parent=self,
                         height=24,
                         align=uiconst.TOTOP,
                         padding=const.defaultPadding)
     FillThemeColored(parent=topCont,
                      colorType=uiconst.COLORTYPE_UIHEADER,
                      opacity=0.15)
     EveLabelSmall(
         parent=topCont,
         text=GetByLabel('UI/Sovereignty/DefaultVulnerabilityTimeLabel'),
         align=uiconst.CENTERLEFT,
         left=const.defaultPadding)
     menuCont = Container(parent=topCont, align=uiconst.TORIGHT, width=18)
     self.primeTimeMenu = UtilMenu(parent=menuCont,
                                   align=uiconst.CENTERRIGHT,
                                   menuAlign=uiconst.TOPRIGHT,
                                   GetUtilMenu=self.PrimeTimeMenu)
     menuCont.display = False
     execCorpID = sm.GetService('alliance').GetAlliance(
         session.allianceid).executorCorpID
     timeTextLeft = const.defaultPadding
     if self._IsDirectorInExecCorp(execCorpID):
         timeTextLeft = 18
         menuCont.display = True
     self.timeLabel = EveLabelSmall(parent=topCont,
                                    align=uiconst.CENTERRIGHT,
                                    left=timeTextLeft)
     uthread.new(self.UpdatePrimeInfo)
     self.sovDashBoard = SovDashboard(parent=self)
     self.sovDashBoard.CreateWindow()
Exemplo n.º 7
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     EveLabelSmall(text=GetByLabel('Achievements/UI/active'), parent=self, align=uiconst.CENTERRIGHT)
     activeEffectSprite = SpriteThemeColored(parent=self, state=uiconst.UI_DISABLED, blendMode=trinity.TR2_SBM_ADDX2, texturePath='res:/UI/Texture/classes/Achievements/iconActiveLegend.png', pos=(0, 0, 20, 20))
     iconMap = [(GetByLabel('Achievements/UI/incomplete'), 'res:/UI/Texture/classes/Achievements/iconIncomplete.png'), (GetByLabel('Achievements/UI/partial'), 'res:/UI/Texture/classes/Achievements/iconPartial.png'), (GetByLabel('Achievements/UI/complete'), 'res:/UI/Texture/classes/Achievements/iconComplete.png')]
     for label, texturePath in iconMap:
         EveLabelSmall(text=label, parent=self, align=uiconst.CENTERRIGHT)
         GlowSprite(texturePath=texturePath, parent=self, pos=(0, 0, 20, 20))
Exemplo n.º 8
0
    def CreateColumns(self, columns):
        self.headerContainer.Flush()
        self.rightAlignedHeaderContainer.Flush()
        self.rightAlignedHeaderContainer.width = 0
        self.headers = []
        self.columnIDs = columns
        sizes = self.GetColumnSizes()
        for columnID in columns:
            isRigthAligned = True if self.rightAlignedColumns and columnID in self.rightAlignedColumns else False
            isStretchColumn = True if self.stretchColumns and columnID in self.stretchColumns else False
            header = Container(parent=self.rightAlignedHeaderContainer
                               if isRigthAligned else self.headerContainer,
                               align=uiconst.TOLEFT,
                               state=uiconst.UI_NORMAL)
            header.OnClick = (self.ClickHeader, header)
            header.columnID = columnID
            header.sortTriangle = None
            if not isStretchColumn:
                header.OnDblClick = (self.DblClickHeader, header)
                headerDivider = LineThemeColored(
                    parent=header,
                    align=uiconst.TORIGHT
                    if not isRigthAligned else uiconst.TOLEFT,
                    opacity=uiconst.OPACITY_FRAME)
                if self.fixedColumns and columnID not in self.fixedColumns:
                    scaler = Container(parent=header,
                                       align=uiconst.TOPRIGHT,
                                       width=4,
                                       height=self.height - 1,
                                       state=uiconst.UI_NORMAL)
                    scaler.OnMouseDown = (self.StartHeaderScale, header)
                    scaler.cursor = 16
            label = EveLabelSmall(parent=header,
                                  text=columnID,
                                  align=uiconst.CENTERLEFT,
                                  left=6,
                                  state=uiconst.UI_DISABLED,
                                  maxLines=1)
            header.label = label
            if isStretchColumn:
                header.width = label.width + label.left + 20
            elif self.fixedColumns and columnID in self.fixedColumns:
                header.width = self.fixedColumns[columnID]
                if header.width <= 32:
                    label.Hide()
            elif columnID in sizes:
                header.width = max(
                    self.minSizeByColumnID.get(columnID, COLUMNMINSIZE),
                    sizes[columnID])
            else:
                header.width = max(
                    self.minSizeByColumnID.get(columnID, COLUMNMINSIZE),
                    max(COLUMNMINDEFAULTSIZE, label.textwidth + 24))
            if isRigthAligned:
                self.rightAlignedHeaderContainer.width += header.width
            self.headers.append(header)

        self.UpdateActiveState()
Exemplo n.º 9
0
    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        self.booster = attributes.get('booster')
        self.expiryTime = attributes.get('expiryTime')
        self.effects = attributes.get('effects')
        self.positiveEffects = self.effects.get('positive', [])
        self.negativeEffects = self.effects.get('negative', [])
        self.typeID = self.booster.typeID
        self.activeBlink = None
        self.highlight = Fill(bgParent=self,
                              color=(1, 1, 1, 0.1),
                              state=uiconst.UI_HIDDEN)
        leftCont = uiprimitives.Container(parent=self,
                                          align=uiconst.TOLEFT,
                                          width=self.TIME_WIDTH)
        rightCont = uiprimitives.Container(parent=self, align=uiconst.TOALL)
        self.time = Label(parent=leftCont,
                          name='counter',
                          text='',
                          fontsize=16,
                          bold=False,
                          align=uiconst.TOPLEFT,
                          color=(1, 1, 1, 0.75),
                          left=2 * const.defaultPadding)
        self.boosterSprite = Icon(parent=rightCont,
                                  name='boosterIcon',
                                  icon=evetypes.GetIconID(self.typeID),
                                  pos=(0, 0, 24, 24),
                                  ignoreSize=True,
                                  state=uiconst.UI_DISABLED)
        left = self.boosterSprite.width
        boosterName = EveLabelSmall(parent=rightCont,
                                    name='name',
                                    text=evetypes.GetName(self.typeID),
                                    align=uiconst.TOPLEFT,
                                    top=1,
                                    left=left)
        self.maxtextwidth = boosterName.textwidth + boosterName.left
        padTop = boosterName.textheight + 4
        allModified = self.GetBoosterEffectsInfo(
            self.positiveEffects) + self.GetBoosterEffectsInfo(
                self.negativeEffects, True)
        for lineText in allModified:
            effectLabel = EveLabelSmall(parent=rightCont,
                                        name='effect',
                                        text=lineText,
                                        align=uiconst.TOPLEFT,
                                        padTop=padTop,
                                        left=30)
            padTop += effectLabel.textheight + 2
            self.maxtextwidth = max(self.maxtextwidth,
                                    effectLabel.textwidth + effectLabel.left)

        self.height = max(padTop + 4, self.boosterSprite.height + 2)
        self.LoadData()
    def MakeSliderTextRow(self,
                          label,
                          minValue,
                          maxValue,
                          startValue,
                          stepping,
                          setValueFunc=None,
                          endSliderFunc=None):
        sliderWidth = 100
        sliderValueWidth = 30
        sliderLabelWidth = 120
        rowPadding = (5, 2, 10, 2)
        size = EveLabelSmall.MeasureTextSize(label, width=sliderLabelWidth)
        rowHeight = size[1]
        rowContainer = Container(name='TextRowContainer',
                                 parent=self.rightContainer,
                                 align=uiconst.TOTOP,
                                 alignMode=uiconst.TOTOP,
                                 height=rowHeight,
                                 padding=rowPadding)
        EveLabelSmall(name='sliderlabel',
                      align=uiconst.TOLEFT,
                      parent=rowContainer,
                      text=label,
                      width=sliderLabelWidth)
        increments = []
        currentValue = minValue
        while currentValue <= maxValue:
            increments.append(currentValue)
            currentValue = currentValue + stepping

        valueLabel = EveLabelSmall(name='sliderValuelabel',
                                   left=sliderWidth,
                                   align=uiconst.CENTERRIGHT,
                                   text=str(startValue),
                                   width=sliderValueWidth)

        def UpdateLabel(slider):
            valueLabel.text = str(slider.GetValue())

        Slider(name='niceSlider',
               align=uiconst.CENTERRIGHT,
               parent=rowContainer,
               minValue=minValue,
               maxValue=maxValue,
               width=sliderWidth,
               showLabel=False,
               startVal=startValue,
               isEvenIncrementsSlider=True,
               increments=increments,
               onsetvaluefunc=UpdateLabel,
               endsliderfunc=endSliderFunc)
        rowContainer.children.append(valueLabel)
        return rowContainer
Exemplo n.º 11
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.hiliteFill = Fill(bgParent=self, opacity=0.0)
     entryInfo = attributes.entryInfo
     self.callback = entryInfo['callback']
     self.callbackArgs = entryInfo['args']
     entryInfoDict = attributes.entryInfo
     text = entryInfoDict['text']
     self.textLabel = EveLabelSmall(parent=self,
                                    text=text,
                                    align=uiconst.CENTER)
     self.width = self.textLabel.textwidth + self.sidePadding
     self.height = max(self.default_height, self.textLabel.textheight + 4)
Exemplo n.º 12
0
 def Layout(self):
     Frame(parent=self,
           texturePath='res:/UI/Texture/classes/skilltrading/frame.png',
           cornerSize=3,
           opacity=0.5)
     Sprite(
         bgParent=self,
         align=uiconst.TOALL,
         padding=(4, 4, 4, 4),
         texturePath='res:/UI/Texture/classes/skilltrading/checker_bg.png',
         opacity=0.4,
         tileX=True,
         tileY=True)
     self.label = EveLabelSmall(parent=self, align=uiconst.CENTER)
     self.UpdateLabel()
Exemplo n.º 13
0
 def CreateLocationSelector(self):
     EveLabelSmall(
         parent=self.sr.main,
         text=
         '<color=orange>This is a tool for automating visits to solar systems and locations within them. There are several actions available while visiting each location.',
         align=uiconst.TOTOP,
         padding=4)
     EveLabelSmall(parent=self.sr.main,
                   text='Systems, Constellations or Regions',
                   align=uiconst.TOTOP,
                   padding=4)
     self.locationsEdit = EditPlainText(parent=self.sr.main,
                                        align=uiconst.TOTOP,
                                        height=50,
                                        padding=4)
Exemplo n.º 14
0
 def Prepare_Label_(self):
     if self.GetAlign() == uiconst.TOPRIGHT:
         leftPad = 0
         rightPad = 16
     else:
         leftPad = 16
         rightPad = 0
     if not self.wrapLabel:
         align = uiconst.CENTERLEFT
         padding = 0
         pos = (leftPad,
          0,
          0,
          0)
         maxLines = 1
     else:
         align = uiconst.TOTOP
         padding = (leftPad,
          TOPMARGIN,
          rightPad,
          0)
         pos = (0, 0, 0, 0)
         maxLines = None
     self.sr.label = EveLabelSmall(text='', parent=self, name='text', align=align, state=uiconst.UI_DISABLED, padding=padding, pos=pos, maxLines=maxLines)
     self.sr.label.OnSizeChanged = self.OnSizeChanged
Exemplo n.º 15
0
 def ApplyAttributes(self, attributes):
     ProbeTooltipButtonBase.ApplyAttributes(self, attributes)
     self.checkBox = Checkbox(groupname=attributes.groupName,
                              align=uiconst.CENTER,
                              checked=attributes.checked,
                              retval=attributes.retval,
                              wrapLabel=True,
                              prefstype=None,
                              width=16,
                              height=16,
                              state=uiconst.UI_DISABLED)
     self.AddCell(self.checkBox, cellPadding=(5, 1, 4, 1))
     self.deleteFunction = attributes.deleteFunc
     self.editFunction = attributes.editFunc
     self.label = EveLabelSmall(text=attributes.text,
                                bold=True,
                                align=uiconst.CENTERLEFT,
                                autoFitToText=True,
                                width=128)
     self.AddCell(self.label,
                  colSpan=1 if attributes.filterIndex is not None else 2,
                  cellPadding=(0, 2, 6, 2))
     if attributes.filterIndex is not None:
         shortcutObj = ShortcutHint(text=str(attributes.filterIndex))
         self.AddCell(shortcutObj, cellPadding=(2, 2, 2, 0))
         return shortcutObj
Exemplo n.º 16
0
 def SetLabel(self, label, leftright='left'):
     EveLabelSmall(text='<%s>%s' % (leftright, label),
                   parent=self.parent,
                   left=4,
                   top=-4,
                   width=self.parent.width,
                   state=uiconst.UI_DISABLED)
Exemplo n.º 17
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.main = ContainerAutoSize(parent=self.sr.main,
                                   name='main',
                                   padding=3,
                                   state=uiconst.UI_PICKCHILDREN,
                                   align=uiconst.TOTOP,
                                   alignMode=uiconst.TOTOP)
     self.planetUISvc = sm.GetService('planetUI')
     self.planetSvc = sm.GetService('planetSvc')
     self.pin = attributes.Get('pin', None)
     self.uiEffects = uicls.UIEffects()
     self.showingActionContainer = False
     self.currentRoute = None
     self.showNext = None
     self.lastCalled = None
     self.commodityToRoute = None
     self.buttonTextValue = ''
     infoCont = Container(parent=self.main,
                          name='infoCont',
                          padding=5,
                          align=uiconst.TOTOP,
                          height=self.INFO_CONT_HEIGHT)
     self.infoContLeft = Container(name='leftCol',
                                   parent=infoCont,
                                   align=uiconst.TOLEFT_PROP,
                                   width=0.5)
     self.infoContRight = Container(name='rightCol',
                                    parent=infoCont,
                                    align=uiconst.TOLEFT_PROP,
                                    width=0.5)
     self._GetInfoCont()
     self._UpdateInfoCont()
     self.buttonCont = GridContainer(parent=self.main,
                                     name='buttonCont',
                                     height=40,
                                     align=uiconst.TOTOP,
                                     padding=(-1, 0, -1, 0))
     BumpedUnderlay(bgParent=self.buttonCont)
     self.buttonCont.lines = 1
     self.buttonCont.columns = 6
     self.buttonTextCont = self._DrawAlignTopCont(22, 'buttonTextCont')
     self.buttonText = EveLabelSmall(parent=self.buttonTextCont,
                                     align=uiconst.CENTER,
                                     color=(1.0, 1.0, 1.0, 1.0),
                                     state=uiconst.UI_NORMAL)
     self.buttonTextCont.height = max(22, self.buttonText.textheight)
     self.actionCont = Container(parent=self.sr.main,
                                 name='actionCont',
                                 padding=(6, 0, 6, 6),
                                 clipChildren=True)
     self.SetCaption(self._GetPinName())
     self.main.SetSizeAutomatically()
     self.height = self.GetBaseHeight()
     self.LoadActionButtons(self._GetActionButtons())
     uicore.animations.FadeTo(self, 0.0, 1.0, duration=0.3)
     self.updateInfoContTimer = base.AutoTimer(100, self._UpdateInfoCont)
     sm.GetService('audio').SendUIEvent(
         'wise:/msg_pi_pininteraction_open_play')
     self.ResizeActionCont(None)
Exemplo n.º 18
0
 def CreatePasses(self):
     EveLabelSmall(parent=self.sr.main,
                   text='Actions for each system visited',
                   align=uiconst.TOTOP,
                   padding=4)
     self.CreateSystemPass(1)
     self.CreateSystemPass(2)
Exemplo n.º 19
0
 def _update_text(self):
     next_reward = self.season_service.get_next_reward()
     self.next_reward_label.text = self._get_next_reward_label(next_reward)
     if self.next_reward_state_container:
         self.next_reward_state_container.Flush()
         self.next_reward_state_container.Close()
     self.next_reward_state_container = Container(
         name='next_reward_state_container',
         parent=self.base_container,
         align=uiconst.TOPRIGHT,
         width=self.width,
         height=POINTS_ICON_SIZE)
     if next_reward:
         self.next_reward_state = SeasonPoints(
             name='next_reward_points',
             parent=self.next_reward_state_container,
             points=next_reward['points_required'],
             season_points_size=POINTS_ICON_SIZE,
             reward_label_class=EveLabelSmall,
             align=uiconst.TOPRIGHT,
             height=POINTS_HEIGHT,
             top=NEXT_REWARD_LABEL_HEIGHT + NEXT_REWARD_STATE_TOP)
         return
     self.next_reward_state = EveLabelSmall(
         name='next_reward_state',
         parent=self.next_reward_state_container,
         align=uiconst.TORIGHT,
         text=get_all_rewards_unlocked_state(),
         top=NEXT_REWARD_LABEL_HEIGHT + NEXT_REWARD_STATE_TOP)
     self.next_reward_state.color = SEASON_THEME_TEXT_COLOR_REGULAR
Exemplo n.º 20
0
 def _ConstructNotificationArea(self):
     self.windowunderlay = Container(parent=self.topContainer,
                                     name='windowUnderlay',
                                     align=uiconst.TOALL)
     self._ConstructResizeLine()
     self.historyHeader = Container(name='HistoryContainer',
                                    parent=self.windowunderlay,
                                    align=uiconst.TOTOP,
                                    height=13,
                                    padding=(0, 4, 0, 0),
                                    clipChildren=True,
                                    opacity=0.0)
     self.historyHeaderLabel = EveLabelSmall(
         name='history',
         parent=self.historyHeader,
         align=uiconst.CENTER,
         text=localization.GetByLabel(
             'Notifications/NotificationWidget/NotificationHistoryCaption'),
         bold=True)
     self.historyHeader.height = max(self.historyHeader.height,
                                     self.historyHeaderLabel.textheight + 2)
     self._ConstructControlContainer()
     if self.verticalAlignment == ExpandAlignmentConst.EXPAND_ALIGNMENT_VERTICAL_UP:
         padding = (5, 0, 5, 0)
     else:
         padding = (5, 0, 5, 5)
     self.scrollList = NotificationScrollContainer(
         name='myScrollCont',
         parent=self.windowunderlay,
         align=uiconst.TOALL,
         padding=padding)
     self.lastobservedValue = self.scrollList.verticalScrollBar.isDragging
     self.underlay = BumpedUnderlay(bgParent=self.scrollList)
Exemplo n.º 21
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sliderWidth = attributes.sliderWidth or 100
     config = attributes.config
     sliderParent = Container(name=config[0] + '_slider_sub',
                              parent=self,
                              align=uiconst.TOPRIGHT,
                              pos=(0, 0, sliderWidth, self.BASESIZE))
     slider = uicontrols.Slider(parent=sliderParent,
                                width=self.BASESIZE,
                                height=self.BASESIZE,
                                name=config[0],
                                hint=attributes.hint)
     if attributes.header:
         self.headerLabel = EveLabelSmall(text=attributes.header,
                                          parent=self,
                                          padRight=sliderWidth + 6,
                                          state=uiconst.UI_PICKCHILDREN,
                                          align=uiconst.TOTOP)
         self.headerLabel.OnSizeChanged = self.OnHeaderSizeChanged
     slider.GetSliderValue = attributes.GetSliderValue
     slider.SetSliderLabel = attributes.SetSliderLabel
     slider.GetSliderHint = attributes.GetSliderHint
     slider.EndSetSliderValue = attributes.EndSliderValue
     slider.Startup(config[0], attributes.minval, attributes.maxval, config)
Exemplo n.º 22
0
 def Startup(self, *args):
     self.Flush()
     self.mainCont = Container(parent=self, align=uiconst.TOTOP, height=30)
     leftCont = Container(parent=self.mainCont,
                          align=uiconst.TOLEFT,
                          width=50)
     self.icon = Container(parent=leftCont,
                           align=uiconst.TOPLEFT,
                           pos=(3, 3, 32, 32))
     self.corpNameCont = Container(parent=self.mainCont,
                                   align=uiconst.TOTOP,
                                   height=17)
     label = GetByLabel('UI/Station/Lobby/CorpName')
     self.corpNameLabel = EveLabelSmall(text=label,
                                        parent=self.corpNameCont,
                                        left=5,
                                        top=2,
                                        state=uiconst.UI_DISABLED)
     self.corpNameText = EveLabelMedium(text='',
                                        parent=self.corpNameCont,
                                        left=5,
                                        state=uiconst.UI_NORMAL)
     LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
     self.buttonCnt = Container(parent=self,
                                align=uiconst.TOTOP,
                                height=25,
                                state=uiconst.UI_PICKCHILDREN)
     self.buttonCnt.display = False
     self.infoicon = InfoIcon(left=32, top=3, parent=leftCont, idx=0)
Exemplo n.º 23
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.MakeUnResizeable()
     self.controller = attributes.controller
     self.btnGroup = ButtonGroup(parent=self.sr.main, idx=0, line=True)
     self.btnGroup.AddButton(GetByLabel(self.confirmLabelPath),
                             self.OnConfirmClicked)
     self.btnGroup.AddButton(GetByLabel('UI/Commands/Cancel'), self.Cancel)
     self.groupNameField = SinglelineEdit(parent=self.sr.main,
                                          align=uiconst.TOTOP,
                                          label=GetByLabel(
                                              self.nameLabelPath),
                                          padding=4,
                                          top=10,
                                          maxLength=30)
     EveLabelSmall(name='titleHeader',
                   parent=self.sr.main,
                   text=GetByLabel(self.descriptionLabelPath),
                   align=uiconst.TOTOP,
                   top=6,
                   padLeft=4)
     self.groupDescField = EditPlainText(parent=self.sr.main,
                                         padding=(4, 0, 4, 4),
                                         maxLength=200)
     self.PopulateFields()
Exemplo n.º 24
0
 def CreateWindow(self):
     self.capitalSystemInfo = sm.GetService('alliance').GetCapitalSystemInfo()
     self.systems = sm.RemoteSvc('stationSvc').GetSystemsForAlliance(session.allianceid)
     alliance = sm.GetService('alliance').GetAlliance()
     self.isExecDirector = self._IsDirectorInExecCorp(alliance.executorCorpID)
     infoCont = ContainerAutoSize(parent=self, align=uiconst.TOTOP, padding=(const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding,
      0))
     topCont = Container(parent=infoCont, height=42, align=uiconst.TOTOP)
     FillThemeColored(parent=topCont, colorType=uiconst.COLORTYPE_UIHEADER, opacity=0.15)
     texturePath = 'res:/ui/Texture/classes/Sov/capitalSystem.png'
     Sprite(name='capitalIcon', parent=topCont, texturePath=texturePath, width=32, height=32, align=uiconst.CENTERLEFT, left=4)
     EveLabelLarge(text=GetByLabel('UI/Sovereignty/AllianceCapital'), parent=topCont, align=uiconst.CENTERLEFT, left=42, top=-8)
     EveLabelSmall(text=GetByLabel('UI/Sovereignty/SelectCapitalSystemDescription'), parent=topCont, align=uiconst.CENTERLEFT, left=42, top=8)
     currentSystemCont = Container(parent=infoCont, height=24, align=uiconst.TOTOP)
     self.currentCapitalLabel = EveLabelMedium(text='', left=4, parent=currentSystemCont, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL)
     self.capitalLabel = EveLabelMedium(text=GetByLabel('UI/Sovereignty/CurrentCapital'), left=22, parent=currentSystemCont, align=uiconst.CENTERRIGHT)
     self.capitalSprite = Sprite(name='capitalIcon', parent=currentSystemCont, texturePath='res:/ui/Texture/classes/Sov/CapitalStarSelection.png', width=16, height=16, align=uiconst.CENTERRIGHT, left=4)
     self.SetDisplayOfCapitalLabelAndIcon(False)
     self.futureSystemCont = Container(parent=infoCont, height=24, align=uiconst.TOTOP)
     self.futureSystemLabel = EveLabelMedium(text='', left=4, parent=self.futureSystemCont, align=uiconst.CENTERLEFT)
     self.futureSystemTime = EveLabelMedium(text='', left=4, parent=self.futureSystemCont, align=uiconst.CENTERRIGHT)
     self.removeBtn = ButtonIcon(texturePath='res:/UI/Texture/Icons/73_16_210.png', pos=(4, 0, 16, 16), align=uiconst.CENTERRIGHT, parent=self.futureSystemCont, idx=0, func=self.RemoveCapital, hint=GetByLabel('UI/Common/Buttons/Cancel'))
     self.removeBtn.display = False
     if self.isExecDirector:
         self.removeBtn.display = True
         self.futureSystemTime.left = 22
     self.futureSystemCont.display = False
     self.claimedSystems = ClaimedSystemsDashboard(parent=self, padTop=const.defaultPadding)
     self.claimedSystems.CreateWindow()
     self.UpdateCapitalInfo()
Exemplo n.º 25
0
 def ApplyAttributes(self, attributes):
     LayoutGridRow.ApplyAttributes(self, attributes)
     self.isCompact = attributes.isCompact or False
     bracket = attributes.bracket
     self.bracket = bracket
     if not self.IsBracketStillValid():
         return
     self.hilite = Fill(bgParent=self, color=(1, 1, 1, 0.0))
     self.iconParent = Container(align=uiconst.CENTER,
                                 pos=(0, 0, 26, MINENTRYHEIGHT),
                                 parent=self)
     self.iconObj = self.CreateIcon()
     self.radialMenuSprite = None
     if self.isCompact:
         self.mainLabel = attributes.sideContainer.CreateBracketEntry()
         self.mainLabel.DelegateEvents(self)
     else:
         self.mainLabel = BracketShadowLabel(text='',
                                             align=uiconst.CENTERLEFT,
                                             width=TOOLTIPLABELCUTOFF,
                                             autoFitToText=True,
                                             state=uiconst.UI_DISABLED)
         self.AddCell(cellObject=self.mainLabel, cellPadding=(2, 2, 6, 2))
         self.distanceLabel = EveLabelSmall(parent=self,
                                            align=uiconst.CENTERRIGHT,
                                            left=4)
     self.dynamicsUpdateTimer = None
Exemplo n.º 26
0
 def Prepare_Label_(self):
     self.sr.label = EveLabelSmall(text='',
                                   parent=self,
                                   name='label',
                                   top=-13,
                                   left=1,
                                   state=uiconst.UI_HIDDEN,
                                   idx=1)
Exemplo n.º 27
0
 def Load(self, node):
     self.primeTimeInfo = node.primeTimeInfo
     text, infoText = self.GetText()
     node.text = text
     LabelTextSides.Load(self, node)
     if infoText:
         self.sr.infoLabel = EveLabelSmall(text=infoText, parent=self, top=6, state=uiconst.UI_DISABLED, align=uiconst.CENTERRIGHT, left=8)
         self.sr.text.top = -6
Exemplo n.º 28
0
 def PanelCreateRoute(self, typeID, amount):
     cont = Container(parent=self.actionCont,
                      pos=(0, 0, 0, 130),
                      align=uiconst.TOTOP,
                      state=uiconst.UI_HIDDEN)
     cont._OnClose = self.OnPanelCreateRouteClosed
     w = self.width - 5
     self.sourceMaxAmount = amount
     self.routeMaxAmount = amount
     self.commodityToRoute = typeID
     self.commoditySourceMaxAmount = amount
     self.currRouteCycleTime = self.pin.GetCycleTime()
     resourceTxt = localization.GetByLabel(
         'UI/PI/Common/ItemAmount',
         itemName=evetypes.GetName(typeID),
         amount=int(self.routeMaxAmount))
     CaptionAndSubtext(
         parent=cont,
         caption=localization.GetByLabel('UI/PI/Common/CommodityToRoute'),
         subtext=resourceTxt,
         iconTypeID=typeID,
         top=0,
         width=w)
     CaptionAndSubtext(
         parent=cont,
         caption=localization.GetByLabel('UI/PI/Common/QtyAmount'),
         width=w,
         top=30,
         state=uiconst.UI_DISABLED)
     self.routeAmountEdit = SinglelineEdit(
         name='routeAmountEdit',
         parent=cont,
         setvalue=self.routeMaxAmount,
         height=14,
         width=56,
         align=uiconst.TOPLEFT,
         top=44,
         ints=(0, self.routeMaxAmount),
         OnChange=self.OnRouteAmountEditChanged)
     self.routeAmountText = EveLabelSmall(parent=cont,
                                          left=60,
                                          top=46,
                                          state=uiconst.UI_NORMAL)
     self.routeDestText = CaptionAndSubtext(
         parent=cont,
         caption=localization.GetByLabel('UI/Common/Destination'),
         top=70,
         width=w)
     btns = [[
         localization.GetByLabel('UI/PI/Common/CreateRoute'),
         self.SubmitRoute, ()
     ]]
     self.createRouteButton = ButtonGroup(btns=btns,
                                          parent=cont,
                                          line=False,
                                          alwaysLite=True)
     self.UpdatePanelCreateRoute()
     return cont
Exemplo n.º 29
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.activeCurve = None
     self.activationPendingCurve = None
     self.deactivationCurve = None
     self.ramp_active = False
     self.buttonDisabled = False
     self.shipFighterState = GetShipFighterState()
     self.crimewatchSvc = sm.GetService('crimewatchSvc')
     self.innerCont = Container(name='innerCont',
                                parent=self,
                                align=uiconst.TOBOTTOM,
                                height=self.height)
     self.stateLabel = EveLabelSmall(parent=self.innerCont,
                                     align=uiconst.CENTER)
     self.controller = attributes.controller
     self.slotID = self.controller.slotID
     self.fighterID = attributes.fighterID
     self.fighterTypeID = attributes.fighterTypeID
     ability = self.GetAbilityInfo()
     self.abilityNameID = ability.displayNameID
     iconID = ability.iconID
     self.abilityIcon = Icon(parent=self.innerCont,
                             align=uiconst.CENTER,
                             width=32,
                             height=32,
                             icon=iconID,
                             state=uiconst.UI_DISABLED)
     self.hilite = Sprite(
         parent=self.innerCont,
         name='hilite',
         width=44,
         height=44,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/ShipUI/slotHilite.png',
         blendMode=trinity.TR2_SBM_ADDX2)
     self.hilite.display = False
     bgSprite = Sprite(
         parent=self.innerCont,
         align=uiconst.CENTER,
         width=64,
         height=64,
         texturePath=
         'res:/UI/Texture/classes/ShipUI/Fighters/slotFighterAbility.png',
         state=uiconst.UI_DISABLED)
     self.abilityIcon.SetSize(32, 32)
     self.DrawQtyCont()
     self.DrawTimer()
     self.DrawCoolDownTimer()
     self.DrawSafetyGlow()
     self.targetMode = ability.targetMode
     abilityID = GetAbilityIDForSlot(self.fighterTypeID, self.slotID)
     effectID = GetDogmaEffectIDForAbilityID(abilityID)
     self.abilityEffect = cfg.dgmeffects.Get(effectID)
     self.OnAbilityStatusUpdated(self.fighterID, self.slotID)
     self.shipFighterState.signalOnAbilityActivationStatusUpdate.connect(
         self.OnAbilityStatusUpdated)
Exemplo n.º 30
0
 def PrepareLayout(self):
     Line(parent=self, align=uiconst.TORIGHT)
     self.textLabel = EveLabelSmall(text=self.name,
                                    parent=self,
                                    align=uiconst.CENTER,
                                    state=uiconst.UI_DISABLED)
     self.hilite = Fill(parent=self, state=uiconst.UI_HIDDEN, padding=1)
     self.width = self.textLabel.width + 10
     self.cursor = uiconst.UICURSOR_SELECT