Beispiel #1
0
 def ApplyAttributes(self, attributes):
     uicls.SE_BaseClassCore.ApplyAttributes(self, attributes)
     uicls.Line(parent=self,
                align=uiconst.TOBOTTOM,
                color=(1.0, 1.0, 1.0, 0.125))
     self.container = uicls.Container(name='container', parent=self)
     self.upgrades = uicls.Container(name='upgrades',
                                     parent=self,
                                     align=uiconst.TORIGHT,
                                     pos=(0, 0, 280, 0),
                                     padRight=8)
     self.system = uicls.Container(name='solarsystem',
                                   parent=self,
                                   padLeft=4,
                                   padRight=4,
                                   clipChildren=True)
     self.systemHeader = uicls.EveLabelSmall(text='',
                                             parent=self.system,
                                             left=0,
                                             top=4,
                                             align=uiconst.TOPLEFT,
                                             state=uiconst.UI_DISABLED,
                                             idx=0,
                                             maxLines=1)
     self.upgradesHeader = uicls.EveLabelSmall(text='',
                                               parent=self.upgrades,
                                               left=0,
                                               top=4,
                                               align=uiconst.TOPLEFT,
                                               state=uiconst.UI_DISABLED,
                                               idx=0,
                                               maxLines=1)
Beispiel #2
0
    def DrawKillsByGroup(self):
        self.killGroupsTextCont.Flush()
        self.killGroupsDataCont.Flush()
        self.killGroupsLegendCont.Flush()
        top = 2
        self.groupLabels = []
        for shipGroup in self.shipGroupList:
            killsByShipGroup = self.GetKillsByGroup(shipGroup)
            labelText = self.GetShipGroupName(shipGroup)
            groupLabel = uicls.EveLabelSmall(text=localization.GetByLabel(labelText), parent=self.killGroupsTextCont, top=top, left=const.defaultPadding, state=uiconst.UI_NORMAL, align=uiconst.TOPRIGHT)
            groupLabel.OnClick = (self.GetBarAndClick, shipGroup)
            if killsByShipGroup.attackerKills == 0 and killsByShipGroup.defenderKills == 0:
                groupLabel.SetAlpha(0.5)
            top += 18
            self.groupLabels.append(groupLabel)
            self.CreateBarContainer(shipGroup, killsByShipGroup.attackerKills, killsByShipGroup.defenderKills, killsByShipGroup.attackerKillsIsk, killsByShipGroup.defenderKillsIsk)

        w, h = self.killGroupsDataCont.GetAbsoluteSize()
        l = 0.1
        max = 1.0
        legendmin = uicls.EveLabelSmall(parent=self.killGroupsLegendCont, text=localization.GetByLabel('UI/Corporations/Wars/Legend', legend=util.FmtISK(0)), align=uiconst.TOPLEFT)
        legendmax = uicls.EveLabelSmall(parent=self.killGroupsLegendCont, text=localization.GetByLabel('UI/Corporations/Wars/Legend', legend=util.FmtISK(self.maxKills)), align=uiconst.TOPRIGHT)
        while l <= max:
            lineCont = uicls.Container(parent=self.killGroupsDataCont, align=uiconst.TOPLEFT_PROP, width=l, height=h)
            uicls.Line(parent=lineCont, align=uiconst.TORIGHT, color=(1.0, 1.0, 1.0, 0.1))
            l += 0.1

        self.displayGroup = settings.user.ui.Get('killGroupDisplayed', const.GROUP_CAPSULES)
        maxWidth = self.GetGroupLabelWidth()
        self.killGroupsTextCont.width = maxWidth + 10
        self.GetBarAndClick(self.displayGroup)
        self.graphLoaded = True
Beispiel #3
0
 def MapScaler(self, where):
     parent = uicls.Container(parent=where,
                              align=uiconst.TOBOTTOM,
                              height=14)
     uicls.EveLabelSmall(
         text=localization.GetByLabel('UI/Map/MapBrowser/ZoomLevel'),
         parent=parent,
         left=0,
         top=-12,
         width=100,
         color=(1.0, 1.0, 1.0, 0.5),
         state=uiconst.UI_NORMAL)
     for level in (1, 2, 4):
         sub = uicls.Container(parent=parent,
                               align=uiconst.TOLEFT,
                               width=24,
                               state=uiconst.UI_NORMAL)
         sub.OnClick = (self.ChangeZoomLevel, sub, level)
         parent.width += sub.width
         uicls.Frame(parent=sub)
         txt = uicls.EveLabelSmall(text='%sx' % level,
                                   parent=sub,
                                   align=uiconst.TOALL,
                                   left=6,
                                   top=2,
                                   state=uiconst.UI_DISABLED)
         if settings.user.ui.Get('mapbrowserzoomlevel', 1) == level:
             uicls.Fill(parent=sub, padding=(1, 1, 1, 1))
