Esempio n. 1
0
 def ExpandMenu(self, *args):
     if self.destroyed:
         return
     if self.IsExpanded():
         self.CloseMenu()
         return
     background = self.AccessBackground()
     icon = self.AccessIcon()
     l, t, w, h = background.GetAbsolute()
     buttonCopy = Container(parent=uicore.layer.utilmenu, align=uiconst.TOPLEFT, pos=(l,
      t,
      self.GetFullWidth(),
      h), state=uiconst.UI_NORMAL, idx=0)
     buttonCopy.OnMouseDown = self.CloseMenu
     if self._label is not None:
         label = EveLabelMedium(parent=buttonCopy, text=self._label.text, align=self._label.align, bold=True, left=self._label.left)
     Sprite(parent=buttonCopy, texturePath=self.closeTexturePath, state=uiconst.UI_DISABLED, align=icon.align, width=icon.width, height=icon.height, left=icon.left)
     topOrBottomLine = LineUnderlay(parent=buttonCopy, align=uiconst.TOTOP, opacity=OPACITY_LINES)
     if self.menuAlign in (uiconst.BOTTOMLEFT, uiconst.BOTTOMRIGHT):
         topOrBottomLine.align = uiconst.TOBOTTOM
     LineUnderlay(parent=buttonCopy, align=uiconst.TOLEFT, opacity=OPACITY_LINES)
     LineUnderlay(parent=buttonCopy, align=uiconst.TORIGHT, opacity=OPACITY_LINES)
     FillUnderlay(bgParent=buttonCopy, opacity=OPACITY_BG)
     menuParent = ExpandedUtilMenu(parent=uicore.layer.utilmenu, controller=self, GetUtilMenu=self._getMenuFunction, minWidth=self.GetFullWidth() + 16, idx=1, menuAlign=self.menuAlign)
     self._menu = weakref.ref(menuParent)
     self._menuButton = weakref.ref(buttonCopy)
     uicore.animations.MorphScalar(buttonCopy, 'opacity', startVal=0.5, endVal=1.0, duration=0.2)
     uthread.new(uicore.registry.SetFocus, menuParent)
Esempio n. 2
0
    def LoadTabs(self,
                 tabs,
                 autoselecttab=1,
                 settingsID=None,
                 iconOnly=False,
                 silently=False):
        self._iconOnly = iconOnly
        self.sr.tabs = []
        self.sr.mytabs = []
        self.sr.tabsmenu = None
        self.Flush()
        LineUnderlay(parent=self, align=uiconst.TOBOTTOM)
        maxTextHeight = 0
        for data in tabs:
            newtab = Tab(parent=self, labelPadding=self.labelPadding)
            self.sr.mytabs.append(newtab)
            newtab.Startup(self, data)
            newtab.align = uiconst.TOLEFT
            self.sr.Set('%s_tab' % data.label, newtab)
            self.sr.tabs.append(newtab)
            maxTextHeight = max(maxTextHeight, newtab.sr.label.textheight)
            if newtab.sr.icon:
                maxTextHeight = max(maxTextHeight, newtab.sr.icon.height)

        self.height = max(self.height, int(maxTextHeight * 1.7))
        self._inited = 1
        self._settingsID = settingsID
        self.UpdateSizes()
        if autoselecttab:
            self.AutoSelect(silently)
