def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes=attributes)
     self.isDeveloperMode = attributes.get('developerMode', True)
     self.basePadLeft = 5
     self.dev_simpleHistoryDisplayEnabled = False
     self.dev_historySettingsEnabled = True
     self.dev_exportNotificationHistoryEnabled = False
     self.dev_clearNotificationHistoryEnabled = False
     self.dev_soundSettingsEnabled = True
     parentwidth = attributes.get('parentwidth')
     self.lastVerticalBarEnabledStatus = False
     self.entryCache = {}
     self.leftContainer = NotificationSettingList(
         name='LeftContainer',
         align=uiconst.TOLEFT,
         width=parentwidth / 2,
         padding=4,
         parent=self,
         developerMode=self.isDeveloperMode)
     self.rightContainer = Container(name='RightContainer',
                                     align=uiconst.TOALL,
                                     padding=(0, 4, 4, 4),
                                     parent=self)
     BumpedUnderlay(name='leftUnderlay', bgParent=self.leftContainer)
     BumpedUnderlay(name='rightUnderlay', bgParent=self.rightContainer)
     self.notificationSettingHandler = NotificationSettingHandler()
     self.notificationSettingData = self.notificationSettingHandler.LoadSettings(
     )
     self._SetupRightSide()
     self.leftContainer.PopulateScroll()
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     pushContent = attributes.pushContent or self.pushContent
     showUnderlay = attributes.Get('showUnderlay',
                                   self.default_showUnderlay)
     self.scrollbarsDisabled = False
     self.scrollToVerticalPending = None
     self.scrollToHorizontalPending = None
     self.noContentHint = None
     self.verticalScrollBar = ScrollBar(
         parent=self,
         align=uiconst.TORIGHT if pushContent else uiconst.TORIGHT_NOPUSH)
     self.verticalScrollBar.OnScrolled = self._OnVerticalScrollBar
     self.horizontalScrollBar = ScrollBar(
         parent=self,
         align=uiconst.TOBOTTOM if pushContent else uiconst.TOBOTTOM_NOPUSH)
     self.horizontalScrollBar.OnScrolled = self._OnHorizontalScrollBar
     self.clipCont = Container(name='clipCont',
                               parent=self,
                               clipChildren=True)
     self.mainCont = ContainerAutoSize(name='mainCont',
                                       parent=self.clipCont,
                                       state=uiconst.UI_NORMAL)
     self.mainCont._OnSizeChange_NoBlock = self._OnMainContSizeChange
     self.children.insert = self._InsertChild
     self.children.append = self._AppendChild
     self.children.remove = self._RemoveChild
     self._mouseHoverCookie = uicore.uilib.RegisterForTriuiEvents(
         uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
     if showUnderlay:
         self.underlay = BumpedUnderlay(bgParent=self)
     else:
         self.underlay = None
Beispiel #3
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)
Beispiel #4
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)
Beispiel #5
0
 def BuildNameCont(self):
     padding = 6
     BumpedUnderlay(bgParent=self.nameCont)
     profileCont = Container(parent=self.nameCont,
                             align=uiconst.TORIGHT,
                             left=padding)
     self.profileCombo = Combo(
         label=GetByLabel('UI/Structures/Deployment/ProfileComboLabel'),
         parent=profileCont,
         options=self._GetProfileOptions(),
         name='profileCombo',
         width=100,
         align=uiconst.BOTTOMRIGHT,
         top=padding)
     profileCont.width = self.profileCombo.width
     nameText = GetByLabel('UI/Structures/Deployment/StructureName')
     self.ssPrefix = '%s - ' % CleanImportantMarkup(
         cfg.evelocations.Get(session.solarsystemid).locationName)
     self.nameEdit = PrefixedSingleLineEdit(
         name='nameEdit',
         parent=self.nameCont,
         maxLength=32 + len(self.ssPrefix),
         align=uiconst.TOBOTTOM,
         padLeft=padding,
         padRight=30,
         top=padding,
         label=nameText,
         prefix=self.ssPrefix,
         OnChange=self.nameChangedCallback)
     profileHeight = self.profileCombo.height - self.profileCombo.sr.label.top
     nameHeight = self.nameEdit.height - self.nameEdit.sr.label.top
     newHeight = max(profileHeight, nameHeight) + 2 * padding
     self.nameCont.height = newHeight