Beispiel #4
0
 def ConstructLayout(self):
     corpName = cfg.eveowners.Get(self.corpid).name
     corpInfoCont = uicls.Container(name='corpInfo',
                                    parent=self.sr.main,
                                    align=uiconst.TOTOP,
                                    height=68,
                                    padding=const.defaultPadding)
     corpLogoCont = uicls.Container(name='corpLogo',
                                    parent=corpInfoCont,
                                    align=uiconst.TOLEFT,
                                    width=68)
     corpTextCont = uicls.Container(name='corpName',
                                    parent=corpInfoCont,
                                    align=uiconst.TOALL)
     applicationCont = uicls.Container(name='corpInfo',
                                       parent=self.sr.main,
                                       align=uiconst.TOALL,
                                       padding=(const.defaultPadding, 0,
                                                const.defaultPadding,
                                                const.defaultPadding))
     uiutil.GetOwnerLogo(corpLogoCont,
                         self.corpid,
                         size=64,
                         noServerCall=True)
     corpText = localization.GetByLabel(
         'UI/Corporations/BaseCorporationUI/ApplyForMembership',
         corporation=corpName)
     corpNameLabel = uicls.EveLabelLarge(parent=corpTextCont,
                                         text=corpText,
                                         top=12,
                                         align=uiconst.TOPLEFT,
                                         width=270)
     editText = localization.GetByLabel(
         'UI/Corporations/BaseCorporationUI/CorporationApplicationText')
     editLabel = uicls.EveLabelSmall(parent=applicationCont,
                                     text=editText,
                                     align=uiconst.TOTOP)
     tax = self.corporation.taxRate * 100
     taxText = localization.GetByLabel(
         'UI/Corporations/BaseCorporationUI/CurrentTaxRateForCorporation',
         corporation=corpName,
         taxRate=tax)
     taxLabel = uicls.EveLabelSmall(parent=applicationCont,
                                    text=taxText,
                                    align=uiconst.TOBOTTOM)
     if self.corporation and not self.corporation.isRecruiting:
         notRecruitingText = localization.GetByLabel(
             'UI/Corporations/BaseCorporationUI/RecruitmentMayBeClosed')
         notRecruiting = uicls.EveLabelSmall(parent=applicationCont,
                                             text=notRecruitingText,
                                             align=uiconst.TOBOTTOM,
                                             idx=0)
         self.SetMinSize((self.default_width,
                          self.default_height + notRecruiting.textheight),
                         refresh=True)
     self.applicationText = uicls.EditPlainText(setvalue='',
                                                parent=applicationCont,
                                                align=uiconst.TOALL,
                                                maxLength=1000)
Beispiel #5
0
 def Startup(self, *etc):
     uicls.Line(parent=self,
                align=uiconst.TOBOTTOM,
                color=(1.0, 1.0, 1.0, 0.125))
     self.container = uicls.Container(name='container', parent=self)
     self.industry = uicls.Container(name='industry',
                                     parent=self,
                                     align=uiconst.TORIGHT,
                                     pos=(0, 0, 88, 0),
                                     padRight=7)
     self.military = uicls.Container(name='military',
                                     parent=self,
                                     align=uiconst.TORIGHT,
                                     pos=(0, 0, 88, 0),
                                     padRight=8)
     self.claimTime = uicls.Container(name='claimTime',
                                      parent=self,
                                      align=uiconst.TORIGHT,
                                      pos=(0, 0, 88, 0),
                                      padRight=8)
     self.system = uicls.Container(name='solarsystem',
                                   parent=self,
                                   padLeft=4)
     self.systemHeader = uicls.EveLabelSmall(text='',
                                             parent=self.system,
                                             left=0,
                                             top=4,
                                             align=uiconst.TOPLEFT,
                                             state=uiconst.UI_DISABLED,
                                             idx=0,
                                             maxLines=1)
     self.claimTimeHeader = uicls.EveLabelSmall(text='',
                                                parent=self.claimTime,
                                                left=0,
                                                top=4,
                                                align=uiconst.TOPLEFT,
                                                state=uiconst.UI_DISABLED,
                                                idx=0,
                                                maxLines=1)
     self.militaryHeader = uicls.EveLabelSmall(text='',
                                               parent=self.military,
                                               left=0,
                                               top=4,
                                               align=uiconst.TOPLEFT,
                                               state=uiconst.UI_DISABLED,
                                               idx=0,
                                               maxLines=1)
     self.industryHeader = uicls.EveLabelSmall(text='',
                                               parent=self.industry,
                                               left=0,
                                               top=4,
                                               align=uiconst.TOPLEFT,
                                               state=uiconst.UI_DISABLED,
                                               idx=0,
                                               maxLines=1)