Esempio n. 3
0
    def CreateColumns(self, columns, fixedColumns=None):
        self.headerContainer.Flush()
        self.columnIDs = columns
        self.fixedColumns = fixedColumns
        if columns:
            sizes = self.GetCurrentSizes()
            for columnID in columns:
                header = uiprimitives.Container(parent=self.headerContainer,
                                                align=uiconst.TOLEFT,
                                                state=uiconst.UI_NORMAL)
                header.OnClick = (self.ClickHeader, header)
                header.OnDblClick = (self.DblClickHeader, header)
                header.columnID = columnID
                header.sortTriangle = None
                headerDivider = LineUnderlay(parent=header,
                                             align=uiconst.TORIGHT,
                                             opacity=uiconst.OPACITY_FRAME)
                if columnID not in fixedColumns:
                    scaler = uiprimitives.Container(parent=header,
                                                    align=uiconst.TOPRIGHT,
                                                    width=4,
                                                    height=self.height - 1,
                                                    state=uiconst.UI_NORMAL)
                    scaler.OnMouseDown = (self.StartHeaderScale, header)
                    scaler.OnMouseEnter = (self.OnHeaderMouseEnter, header)
                    scaler.OnMouseExit = (self.OnHeaderMouseExit, header)
                    header.OnMouseEnter = (self.OnHeaderMouseEnter, header)
                    header.OnMouseExit = (self.OnHeaderMouseExit, header)
                    scaler.cursor = 16
                label = uicontrols.EveLabelSmall(
                    parent=header,
                    text=sm.GetService('tactical').GetColumnLabel(
                        columnID, addFormatUnit=True),
                    align=uiconst.CENTERLEFT,
                    left=6,
                    state=uiconst.UI_DISABLED,
                    maxLines=1)
                header.label = label
                if fixedColumns and columnID in fixedColumns:
                    header.width = fixedColumns[columnID]
                    if header.width <= 32:
                        label.Hide()
                elif columnID in sizes:
                    header.width = max(COLUMNMINSIZE, sizes[columnID])
                else:
                    header.width = max(
                        COLUMNMINSIZE,
                        max(COLUMNMINDEFAULTSIZE, label.textwidth + 24))
                header.fill = FillUnderlay(
                    parent=header,
                    colorType=uiconst.COLORTYPE_UIHILIGHT,
                    padLeft=-1,
                    padRight=-1,
                    opacity=0.75)

            self.UpdateActiveState()
Esempio n. 4
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     LineUnderlay(parent=self,
                  align=uiconst.TOBOTTOM,
                  opacity=uiconst.OPACITY_FRAME)
     self.headerContainer = uiprimitives.Container(parent=self)
     self.settingsID = attributes.settingsID
     self.customSortIcon = None
     self.columnIDs = []
     self.fixedColumns = None
     self.defaultColumn = None
 def Startup(self, *args):
     LineUnderlay(parent=self, align=uiconst.TOBOTTOM)
     self.text = uicontrols.EveLabelMedium(
         parent=self,
         align=uiconst.TOTOP,
         state=uiconst.UI_NORMAL,
         padding=const.defaultPadding,
         linkStyle=uiconst.LINKSTYLE_REGULAR)
     self.postedBy = uicontrols.EveLabelMedium(parent=self,
                                               align=uiconst.BOTTOMRIGHT,
                                               state=uiconst.UI_NORMAL,
                                               maxLines=1,
                                               top=const.defaultPadding,
                                               left=const.defaultPadding)
    def LoadTooltipPanel(self, tooltipPanel, *args):
        if uicore.uilib.leftbtn:
            return
        tooltipPanel.columns = 2
        tooltipPanel.margin = 2
        for settingsGroupKey in self.settingGroupKeys:
            if len(tooltipPanel.children):
                divider = LineUnderlay(align=uiconst.TOTOP, height=1)
                tooltipPanel.AddCell(cellObject=divider,
                                     colSpan=tooltipPanel.columns)
            if settingsGroupKey in MV_GROUPS_BY_ID:
                for settingsID in MV_GROUPS_BY_ID[settingsGroupKey]:
                    checked = settingsID == GetMapViewSetting(settingsGroupKey)
                    checkBox = Checkbox(align=uiconst.TOPLEFT,
                                        text=LABEL_MAP_BY_ID[settingsID],
                                        groupname=settingsGroupKey,
                                        checked=checked,
                                        wrapLabel=False,
                                        callback=self.OnCheckBoxChange,
                                        configName=settingsGroupKey,
                                        retval=settingsID)
                    tooltipPanel.AddCell(cellObject=checkBox,
                                         colSpan=tooltipPanel.columns,
                                         cellPadding=(3, 0, 3, 0))

            else:
                checked = bool(GetMapViewSetting(settingsGroupKey))
                checkBox = Checkbox(align=uiconst.TOPLEFT,
                                    text=LABEL_MAP_BY_ID[settingsGroupKey],
                                    checked=checked,
                                    wrapLabel=False,
                                    callback=self.OnCheckBoxChange,
                                    configName=settingsGroupKey)
                tooltipPanel.AddCell(cellObject=checkBox,
                                     colSpan=tooltipPanel.columns,
                                     cellPadding=(3, 0, 3, 0))

        tooltipPanel.state = uiconst.UI_NORMAL