Beispiel #6
0
 def AddColumn(self, columnWidth, name='column'):
     column = uiprimitives.Container(name=name,
                                     align=uiconst.TOLEFT,
                                     width=columnWidth,
                                     padLeft=8,
                                     parent=self.parent)
     column.isTabOrderGroup = 1
     BumpedUnderlay(isInFocus=True, parent=column)
     return column
Beispiel #7
0
 def Prepare_(self):
     self.sr.text = Label(name='edittext',
                          parent=self._textClipper,
                          left=self.TEXTLEFTMARGIN,
                          state=uiconst.UI_DISABLED,
                          maxLines=1,
                          align=uiconst.CENTERLEFT,
                          fontsize=self.fontsize)
     self.sr.hinttext = Label(parent=self._textClipper,
                              name='hinttext',
                              align=uiconst.CENTERLEFT,
                              state=uiconst.UI_DISABLED,
                              maxLines=1,
                              left=self.TEXTLEFTMARGIN,
                              fontsize=self.fontsize)
     self.sr.background = BumpedUnderlay(bgParent=self, showFill=True)
Beispiel #8
0
    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.barWidth = attributes.get('barWidth', self.default_barWidth)
        self.duration = attributes.get('duration', self.default_duration)
        self.pauseTime = attributes.get('pauseTime', self.default_pauseTime)
        w, _ = self.GetAbsoluteSize()
        self.bars = []
        for i in xrange(w / self.barWidth + 1):
            bar = Bar(align=uiconst.TOLEFT,
                      parent=self,
                      opacity=0.75,
                      width=self.barWidth,
                      padLeft=0)
            self.bars.append(bar)

        uthread.new(self.Animate)
        BumpedUnderlay(bgParent=self, padding=(-2, -2, -1, -1))
Beispiel #9
0
 def Prepare_OptionMenu_(self):
     ClearMenuLayer()
     menu = uiprimitives.Container(parent=uicore.layer.menu,
                                   pos=(0, 0, 200, 200),
                                   align=uiconst.RELATIVE)
     menu.sr.scroll = Scroll(parent=menu)
     menu.sr.scroll.OnKillFocus = self.OnScrollFocusLost
     menu.sr.scroll.OnSelectionChange = self.OnScrollSelectionChange
     menu.sr.scroll.Confirm = self.Confirm
     menu.sr.scroll.OnUp = self.OnUp
     menu.sr.scroll.OnDown = self.OnDown
     menu.sr.scroll.OnRight = self.Confirm
     menu.sr.scroll.OnLeft = self.Confirm
     menu.sr.scroll.sr.underlay.opacity = 0.0
     BumpedUnderlay(bgParent=menu,
                    opacity=1.0,
                    isInFocus=True,
                    isWindowActive=True)
     FillThemeColored(bgParent=menu,
                      colorType=uiconst.COLORTYPE_UIBASECONTRAST,
                      opacity=1.0)
     return (menu, menu.sr.scroll)
Beispiel #10
0
 def LoadSupport(self, panel, *args):
     if self.supportLoaded:
         return
     subpar = uiprimitives.Container(name='subpar',
                                     parent=panel,
                                     align=uiconst.TOALL)
     sumHeight = 0
     sumHeight += self._LoadSupportHelpChannel(subpar)
     LineThemeColored(parent=subpar, align=uiconst.TOTOP)
     sumHeight += self._LoadSupportPetitions(subpar) + 1
     LineThemeColored(parent=subpar, align=uiconst.TOTOP)
     sumHeight += self._LoadSupportCareer(subpar) + 1
     if int(
             sm.GetService('machoNet').GetGlobalConfig().get(
                 'bugReporting_ShowButton', 0)) > 0:
         LineThemeColored(parent=subpar, align=uiconst.TOTOP)
         sumHeight += self._LoadSupportBugReport(subpar) + 1
     self.SetMinSize([
         self.minsize[0], self.sr.topParent.height +
         self.sr.headerParent.height + sumHeight + 32
     ])
     BumpedUnderlay(bgParent=panel)
     self.supportLoaded = True