Beispiel #6
0
    def SetIncrements(self, increments):
        self._incrementsParent.Flush()
        maxMarkerSize = 0
        labels = []
        self._increments = []
        if increments:
            last = increments.pop(-1)
            stepSize = 1.0 / len(increments)
            c = uicls.GridContainer(parent=self._incrementsParent, lines=1, columns=len(increments))
            i = 0
            for incrementData in increments:
                label = incrementData[0]
                markerSize = incrementData[1]
                inc = uicls.Container(parent=c, align=uiconst.TOALL)
                if markerSize:
                    maxMarkerSize = max(maxMarkerSize, markerSize)
                    uicls.Line(parent=inc, align=uiconst.TOPLEFT, width=1, height=markerSize)
                    self._increments.append((i * stepSize, incrementData))
                if label:
                    if label.startswith('res:'):
                        s = uicls.Sprite(parent=inc, texturePath=label, width=16, height=16, align=uiconst.CENTER, idx=0, top=-2, color=(1, 1, 1, 0.7))
                        labels.append(s)
                    else:
                        l = uicls.EveLabelSmall(parent=inc, text=label, left=-MAINSIDEMARGIN)
                        if i == 0:
                            l.left = max(-MAINSIDEMARGIN, -l.textwidth / 2)
                        else:
                            l.left = -l.textwidth / 2
                        labels.append(l)
                i += 1

            label = last[0]
            markerSize = last[1]
            inc = uicls.Container(parent=self._incrementsParent, align=uiconst.TORIGHT, width=1, idx=0)
            if markerSize:
                maxMarkerSize = max(maxMarkerSize, markerSize)
                uicls.Line(parent=inc, align=uiconst.TOPLEFT, width=1, height=markerSize)
                self._increments.append((i * stepSize, last))
            if label:
                if label.startswith('res:'):
                    s = uicls.Sprite(parent=inc, texturePath=label, width=16, height=16, align=uiconst.CENTER, idx=0, top=-2, color=(1, 1, 1, 0.7))
                    labels.append(s)
                else:
                    l = uicls.EveLabelSmall(parent=inc, text=label, align=uiconst.TOPRIGHT)
                    l.left = max(-MAINSIDEMARGIN, -l.textwidth / 2)
                    labels.append(l)
        maxHeight = 0
        for l in labels:
            l.top += maxMarkerSize
            maxHeight = max(l.top + l.height, maxHeight)

        self._incrementsParent.height = maxHeight
        self.height = sum([ each.height + each.padTop + each.padBottom for each in self.children if each.align == uiconst.TOTOP ])
Beispiel #7
0
 def Startup(self, *args):
     self.sr.selection = None
     self.sr.hilite = None
     self.OnSelectCallback = None
     self.sr.label = uicls.EveLabelSmall(
         text=localization.GetByLabel('UI/Neocom/NextDNAModification'),
         parent=self,
         left=8,
         top=4,
         maxLines=1)
     self.sr.respecTime = uicls.EveLabelMedium(text='',
                                               parent=self,
                                               left=8,
                                               top=18,
                                               maxLines=1)
     self.sr.numberOfRemaps = uicls.EveLabelMedium(text='',
                                                   parent=self,
                                                   left=8,
                                                   top=38,
                                                   maxLines=1,
                                                   state=uiconst.UI_HIDDEN)
     self.sr.respecButton = uicls.Button(
         parent=self,
         label=localization.GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/Attributes/RemapStatsNow'
         ),
         align=uiconst.TOPRIGHT,
         pos=(2, 16, 0, 0),
         func=self.OpenRespecWindow,
         args=(False, ))
     self.hint = localization.GetByLabel(
         'UI/CharacterSheet/CharacterSheetWindow/Attributes/CharacterSheetHint'
     )
Beispiel #8
0
 def ApplyAttributes(self, attributes):
     self.uiEffects = uicls.UIEffects()
     uicls.Container.ApplyAttributes(self, attributes)
     self.value = attributes.Get('value', 0.0)
     self.left = attributes.Get('left', 0)
     self.top = attributes.Get('top', 0)
     self.typeID = iconTypeID = attributes.Get('iconTypeID', 6)
     color = planetCommon.PLANET_COLOR_USED_PROCESSOR
     bgColor = (255 / 255.0, 128 / 255.0, 0 / 255.0, 0.15)
     self.icon = uicls.Icon(parent=self,
                            pos=(2, 2, 16, 16),
                            state=uiconst.UI_DISABLED,
                            typeID=iconTypeID,
                            size=16,
                            ignoreSize=True)
     gaugeCont = uicls.Container(parent=self,
                                 pos=(0, 0, self.width, self.width),
                                 align=uiconst.TOPLEFT)
     self.gauge = uicls.Fill(parent=gaugeCont,
                             align=uiconst.TOLEFT,
                             width=0,
                             color=color,
                             state=uiconst.UI_DISABLED)
     uicls.Fill(parent=gaugeCont, color=bgColor, state=uiconst.UI_DISABLED)
     self.subText = uicls.EveLabelSmall(text='',
                                        parent=self,
                                        top=22,
                                        state=uiconst.UI_DISABLED)
     self.busy = False
     self.SetValue(self.value)