Esempio n. 7
0
 def Layout(self):
     """
     Setup UI controls for this window.
     """
     self.HideHeader()
     self.MakeUnResizeable()
     self.container = ContainerAutoSize(parent=self.GetMainArea(),
                                        align=uiconst.TOTOP,
                                        alignMode=uiconst.TOTOP,
                                        state=uiconst.UI_PICKCHILDREN,
                                        callback=self.OnContainerResized)
     headerCont = ContainerAutoSize(parent=self.container,
                                    align=uiconst.TOTOP)
     EveCaptionMedium(parent=headerCont,
                      align=uiconst.CENTERTOP,
                      text=localization.GetByLabel('UI/TrialUpsell/Header'),
                      padding=(0, 8, 0, 4))
     LineUnderlay(parent=self.container,
                  align=uiconst.TOTOP,
                  padding=(2, 0, 2, 0))
     bodyCont = ContainerAutoSize(parent=self.container,
                                  align=uiconst.TOTOP,
                                  alignMode=uiconst.TOTOP)
     mainCont = ContainerAutoSize(parent=bodyCont,
                                  align=uiconst.TOTOP,
                                  alignMode=uiconst.TOTOP)
     GradientSprite(bgParent=bodyCont,
                    rgbData=[(0, (0.138, 0.138, 0.08)),
                             (0.6, (0.06, 0.06, 0.06)),
                             (1.0, (0.1, 0.1, 0.1))],
                    alphaData=[(0.0, 0.8), (1.0, 0.2)],
                    alphaInterp=GradientConst.INTERP_LINEAR,
                    colorInterp=GradientConst.INTERP_LINEAR,
                    rotation=-math.pi / 2,
                    padding=(2, 0, 2, 2))
     EveLabelLarge(parent=mainCont,
                   align=uiconst.TOTOP,
                   text=localization.GetByLabel('UI/TrialUpsell/Greeting'),
                   padding=(160, 18, 20, 8))
     EveLabelLarge(parent=mainCont,
                   align=uiconst.TOTOP,
                   text=self.message
                   or localization.GetByLabel('UI/TrialUpsell/DefaultBody'),
                   padding=(160, 0, 20, 8))
     EveLabelLarge(parent=mainCont,
                   align=uiconst.TOTOP,
                   text=localization.GetByLabel('UI/TrialUpsell/Footer'),
                   padding=(160, 0, 20, 16))
     trialDays = sm.RemoteSvc('userSvc').GetTrialDaysRemaining()
     EveLabelLarge(parent=mainCont,
                   align=uiconst.TOTOP,
                   text=localization.GetByLabel(
                       'UI/TrialUpsell/TrialTimeLeft',
                       daysLeft=trialDays.daysLeft,
                       daysTotal=trialDays.trialLen),
                   color=(0.8, 0.6, 0.2, 0.8),
                   padding=(160, 0, 20, 8))
     self.iconGlow = Sprite(
         parent=mainCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Monetization/Trial_Icon_Glow_256.png',
         left=-20,
         width=200,
         height=200)
     Sprite(
         parent=mainCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Monetization/Trial_Icon_NoGlow_256.png',
         left=-20,
         width=200,
         height=200)
     self.iconGlare1 = Sprite(
         parent=mainCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Monetization/glare_256_1.png',
         textureSecondaryPath=
         'res:/UI/Texture/classes/Monetization/Trial_Icon_NoGlow_256.png',
         spriteEffect=trinity.TR2_SFX_MODULATE,
         blendMode=trinity.TR2_SBM_ADDX2,
         left=-20,
         width=200,
         height=200,
         tileX=True,
         tileY=True)
     self.iconGlare2 = Sprite(
         parent=mainCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Monetization/glare_256_2.png',
         textureSecondaryPath=
         'res:/UI/Texture/classes/Monetization/Trial_Icon_NoGlow_256.png',
         spriteEffect=trinity.TR2_SFX_MODULATE,
         left=-20,
         width=200,
         height=200,
         tileX=True,
         tileY=True)
     buttonCont = FlowContainer(parent=bodyCont,
                                align=uiconst.TOTOP,
                                centerContent=True,
                                contentSpacing=(4, 4),
                                padding=(8, 16, 8, 16))
     closeButton = Button(
         parent=buttonCont,
         align=uiconst.NOALIGN,
         fixedheight=26,
         label=localization.GetByLabel('UI/TrialUpsell/ButtonClose'),
         fontsize=12,
         func=lambda _: self.Close(),
         color=(0.2, 0.2, 0.2, 1.0))
     closeButton.sr.activeframe.SetFixedColor((0.6, 0.6, 0.6, 1.0))
     moreButton = Button(
         parent=buttonCont,
         align=uiconst.NOALIGN,
         fixedheight=26,
         label=localization.GetByLabel('UI/TrialUpsell/ButtonSubscribe'),
         fontsize=14,
         func=lambda _: self.OpenSubscriptionPage(),
         color=(0.8, 0.6, 0.2, 0.6))
     moreButton.sr.activeframe.SetFixedColor((0.9, 0.9, 0.9, 1.0))
     self.Animate()
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.baseColorPicker = ColorPicker(parent=self.sr.main, align=uiconst.TOTOP, label='Base Color', colorCallback=self.OnBaseColor, padding=(8, 4, 4, 20), color=sm.GetService('uiColor').GetUIColor(uiconst.COLORTYPE_UIBASE), maxValue=0.3)
     LineUnderlay(parent=self.sr.main, align=uiconst.TOTOP)
     self.hiliteColorPicker = ColorPicker(parent=self.sr.main, align=uiconst.TOTOP, label='Hilite Color', colorCallback=self.OnHiliteColor, padding=(8, 20, 4, 4), color=sm.GetService('uiColor').GetUIColor(uiconst.COLORTYPE_UIHILIGHT))