class ScrollContainer(Container):
    """ 
        A container with vertical and horizontal scrolling functionality. Children must
        all use the same alignment mode, which must be either TOPLEFT, TOLEFT or TOTOP.
        
        Note that all children appended to this container will actually end up in 
        self.mainCont, which is necessary for scrolling to work without the need for
        users to know about the existance of self.mainCont.
    """
    __guid__ = 'uicls.ScrollContainer'
    default_name = 'scrollContainer'
    default_state = uiconst.UI_NORMAL
    dragHoverScrollAreaSize = 30
    dragHoverScrollSpeed = 60.0
    default_showUnderlay = False
    isTabStop = True
    pushContent = True

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        pushContent = attributes.pushContent or self.pushContent
        showUnderlay = attributes.Get('showUnderlay',
                                      self.default_showUnderlay)
        self.scrollbarsDisabled = False
        self.scrollToVerticalPending = None
        self.scrollToHorizontalPending = None
        self.noContentHint = None
        self.verticalScrollBar = ScrollBar(
            parent=self,
            align=uiconst.TORIGHT if pushContent else uiconst.TORIGHT_NOPUSH)
        self.verticalScrollBar.OnScrolled = self._OnVerticalScrollBar
        self.horizontalScrollBar = ScrollBar(
            parent=self,
            align=uiconst.TOBOTTOM if pushContent else uiconst.TOBOTTOM_NOPUSH)
        self.horizontalScrollBar.OnScrolled = self._OnHorizontalScrollBar
        self.clipCont = Container(name='clipCont',
                                  parent=self,
                                  clipChildren=True)
        self.mainCont = ContainerAutoSize(name='mainCont',
                                          parent=self.clipCont,
                                          state=uiconst.UI_NORMAL)
        self.mainCont._OnSizeChange_NoBlock = self._OnMainContSizeChange
        self.children.insert = self._InsertChild
        self.children.append = self._AppendChild
        self.children.remove = self._RemoveChild
        self._mouseHoverCookie = uicore.uilib.RegisterForTriuiEvents(
            uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
        if showUnderlay:
            self.underlay = BumpedUnderlay(bgParent=self)
        else:
            self.underlay = None

    def Close(self, *args):
        uicore.uilib.UnregisterForTriuiEvents(self._mouseHoverCookie)
        Container.Close(self, *args)

    def _InsertChild(self, idx, obj):
        self.mainCont.children.insert(idx, obj)
        self.mainCont.align = obj.align

    def _AppendChild(self, obj):
        self.mainCont.children.append(obj)
        self.mainCont.align = obj.align

    def _RemoveChild(self, obj):
        self.mainCont.children.remove(obj)

    def OnGlobalMouseHover(self, obj, *args):
        """ Scroll when drag-hovering over top or bottom parts of scroll """
        if uicore.IsDragging() and (obj == self or obj.IsUnder(self.mainCont)):
            l, t, w, h = self.GetAbsolute()
            if self.verticalScrollBar.display and h > 0:
                fraction = self.dragHoverScrollSpeed / float(h)
                y = uicore.uilib.y - t
                if y <= self.dragHoverScrollAreaSize:
                    self.ScrollMoveVertical(-fraction)
                    self.verticalScrollBar.AnimFade()
                elif y > h - self.dragHoverScrollAreaSize:
                    self.ScrollMoveVertical(fraction)
                    self.verticalScrollBar.AnimFade()
            if self.horizontalScrollBar.display and w > 0:
                fraction = self.dragHoverScrollSpeed / float(w)
                x = uicore.uilib.x - l
                if x <= self.dragHoverScrollAreaSize:
                    self.ScrollMoveHorizontal(-fraction)
                    self.horizontalScrollBar.AnimFade()
                elif x > w - self.dragHoverScrollAreaSize:
                    self.ScrollMoveHorizontal(fraction)
                    self.horizontalScrollBar.AnimFade()
        return True

    def _OnSizeChange_NoBlock(self, width, height):
        self._UpdateHandleSizesAndPosition(width, height, updatePos=False)

    def _OnMainContSizeChange(self, width, height):
        self._UpdateScrollbars()

    def Flush(self):
        self.mainCont.Flush()

    def DisableScrollbars(self):
        self.scrollbarsDisabled = True
        self._UpdateScrollbars()

    def EnableScrollbars(self):
        self.scrollbarsDisabled = False
        self._UpdateScrollbars()

    def _UpdateScrollbars(self):
        w, h = self.GetAbsoluteSize()
        self._UpdateHandleSizesAndPosition(w, h)

    def _UpdateHandleSizesAndPosition(self, width, height, updatePos=True):
        if self.mainCont.height > 0 and not self.scrollbarsDisabled:
            size = float(height) / self.mainCont.height
        else:
            size = 1.0
        self.verticalScrollBar.SetScrollHandleSize(size)
        if updatePos:
            denum = self.mainCont.height - height
            if denum <= 0.0:
                pos = 0.0
            else:
                pos = float(-self.mainCont.top) / denum
            self.verticalScrollBar.ScrollTo(pos)
        else:
            pos = self.verticalScrollBar.handlePos
        self._OnVerticalScrollBar(pos)
        if self.mainCont.width != 0 and not self.scrollbarsDisabled:
            size = float(width) / self.mainCont.width
        else:
            size = 1.0
        self.horizontalScrollBar.SetScrollHandleSize(size)
        if updatePos:
            denum = self.mainCont.width - width
            if denum <= 0.0:
                pos = 0.0
            else:
                pos = float(-self.mainCont.left) / denum
            self.horizontalScrollBar.ScrollTo(pos)
        else:
            pos = self.horizontalScrollBar.handlePos
        self._OnHorizontalScrollBar(pos)
        if self.horizontalScrollBar.display and self.verticalScrollBar.display:
            self.verticalScrollBar.padBottom = self.horizontalScrollBar.height
        else:
            self.verticalScrollBar.padBottom = 0

    def _OnVerticalScrollBar(self, posFraction):
        w, h = self.clipCont.GetAbsoluteSize()
        posFraction = max(0.0, min(posFraction, 1.0))
        self.mainCont.top = -posFraction * (self.mainCont.height - h)
        self.OnScrolledVertical(posFraction)

    def _OnHorizontalScrollBar(self, posFraction):
        w, h = self.clipCont.GetAbsoluteSize()
        posFraction = max(0.0, min(posFraction, 1.0))
        self.mainCont.left = -posFraction * (self.mainCont.width - w)
        self.OnScrolledHorizontal(posFraction)

    def OnScrolledHorizontal(self, posFraction):
        """ Overwriteable"""
        pass

    def OnScrolledVertical(self, posFraction):
        """ Overwriteable"""
        pass

    def ScrollToVertical(self, posFraction):
        """ Call this method to scroll the vertical scrollbar to a given position [0.0 - 1.0] """
        if self._alignmentDirty:
            self.scrollToVerticalPending = posFraction
        elif self.verticalScrollBar.display:
            self.verticalScrollBar.ScrollTo(posFraction)
            self._OnVerticalScrollBar(self.verticalScrollBar.handlePos)

    def ScrollToHorizontal(self, posFraction):
        """ Call this method to scroll the horizontal scrollbar to a given position [0.0 - 1.0] """
        if self._alignmentDirty:
            self.scrollToHorizontalPending = posFraction
        elif self.horizontalScrollBar.display:
            self.horizontalScrollBar.ScrollTo(posFraction)
            self._OnHorizontalScrollBar(self.horizontalScrollBar.handlePos)

    def GetPositionVertical(self):
        return self.verticalScrollBar.handlePos

    def GetPositionHorizontal(self):
        return self.horizontalScrollBar.handlePos

    def UpdateAlignment(self, *args, **kwds):
        ret = Container.UpdateAlignment(self, *args, **kwds)
        if self.scrollToVerticalPending:
            self.verticalScrollBar.ScrollTo(self.scrollToVerticalPending)
            self._OnVerticalScrollBar(self.verticalScrollBar.handlePos)
        self.scrollToVerticalPending = None
        if self.scrollToHorizontalPending:
            self.horizontalScrollBar.ScrollTo(self.scrollToHorizontalPending)
            self._OnHorizontalScrollBar(self.horizontalScrollBar.handlePos)
        self.scrollToHorizontalPending = None
        return ret

    def ScrollMoveVertical(self, moveFraction):
        """ Move the vertical scrollbar by an arbitrary negative or positive float value """
        self.verticalScrollBar.ScrollMove(moveFraction)
        self._OnVerticalScrollBar(self.verticalScrollBar.handlePos)

    def ScrollMoveHorizontal(self, moveFraction):
        """ Move the horizontal scrollbar by a given arbitrary negative or positive float value """
        self.horizontalScrollBar.ScrollMove(moveFraction)
        self._OnHorizontalScrollBar(self.horizontalScrollBar.handlePos)

    def OnMouseWheel(self, dz):
        if self.verticalScrollBar.display:
            prop = -dz / float(self.mainCont.height)
            if math.fabs(prop) < 0.1:
                prop = math.copysign(0.1, prop)
            self.ScrollMoveVertical(prop)
            self.verticalScrollBar.AnimFade()
        elif self.horizontalScrollBar.display:
            prop = -dz / float(self.mainCont.width)
            if math.fabs(prop) < 0.1:
                prop = math.copysign(0.1, prop)
            self.ScrollMoveHorizontal(prop)
            self.horizontalScrollBar.AnimFade()

    def OnKeyDown(self, key, flag):
        if key == uiconst.VK_PRIOR:
            self.ScrollByPage(up=True)
        elif key == uiconst.VK_NEXT:
            self.ScrollByPage(up=False)

    def ScrollByPage(self, up=True):
        if not self.verticalScrollBar.display:
            return
        w, h = self.clipCont.GetAbsoluteSize()
        if up:
            mainContTopNewTop = self.mainCont.top + h
            mainContTopNewTop = min(0, mainContTopNewTop)
        else:
            mainContTopNewTop = self.mainCont.top - h
            mainContTopNewTop = max(h - self.mainCont.height,
                                    mainContTopNewTop)
        self.mainCont.top = mainContTopNewTop
        self._UpdateScrollbars()
        self.verticalScrollBar.AnimFade()

    def ShowNoContentHint(self, text):
        """ Show a hint that explains why the scroll container is empty """
        self.noContentHint = Label(parent=self,
                                   align=uiconst.TOTOP,
                                   padding=(16, 32, 16, 0),
                                   text=text,
                                   fontsize=20,
                                   uppercase=True,
                                   letterspace=1)

    def HideNoContentHint(self):
        if self.noContentHint:
            self.noContentHint.Close()
            self.noContentHint = None

    def OnSetFocus(self, *args):
        if self.underlay:
            self.underlay.AnimEntry()

    def OnKillFocus(self, *args):
        if self.underlay:
            self.underlay.AnimExit()
Beispiel #12
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
Beispiel #13
0
 def Prepare_Underlay_(self):
     self.sr.underlay = BumpedUnderlay(parent=self, name='background')