Beispiel #9
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 = uicls.EveLabelSmall(text='',
                                         parent=self,
                                         name='text',
                                         align=align,
                                         state=uiconst.UI_DISABLED,
                                         padding=padding,
                                         pos=pos,
                                         maxLines=maxLines)
Beispiel #10
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.parentTimer = attributes.get('parentTimer')
     self.timerData = attributes.get('timerData')
     self.GetTime = self.timerData.timerFunc
     uicls.Frame(pgParent=self,
                 state=uiconst.UI_DISABLED,
                 color=HINT_FRAME_COLOR)
     leftCont = uicls.Container(parent=self,
                                align=uiconst.TOLEFT,
                                width=self.TIME_WIDTH)
     rightCont = uicls.Container(parent=self, align=uiconst.TOALL)
     self.time = uicls.Label(
         parent=leftCont,
         name='counter',
         text=str(int(self.timerData.maxTimeout / const.SEC)),
         fontsize=20,
         bold=False,
         align=uiconst.CENTERLEFT,
         color=self.timerData.color,
         left=2 * const.defaultPadding)
     self.text = uicls.EveLabelSmall(
         left=const.defaultPadding,
         parent=rightCont,
         name='timer description',
         text=localization.GetByLabel(self.timerData.tooltip),
         align=uiconst.CENTERLEFT,
         width=self.TEXT_WIDTH - 2 * const.defaultPadding)
     self.height = self.text.actualTextHeight + 2 * const.defaultPadding
     self.activeBlink = None
     self.doUpdates = True
     uthread.new(self.UpdateTimer)
     self.opacity = 0.0
     uicore.animations.FadeIn(self, duration=0.5)
Beispiel #11
0
 def InitCloneFacilityPanel(self):
     panel = self.sr.clonefacilityPanel
     btns = [(localization.GetByLabel('UI/Ship/ShipConfig/Invite'),
              self.InviteClone, (), 84),
             (localization.GetByLabel('UI/Ship/ShipConfig/Destroy'),
              self.DestroyClone, (), 84)]
     self.cloneFacilityButtons = uicls.ButtonGroup(btns=btns, parent=panel)
     if not session.solarsystemid:
         self.cloneFacilityButtons.GetBtnByIdx(0).Disable()
     numClones = int(0)
     totalClones = int(
         getattr(
             sm.GetService('godma').GetItem(self.shipItem.itemID),
             'maxJumpClones', 0))
     text = localization.GetByLabel('UI/Ship/ShipConfig/NumJumpClones',
                                    numClones=numClones,
                                    totalClones=totalClones)
     self.sr.cloneInfo = uicls.EveLabelSmall(
         text=text,
         parent=panel,
         align=uiconst.TOTOP,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, 0),
         state=uiconst.UI_NORMAL)
     self.sr.clonescroll = uicls.Scroll(name='clonescroll',
                                        parent=panel,
                                        padding=const.defaultPadding)
     self.cloneinited = 1
Beispiel #12
0
 def AddCombo(self):
     self.new = uicls.Container(name='comboField',
                                parent=self.parent,
                                align=uiconst.TOTOP,
                                height=self.type.get('height', 20))
     options = self.type.get(
         'options', [(localization.GetByLabel('UI/Common/None'), None)])
     self.code = uicls.Combo(label='',
                             parent=self.new,
                             options=options,
                             name=self.type.get('key', 'combo'),
                             select=self.type.get('setvalue', ''),
                             padding=(self.leftPush, 2, 0, 2),
                             align=uiconst.TOTOP,
                             callback=self.type.get('callback', None),
                             labelleft=self.leftPush)
     self.new.height = self.code.height + self.code.padTop * 4
     width = self.type.get('width', None)
     if width:
         self.code.SetAlign(uiconst.TOLEFT)
         self.code.width = width
     label = self.type.get('label', '')
     if label == '_hide':
         self.code.padLeft = 0
     else:
         uicls.EveLabelSmall(text=label,
                             parent=self.new,
                             name='label',
                             left=7,
                             width=self.leftPush - 6,
                             align=uiconst.CENTERLEFT)