Esempio n. 9
0
 def Prepare_Appearance_(self):
     self.subpar = Container(parent=self, name='btns', state=uiconst.UI_PICKCHILDREN, align=self.subalign)
     if self.line:
         LineUnderlay(parent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, align=uiconst.TOTOP)
Esempio n. 10
0
 def ApplyAttributes(self, attributes):
     uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.iconsize = iconsize = 44
     LineUnderlay(parent=self, align=uiconst.TOBOTTOM)
     self.factionParent = uiprimitives.Container(name='factionParent',
                                                 parent=self,
                                                 align=uiconst.TOLEFT,
                                                 pos=(0, 0, 64, 64),
                                                 padding=MARGIN)
     middleCont = uiprimitives.Container(parent=self,
                                         name='middleContainer',
                                         width=MIDDLECONTAINER_WIDTH,
                                         align=uiconst.TOLEFT,
                                         padTop=MARGIN,
                                         clipChildren=True)
     self.constellationLabel = BigReportLabel(name='constellationName',
                                              parent=middleCont,
                                              fontsize=20,
                                              align=uiconst.TOTOP,
                                              state=uiconst.UI_NORMAL)
     self.statusText = SmallReportLabel(parent=middleCont,
                                        align=uiconst.TOTOP,
                                        uppercase=True)
     SmallReportLabel(name='systemInfluence',
                      parent=middleCont,
                      align=uiconst.TOTOP,
                      text=localization.GetByLabel(
                          'UI/Incursion/Common/HUDInfluenceTitle'))
     self.statusBar = uicls.SystemInfluenceBar(parent=middleCont,
                                               pos=(0, 0, 200, 10),
                                               align=uiconst.TOTOP,
                                               padding=(0, 4, 0, 4))
     self.stagingText = SmallReportLabel(parent=middleCont,
                                         align=uiconst.TOTOP,
                                         state=uiconst.UI_NORMAL)
     self.bossIcon = uicls.IncursionBossIcon(parent=middleCont,
                                             left=3,
                                             top=3,
                                             align=uiconst.TOPRIGHT,
                                             idx=0)
     btn = uix.GetBigButton(iconsize,
                            self,
                            left=self.BUTTON_OFFSET,
                            top=MARGIN,
                            align=uiconst.BOTTOMLEFT)
     btn.hint = localization.GetByLabel(
         'UI/Incursion/Journal/ShowActiveCorpMembersInMap')
     btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/corpmap.png',
                          ignoreSize=True)
     self.corpMapButton = btn
     btn = uix.GetBigButton(iconsize,
                            self,
                            left=self.BUTTON_OFFSET + 50,
                            top=MARGIN,
                            align=uiconst.BOTTOMLEFT)
     btn.hint = localization.GetByLabel(
         'UI/Incursion/Journal/ShowOnStarMap')
     btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/map.png',
                          ignoreSize=True)
     self.mapButton = btn
     btn = uix.GetBigButton(iconsize,
                            self,
                            left=self.BUTTON_OFFSET + 100,
                            top=MARGIN,
                            align=uiconst.BOTTOMLEFT)
     btn.hint = localization.GetByLabel(
         'UI/Incursion/Journal/StagingAsAutopilotDestination')
     btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/ships.png',
                          ignoreSize=True)
     self.autopilotButton = btn
     btn = uix.GetBigButton(iconsize,
                            self,
                            left=self.BUTTON_OFFSET,
                            top=MARGIN)
     btn.hint = localization.GetByLabel(
         'UI/Incursion/Journal/ViewLoyaltyPointLog')
     btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/lpstore.png',
                          ignoreSize=True)
     self.lpButton = btn
     self.loyaltyPoints = ReportNumber(
         name='loyaltyPoints',
         parent=self,
         pos=(self.BUTTON_OFFSET + 50, MARGIN, 105, iconsize),
         number=0,
         hint=localization.GetByLabel(
             'UI/Incursion/Journal/LoyaltyPointsWin'),
         padding=(4, 4, 4, 4))