Beispiel #13
0
 def ConstructLayout(self):
     charInfoCont = uicls.Container(name='charInfo',
                                    parent=self.sr.main,
                                    align=uiconst.TOTOP,
                                    height=68,
                                    padding=const.defaultPadding)
     charLogoCont = uicls.Container(name='charLogo',
                                    parent=charInfoCont,
                                    align=uiconst.TOLEFT,
                                    width=68)
     charTextCont = uicls.Container(name='charName',
                                    parent=charInfoCont,
                                    align=uiconst.TOALL)
     applicationCont = uicls.Container(name='charInfo',
                                       parent=self.sr.main,
                                       align=uiconst.TOALL,
                                       padding=(const.defaultPadding, 0,
                                                const.defaultPadding,
                                                const.defaultPadding))
     uiutil.GetOwnerLogo(charLogoCont,
                         self.charID,
                         size=64,
                         noServerCall=True)
     charText = localization.GetByLabel(
         'UI/Corporations/CorpApplications/ApplicationSubjectLine',
         player=self.charID)
     charNameLabel = uicls.EveLabelLarge(parent=charTextCont,
                                         text=charText,
                                         top=12,
                                         align=uiconst.TOPLEFT,
                                         width=270)
     editText = localization.GetByLabel(
         'UI/Corporations/BaseCorporationUI/CorporationApplicationText')
     editLabel = uicls.EveLabelSmall(parent=applicationCont,
                                     text=editText,
                                     align=uiconst.TOTOP)
     self.rejectRb = uicls.Checkbox(text=localization.GetByLabel(
         'UI/Corporations/CorpApplications/RejectApplication'),
                                    parent=applicationCont,
                                    configName='reject',
                                    retval=1,
                                    checked=False,
                                    groupname='state',
                                    align=uiconst.TOBOTTOM)
     self.acceptRb = uicls.Checkbox(text=localization.GetByLabel(
         'UI/Corporations/CorpApplications/ApplicationInviteApplicant'),
                                    parent=applicationCont,
                                    configName='accept',
                                    retval=0,
                                    checked=True,
                                    groupname='state',
                                    align=uiconst.TOBOTTOM)
     if self.status not in (const.crpApplicationAppliedByCharacter,
                            const.crpApplicationAcceptedByCorporation):
         self.rejectRb.state = uiconst.UI_HIDDEN
         self.acceptRb.state = uiconst.UI_HIDDEN
     self.applicationText = uicls.EditPlainText(setvalue=self.appText,
                                                parent=applicationCont,
                                                maxLength=1000,
                                                readonly=True)
Beispiel #14
0
 def AddHeader(self):
     self.new = uicls.Container(name='headerField',
                                parent=self.parent,
                                align=uiconst.TOTOP)
     header = uicls.EveLabelSmall(text=self.type.get('text', ''),
                                  parent=self.new,
                                  name='header',
                                  padding=(7, 3, 7, 3),
                                  align=uiconst.TOTOP,
                                  state=uiconst.UI_NORMAL,
                                  bold=True)
     self.new.height = max(self.type.get('height', 17),
                           header.textheight + header.padTop * 2)
     self.refresh.append((self.new, header))
     if not self.type.get('hideLine', False):
         uicls.Line(parent=self.new,
                    align=uiconst.TOTOP,
                    padLeft=-6,
                    padRight=-6,
                    idx=0)
         uicls.Line(parent=self.new,
                    align=uiconst.TOBOTTOM,
                    padLeft=-6,
                    padRight=-6,
                    idx=0)
Beispiel #15
0
 def SetSubText(self, text):
     if not self.subText:
         self.subText = uicls.EveLabelSmall(parent=self,
                                            align=uiconst.TOTOP,
                                            state=uiconst.UI_DISABLED,
                                            maxLines=1,
                                            padTop=1)
     self.subText.text = text
Beispiel #16
0
 def PanelCreateRoute(self, typeID, amount):
     cont = uicls.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=cfg.invtypes.Get(typeID).name,
         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 = uicls.SinglelineEdit(
         name='routeAmountEdit',
         parent=cont,
         setvalue=self.routeMaxAmount,
         height=14,
         width=45,
         align=uiconst.TOPLEFT,
         top=44,
         ints=(0, self.routeMaxAmount),
         OnChange=self.OnRouteAmountEditChanged)
     self.routeAmountText = uicls.EveLabelSmall(parent=cont,
                                                left=47,
                                                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 = uicls.ButtonGroup(btns=btns,
                                                parent=cont,
                                                line=False,
                                                alwaysLite=True)
     self.UpdatePanelCreateRoute()
     return cont
Beispiel #17
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     left1 = uicls.Fill(name='left1', parent=self, align=uiconst.TOLEFT, width=8, padBottom=5, color=util.Color.WHITE)
     left2 = uicls.Fill(name='left2', parent=self, align=uiconst.TOLEFT, width=30, padLeft=3, color=util.Color.WHITE)
     left3 = uicls.Fill(name='left3', parent=self, align=uiconst.TOLEFT, width=8, padLeft=3, color=util.Color.WHITE)
     self.label = uicls.EveLabelSmall(parent=self, align=uiconst.TOLEFT, width=100, padLeft=5)
     self.right1 = uicls.Fill(name='right1', parent=self, align=uiconst.TORIGHT, width=50, color=util.Color.WHITE)
     self.right2 = uicls.Fill(name='right2', parent=self, align=uiconst.TORIGHT, width=50, color=util.Color.WHITE, padRight=3)
     self.right3 = uicls.Fill(name='right3', parent=self, align=uiconst.TORIGHT, width=50, color=util.Color.WHITE, padRight=3)
Beispiel #18
0
 def SetLabel(self, text):
     self.sr.label = uicls.EveLabelSmall(parent=self,
                                         name='__caption',
                                         text=text,
                                         state=uiconst.UI_DISABLED,
                                         align=uiconst.TOPLEFT,
                                         idx=0)
     self.sr.label.top = -self.sr.label.textheight
     if self.adjustWidth:
         self.width = max(self.width, self.sr.label.textwidth)
Beispiel #19
0
 def ApplyAttributes(self, attributes):
     super(uicls.Tab, self).ApplyAttributes(attributes)
     if self.sr.label:
         self.sr.label.Close()
     self.sr.label = uicls.EveLabelSmall(parent=self.sr.clipper,
                                         state=uiconst.UI_DISABLED,
                                         align=uiconst.CENTERLEFT,
                                         name='tabLabel')
     self.sr.label.color = (1.0, 1.0, 1.0, 0.8)
     self.isTabStop = False
Beispiel #20
0
 def Startup(self):
     self.state = uiconst.UI_NORMAL
     self.shouldKill = False
     sub = uicls.Container(name='sub',
                           parent=self,
                           align=uiconst.TOALL,
                           pos=(0, 0, 0, 0),
                           state=uiconst.UI_DISABLED)
     uicls.Frame(parent=self)
     uicls.Fill(parent=self,
                color=(0, 0, 0, 1),
                idx=-1,
                state=uiconst.UI_DISABLED)
     closex = uicls.Icon(icon='ui_38_16_220',
                         parent=self,
                         idx=0,
                         state=uiconst.UI_NORMAL,
                         align=uiconst.TOPRIGHT)
     closex.OnClick = self.CloseNotification
     closex.sr.hint = localization.GetByLabel('UI/Common/CloseNotification')
     iconCont = uicls.Container(name='iconCont',
                                parent=sub,
                                align=uiconst.TOLEFT,
                                pos=(0, 0, 60, 0))
     textCont = uicls.Container(name='textCont',
                                parent=sub,
                                align=uiconst.TOALL,
                                pos=(0, 0, 0, 0),
                                state=uiconst.UI_NORMAL)
     self.sr.icon = uicls.Icon(parent=iconCont,
                               icon='50_11',
                               pos=(-2, 2, 64, 64),
                               align=uiconst.CENTERLEFT,
                               state=uiconst.UI_DISABLED)
     self.sr.headerText = uicls.EveLabelSmall(text='',
                                              parent=textCont,
                                              padTop=12,
                                              align=uiconst.TOTOP,
                                              state=uiconst.UI_DISABLED,
                                              bold=True)
     self.sr.text1 = uicls.EveLabelMedium(text='',
                                          parent=textCont,
                                          state=uiconst.UI_DISABLED,
                                          align=uiconst.TOTOP,
                                          padding=(0, -2, 4, 0))
     self.sr.text2 = uicls.EveLabelMedium(text='',
                                          parent=textCont,
                                          state=uiconst.UI_HIDDEN,
                                          align=uiconst.TOTOP,
                                          padding=(0, -2, 4, 0))
     self.sr.text3 = uicls.EveLabelMedium(text='',
                                          parent=textCont,
                                          state=uiconst.UI_HIDDEN,
                                          align=uiconst.TOTOP,
                                          padding=(0, -2, 4, 0))
Beispiel #21
0
 def ConstructLayout(self):
     cont = uicls.Container(parent=self.sr.main,
                            align=uiconst.TOALL,
                            padding=const.defaultPadding)
     if boot.region == 'optic':
         nameValue = localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Alliances/Home/NameAlliance',
             allianceName=cfg.eveowners.Get(session.corpid).ownerName)
     else:
         nameValue = localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Alliances/Home/NameAlliance',
             languageID=localization.LOCALE_SHORT_ENGLISH,
             allianceName=cfg.eveowners.Get(session.corpid).ownerName)
     self.nameEdit = uicls.SinglelineEdit(
         parent=cont,
         label=localization.GetByLabel('UI/Common/Name'),
         align=uiconst.TOTOP,
         maxLength=100,
         padTop=12,
         setvalue=nameValue)
     shortNameCont = uicls.Container(parent=cont,
                                     align=uiconst.TOTOP,
                                     height=30,
                                     padTop=20)
     suggestBtn = uicls.Button(
         parent=shortNameCont,
         align=uiconst.TOPRIGHT,
         label=localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Alliances/Home/SuggestCommand'
         ),
         func=self.GetSuggestedTickerNames)
     editWidth = self.width - suggestBtn.width - 16
     self.shortNameEdit = uicls.SinglelineEdit(
         parent=shortNameCont,
         label=localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Alliances/Home/ShortName'),
         align=uiconst.TOPLEFT,
         maxLength=5,
         width=editWidth)
     self.urlEdit = uicls.SinglelineEdit(
         parent=cont,
         label=localization.GetByLabel('UI/Common/URL'),
         align=uiconst.TOTOP,
         maxLenght=2048,
         padTop=12)
     editLabel = uicls.EveLabelSmall(
         parent=cont,
         text=localization.GetByLabel('UI/Common/Description'),
         height=16,
         align=uiconst.TOTOP,
         padTop=12)
     self.descriptionEdit = uicls.EditPlainText(parent=cont,
                                                align=uiconst.TOTOP,
                                                maxLength=5000,
                                                height=80)