Esempio n. 11
0
    def LoadSupport(self, panel, *args):
        if self.supportLoaded:
            return
        subpar = uiprimitives.Container(name='subpar',
                                        parent=panel,
                                        align=uiconst.TOALL)
        helpchannelpar = uiprimitives.Container(name='helpchannelpar',
                                                parent=subpar,
                                                align=uiconst.TOTOP)
        helpchannelpar.padTop = 4
        helpbtnparent = uiprimitives.Container(name='helpbtnparent',
                                               parent=subpar,
                                               align=uiconst.TOTOP,
                                               height=32)
        helpchannelbtn = uicontrols.Button(
            parent=helpbtnparent,
            label=localization.GetByLabel('UI/Help/JoinChannel'),
            func=self.JoinHelpChannel,
            btn_default=0,
            align=uiconst.TOPRIGHT)
        helpchannelbtn.left = 6
        helptext = uicontrols.EveLabelMedium(
            name='label',
            text=localization.GetByLabel('UI/Help/JoinChannelHint'),
            parent=helpchannelpar,
            align=uiconst.TOPLEFT,
            pos=(8, 4, 280, 0),
            state=uiconst.UI_NORMAL)
        helpchannelpar.height = helptext.textheight
        helpbtnparent.height = helpchannelbtn.height + 4
        LineUnderlay(parent=subpar, align=uiconst.TOTOP)
        petpar = uiprimitives.Container(name='petitionpar',
                                        parent=subpar,
                                        align=uiconst.TOTOP,
                                        height=60)
        petpar.padTop = 4
        petbtnparent = uiprimitives.Container(name='petbtnparent',
                                              parent=subpar,
                                              align=uiconst.TOTOP,
                                              height=32)
        petbtn = uicontrols.Button(
            parent=petbtnparent,
            label=localization.GetByLabel('UI/Help/FilePetition'),
            func=self.FilePetition,
            btn_default=0,
            align=uiconst.TOPRIGHT)
        petbtn.left = 6
        petbtnparent.height = petbtn.height + 4
        try:
            if sm.RemoteSvc('petitioner').IsZenDeskEnabled(
            ) and eve.session.languageID.lower() == 'en':
                hdbtn = uicontrols.Button(
                    parent=petbtnparent,
                    label=localization.GetByLabel('UI/Help/OpenHelpCenter'),
                    func=self.OpenHelpCenter,
                    btn_default=0,
                    align=uiconst.TOPRIGHT)
                hdbtn.left = 6
                petbtnparent.height += hdbtn.height + 4
                hdbtn.top = petbtn.height + 4
        except Exception:
            pass

        pettext = uicontrols.EveLabelMedium(
            name='label',
            text=localization.GetByLabel('UI/Help/OpenPetitions'),
            parent=petpar,
            align=uiconst.TOPLEFT,
            pos=(8, 4, 280, 0),
            state=uiconst.UI_NORMAL)
        petpar.height = pettext.textheight
        LineUnderlay(parent=subpar, align=uiconst.TOTOP)
        kbpar = uiprimitives.Container(name='kbpar',
                                       parent=subpar,
                                       align=uiconst.TOTOP,
                                       height=60)
        kbpar.padTop = 4
        kbbtnparent = uiprimitives.Container(name='kbbtnparent',
                                             parent=subpar,
                                             align=uiconst.TOTOP,
                                             width=96)
        kbt = localization.GetByLabel('UI/Help/EvelopediaHintText')
        kbtext = uicontrols.EveLabelMedium(name='label',
                                           text=kbt,
                                           parent=kbpar,
                                           align=uiconst.TOPLEFT,
                                           pos=(8, 4, 280, 0),
                                           state=uiconst.UI_NORMAL)
        kbbtn = uicontrols.Button(
            parent=kbbtnparent,
            label=localization.GetByLabel('UI/Help/SearchEvelopedia'),
            func=self.SearchKB,
            pos=(6, 0, 0, 0),
            align=uiconst.TOPRIGHT,
            btn_default=1)
        self.sr.kbsearch = uicontrols.SinglelineEdit(name='kbsearch',
                                                     parent=kbbtnparent,
                                                     pos=(kbbtn.width + 14, 0,
                                                          195, 0),
                                                     align=uiconst.TOPRIGHT)
        kbpar.height = kbtext.textheight
        kbbtnparent.height = max(kbbtn.height, self.sr.kbsearch.height) + 8
        LineUnderlay(parent=subpar, align=uiconst.TOTOP)
        funnelpar = uiprimitives.Container(name='funnelpar',
                                           parent=subpar,
                                           align=uiconst.TOTOP,
                                           height=60)
        funnelpar.padTop = 4
        funnelbtnparent = uiprimitives.Container(name='funnelbtnparent',
                                                 parent=subpar,
                                                 align=uiconst.TOTOP,
                                                 width=96,
                                                 height=32)
        funnelbt = localization.GetByLabel('UI/Help/CareerAdvancementFull')
        funneltext = uicontrols.EveLabelMedium(name='label',
                                               text=funnelbt,
                                               parent=funnelpar,
                                               align=uiconst.TOPLEFT,
                                               pos=(8, 4, 280, 0),
                                               state=uiconst.UI_NORMAL)
        uicontrols.Button(
            parent=funnelbtnparent,
            label=localization.GetByLabel('UI/Help/ShowCareerAgents'),
            func=self.ShowTutorialAgents,
            args=('support', ),
            pos=(6, 0, 0, 0),
            align=uiconst.TOPRIGHT)
        helpchannelpar.height = helptext.textheight + helptext.top * 2 + 6
        petpar.height = pettext.textheight + pettext.top * 2 + 6
        kbpar.height = kbtext.textheight + kbtext.top * 2 + 6
        funnelpar.height = funneltext.textheight + funneltext.top * 2 + 6
        if int(
                sm.GetService('machoNet').GetGlobalConfig().get(
                    'bugReporting_ShowButton', 0)) > 0:
            LineUnderlay(parent=subpar, align=uiconst.TOTOP)
            bugreportpar = uiprimitives.Container(name='bugreportpar',
                                                  parent=subpar,
                                                  align=uiconst.TOTOP,
                                                  height=60)
            bugreportpar.padTop = 4
            bugreportbtnparent = uiprimitives.Container(
                name='bugreportbtnparent',
                parent=subpar,
                align=uiconst.TOTOP,
                width=96,
                height=32)
            bugreportbt = localization.GetByLabel('UI/Help/ReportBugFull')
            bugreporttext = uicontrols.EveLabelMedium(name='label',
                                                      text=bugreportbt,
                                                      parent=bugreportpar,
                                                      align=uiconst.TOPLEFT,
                                                      pos=(8, 4, 280, 0),
                                                      state=uiconst.UI_NORMAL)
            uicontrols.Button(
                parent=bugreportbtnparent,
                label=localization.GetByLabel('UI/Help/ReportBug'),
                func=self.CreateBugReport,
                pos=(6, -2, 0, 0),
                align=uiconst.TOPRIGHT)
            helpchannelpar.height = helptext.textheight + helptext.top * 2 + 6
            petpar.height = pettext.textheight + pettext.top * 2 + 6
            kbpar.height = kbtext.textheight + kbtext.top * 2 + 6
            bugreportpar.height = bugreporttext.textheight + bugreporttext.top * 2 + 6
        totalHeight = 0
        for container in subpar.children:
            if container.align == uiconst.TOTOP:
                totalHeight += container.height

        need = self.sr.topParent.height + self.sr.headerParent.height + totalHeight + 40
        self.SetMinSize([self.minsize[0], need])
        BumpedUnderlay(bgParent=panel)
        uicore.registry.SetFocus(self.sr.kbsearch)
        self.supportLoaded = True