Beispiel #22
0
 def Prepare_Label_(self):
     textclipper = uicls.Container(name='textclipper',
                                   parent=self,
                                   align=uiconst.TOALL,
                                   padding=(6, 2, 6, 0),
                                   state=uiconst.UI_PICKCHILDREN,
                                   clipChildren=1)
     self.sr.label = uicls.EveLabelSmall(text='',
                                         parent=textclipper,
                                         hilightable=1,
                                         state=uiconst.UI_DISABLED)
Beispiel #23
0
 def PrepareLayout(self):
     uicls.Line(parent=self, align=uiconst.TORIGHT)
     self.textLabel = uicls.EveLabelSmall(text=self.name,
                                          parent=self,
                                          align=uiconst.CENTER,
                                          state=uiconst.UI_DISABLED)
     self.hilite = uicls.Fill(parent=self,
                              state=uiconst.UI_HIDDEN,
                              padding=1)
     self.width = self.textLabel.width + 10
     self.cursor = uiconst.UICURSOR_SELECT
Beispiel #24
0
 def ApplyAttributes(self, attributes):
     uicls.LabelCore.ApplyAttributes(self, attributes)
     subcaption = attributes.get('subcaption', self.default_subcaption)
     self.subcapt = uicls.EveLabelSmall(text='',
                                        parent=self.parent,
                                        align=uiconst.TOPLEFT,
                                        left=self.left + 1,
                                        top=self.top + self.textheight - 2,
                                        state=uiconst.UI_HIDDEN,
                                        name='subcaption')
     if subcaption:
         self.SetSubcaption(subcaption)
Beispiel #25
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.charID = attributes.get('charID')
     self.timeout = attributes.get('timeout')
     self.isDragObject = True
     self.itemID = self.charID
     self.info = cfg.eveowners.Get(self.charID)
     self.activeBlink = None
     self.highlight = uicls.Fill(bgParent=self,
                                 color=(1, 1, 1, 0.1),
                                 state=uiconst.UI_HIDDEN)
     leftCont = uicls.Container(parent=self, align=uiconst.TOLEFT, width=54)
     self.time = uicls.Label(parent=leftCont,
                             name='counter',
                             text='',
                             fontsize=16,
                             bold=False,
                             align=uiconst.CENTERLEFT,
                             color=Colors.Engagement.GetRGBA(),
                             left=2 * const.defaultPadding)
     self.portrait = uicls.Sprite(parent=self,
                                  pos=(50, 0, 32, 32),
                                  state=uiconst.UI_DISABLED)
     uicls.EveLabelSmall(parent=self,
                         name='name',
                         text=self.info.ownerName,
                         align=uiconst.TOPLEFT,
                         top=1,
                         left=96)
     self.corpText = uicls.EveLabelSmall(parent=self,
                                         name='corporation',
                                         text='',
                                         align=uiconst.TOPLEFT,
                                         top=17,
                                         left=96)
     self.stateFlag = uicls.StateFlag(parent=self,
                                      align=uiconst.TOPRIGHT,
                                      pos=(13, 4, 9, 9))
     self.LoadData()
     sm.RegisterNotify(self)
Beispiel #26
0
 def Startup(self, *args):
     listentry.Generic.Startup(self, *args)
     sm.RegisterNotify(self)
     self.sr.line.display = False
     self.portraitCont = uicls.Container(name='portraitCont',
                                         parent=self,
                                         align=uiconst.TOLEFT,
                                         width=64)
     self.utilMenuCont = uicls.Container(name='utilMenuCont',
                                         parent=self,
                                         align=uiconst.TORIGHT,
                                         width=28)
     self.utilMenuCont.display = False
     myTextCont = uicls.Container(name='myTextCont',
                                  parent=self,
                                  align=uiconst.TOALL,
                                  padLeft=2 * const.defaultPadding,
                                  clipChildren=True)
     self.textCont = uicls.ContainerAutoSize(name='textCont',
                                             parent=myTextCont,
                                             align=uiconst.CENTERLEFT)
     self.nameLabel = uicls.EveLabelMedium(text='',
                                           parent=self.textCont,
                                           maxLines=1,
                                           align=uiconst.TOPLEFT,
                                           state=uiconst.UI_NORMAL)
     self.saleLabel = uicls.EveLabelSmall(text='',
                                          parent=self.textCont,
                                          maxLines=1,
                                          align=uiconst.TOPLEFT,
                                          top=19,
                                          state=uiconst.UI_NORMAL)
     self.availableLabel = uicls.EveLabelSmall(text='',
                                               parent=self.textCont,
                                               maxLines=1,
                                               align=uiconst.TOPLEFT,
                                               top=32,
                                               state=uiconst.UI_NORMAL)
Beispiel #27
0
    def ShowTimer(self, timerID, startTime, duration, label):
        check = self.GetTimer(timerID)
        if check:
            if check.endTime <= startTime + duration:
                check.Close()
            else:
                return
        timer = uicls.Container(name='%s' % timerID, parent=self.sr.gaugeParent, align=uiconst.TOTOP, height=7, padTop=5, padBottom=1)
        timer.endTime = startTime + duration
        timer.timerID = timerID
        self.ArrangeGauges()
        t1 = uicls.EveHeaderSmall(text=label, parent=timer, left=68, top=-1, state=uiconst.UI_DISABLED)
        uicls.Frame(parent=timer, padding=-1, color=(1.0, 1.0, 1.0, 0.5))
        t = uicls.EveLabelSmall(text='', parent=timer, left=5, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL)
        p = uicls.Fill(parent=timer, align=uiconst.TOLEFT)
        timer.height = max(7, t.textheight - 3, t1.textheight - 3)
        duration = float(duration)
        while 1 and not timer.destroyed:
            now = blue.os.GetSimTime()
            dt = blue.os.TimeDiffInMs(startTime, now)
            timeLeft = (duration - dt) / 1000.0
            timer.timeLeft = timeLeft
            if timer.destroyed or dt > duration:
                t.text = localization.GetByLabel('UI/Common/Done')
                p.width = 0
                break
            t.text = localization.GetByLabel('UI/Inflight/Target/TimerDuration', timeLeft=timeLeft)
            p.width = int(timer.displayWidth * ((duration - dt) / duration))
            timer.height = max(7, t.textheight - 3)
            blue.pyos.synchro.Yield()

        blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = localization.GetByLabel('UI/Common/Done')
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = localization.GetByLabel('UI/Common/Done')
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            timer.Close()
        if not self.destroyed:
            self.ArrangeGauges()
Beispiel #28
0
 def SetSmallCaption(self, capstr, inside=0, maxWidth=None):
     if not self.sr.smallcaption:
         self.sr.smallcaption = uicls.EveLabelSmall(
             text='',
             parent=self,
             state=uiconst.UI_DISABLED,
             idx=0,
             width=self.width)
     self.sr.smallcaption.busy = 1
     if inside:
         self.sr.smallcaption.SetAlign(uiconst.CENTER)
     else:
         self.sr.smallcaption.SetAlign(uiconst.CENTERTOP)
         self.sr.smallcaption.top = self.height + 2
     self.sr.smallcaption.width = maxWidth or self.width
     self.sr.smallcaption.busy = 0
     self.sr.smallcaption.text = '<center>' + capstr
Beispiel #29
0
 def Prepare_(self):
     self.sr.textobj = uicls.EveLabelSmall(text='',
                                           parent=self,
                                           left=8,
                                           top=3,
                                           width=200,
                                           align=uiconst.TOPLEFT,
                                           state=uiconst.UI_DISABLED,
                                           color=(1, 1, 1, 1))
     self.border = uicls.Frame(parent=self,
                               frameConst=uiconst.FRAME_BORDER1_CORNER5,
                               state=uiconst.UI_DISABLED,
                               color=(1.0, 1.0, 1.0, 0.25))
     self.frame = uicls.Frame(parent=self,
                              color=(0.0, 0.0, 0.0, 0.75),
                              frameConst=uiconst.FRAME_FILLED_CORNER4,
                              state=uiconst.UI_DISABLED)
Beispiel #30
0
    def Refresh(self):
        data = self.data
        self.Flush()
        textMaxWidth = self.textMaxWidth
        if isinstance(data, basestring):
            data = HintEntryData(data)
        elif isinstance(data, tuple):
            text, (event, func, args) = data
            data = HintEntryData(text, event=event, func=func, args=args)
        if data.menuGetter:
            self.state = uiconst.UI_NORMAL
            self.GetMenu = data.menuGetter
        label = uicls.EveLabelSmall(text=data.text,
                                    parent=self,
                                    left=5,
                                    top=1,
                                    state=uiconst.UI_DISABLED,
                                    idx=0)
        self.sr.label = label
        self.width = label.textwidth
        self.height = label.textheight + 1
        self.name = data.text

        def AddIcon(iconNum, left=-1):
            uicls.Icon(icon=iconNum,
                       parent=self,
                       pos=(left, -2, 16, 16),
                       align=uiconst.TOPRIGHT,
                       idx=0,
                       state=uiconst.UI_DISABLED)
            self.width += 14

        if data.func:
            setattr(self, data.event,
                    (getattr(self, data.func, None), data.args))
            self.state = uiconst.UI_NORMAL
            if data.func == 'ShowSubhint':
                AddIcon(iconNum='ui_38_16_127')
            elif data.func == 'ShowInfo':
                AddIcon(iconNum='ui_38_16_126')
            elif data.func == 'OpenAssets':
                AddIcon(iconNum='ui_38_16_125')
        if data.talking:
            AddIcon(iconNum='ui_38_16_91', left=0)