Esempio n. 12
0
 def ApplyAttributes(self, attributes):
     padding = attributes.padding or 0
     attributes.height = 1 + padding * 2
     Container.ApplyAttributes(self, attributes)
     LineUnderlay(parent=self, align=uiconst.TOTOP, padTop=padding, padLeft=1, padRight=1, opacity=OPACITY_LINES)
Esempio n. 13
0
    def GetMap(self, ids, idlevel, drawlevel, selected = None):
        if getattr(self, 'loadingMap', 0):
            return
        self.loadingMap = 1
        uiutil.FlushList(self.children[idlevel:])
        self.ids[idlevel] = ids
        cfg.evelocations.Prime(ids)
        l, t, absWidth, absHeight = self.GetAbsolute()
        pilmap = xtriui.Map2D(name='map', align=uiconst.TOTOP, state=uiconst.UI_NORMAL, height=absWidth)
        pilmap.OnSelectItem = self.OnMapSelection
        pilmap.GetParentMenu = self.GetMenu
        pilmapList = []
        basesize = self.absoluteRight - self.absoluteLeft
        if drawlevel == DRAWLVLSYS:
            pilmap.width = pilmap.height = basesize
            pilmap.left = pilmap.top = (pilmap.width - basesize) / 2
            pilmap.align = uiconst.RELATIVE
            pilmap.dragAllowed = 1
            mapparent = uiprimitives.Container(name='mapparent', align=uiconst.TOTOP, lockAspect=1, parent=self, clipChildren=1, height=absWidth)
            LineUnderlay(parent=mapparent, align=uiconst.TOBOTTOM)
            pilmapList = mapparent.children
            self.SetLoadExternalPointer(mapparent, self.ids[idlevel][0])
            addstuff = mapparent
        else:
            LineUnderlay(parent=pilmap.overlays, align=uiconst.TOBOTTOM)
            pilmapList = self.children
            self.SetLoadExternalPointer(pilmap, self.ids[idlevel][0])
            addstuff = pilmap.overlays
        pilmap.Draw(ids, idlevel, drawlevel, basesize)
        uicore.animations.FadeIn(pilmap, duration=0.3)
        pilmapList.append(pilmap)
        listicon = xtriui.ListSurroundingsBtn(parent=addstuff, align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL, pos=(0, 3, 16, 16), idx=0, showIcon=True)
        locConsts = {0: {const.typeUniverse: ''},
         1: {const.typeRegion: localization.GetByLabel('UI/Common/LocationTypes/Region')},
         2: {const.typeConstellation: localization.GetByLabel('UI/Common/LocationTypes/Constellation')},
         3: {const.typeSolarSystem: localization.GetByLabel('UI/Common/LocationTypes/SolarSystem')}}
        levelName = locConsts.get(idlevel, '').values()[0]
        levelID = locConsts.get(idlevel, '').keys()[0]
        for id in ids:
            if levelID != const.typeUniverse:
                locName = cfg.evelocations.Get(id).name

        hintStr = ''
        buttonStr = ''
        if levelID == const.typeUniverse:
            buttonStr = localization.GetByLabel('UI/Common/LocationTypes/Universe')
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListRegions')
        elif levelID == const.typeRegion:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameRegion', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListConstellations', name=locName)
        elif levelID == const.typeConstellation:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameConstellation', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListSolarSystems', name=locName)
        elif levelID == const.typeSolarSystem:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameSolarSystem', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListCelestials', name=locName)
        listbtn = uicontrols.EveLabelMedium(text=buttonStr, parent=addstuff, left=listicon.left + listicon.width + 4, top=5, color=(1.0, 1.0, 1.0, 0.75), idx=0, state=uiconst.UI_NORMAL)
        listbtn.expandOnLeft = True
        listbtn.GetMenu = listicon.GetMenu
        for id in ids:
            if id != const.typeUniverse:
                listicon.sr.typeID = listbtn.sr.typeID = levelID
                listicon.sr.itemID = listbtn.sr.itemID = id

        listbtn.sr.hint = hintStr
        if self.destroyed:
            return
        if drawlevel == DRAWLVLSYS:
            listbtn.sr.groupByType = listicon.sr.groupByType = 1
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems
        elif drawlevel in (DRAWLVLCON, DRAWLVLSOL):
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems[1:]
        else:
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems
        listbtn.solarsystemid = listicon.solarsystemid = ids[0]
        if selected:
            pilmap.SetSelected([selected])
        self.Refresh()
        self.loadingMap = 0