示例#1
0
 def Startup(self, *args):
     self.sr.label = uicls.EveLabelMedium(text='',
                                          parent=self,
                                          left=5,
                                          state=uiconst.UI_DISABLED,
                                          maxLines=1)
     self.sr.line = uicls.Line(parent=self, align=uiconst.TOBOTTOM)
     self.sr.selection = uicls.Fill(parent=self,
                                    padTop=1,
                                    padBottom=1,
                                    color=(1.0, 1.0, 1.0, 0.25))
     self.sr.selection.state = uiconst.UI_HIDDEN
     self.sr.hilite = uicls.Fill(parent=self,
                                 padTop=1,
                                 padBottom=1,
                                 color=(1.0, 1.0, 1.0, 0.25))
     self.sr.infoicon = uicls.InfoIcon(size=16,
                                       left=0,
                                       top=2,
                                       parent=self,
                                       idx=0,
                                       align=uiconst.TOPRIGHT)
     self.sr.infoicon.OnClick = self.ShowInfo
     self.sr.icon = uicls.Container(parent=self,
                                    width=24,
                                    height=24,
                                    left=2,
                                    top=1,
                                    align=uiconst.TOPLEFT)
     self.sr.events = ('OnClick', 'OnMouseDown', 'OnMouseUp', 'OnDblClick',
                       'OnMouseHover')
     for eventName in self.sr.events:
         setattr(self.sr, eventName, None)
示例#2
0
    def DrawRightSide(self):
        self.sr.rightside = uicls.Container(name='rightside', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        a = uicls.Container(name='push', parent=self.sr.rightside, align=uiconst.TOTOP, height=6)
        self.sr.rightBottomPanel = uicls.Container(name='rightBottomPanel', parent=self.sr.rightside, align=uiconst.TOBOTTOM, height=26)
        self.sr.rightMainPanel = uicls.Container(name='rightMainPanel', parent=self.sr.rightside, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        topParent = uicls.Container(parent=self.sr.rightMainPanel, align=uiconst.TOTOP, height=80)
        topLeftParent = uicls.Container(parent=topParent, align=uiconst.TOLEFT, width=70)
        topRightParent = uicls.Container(parent=topParent, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        bottomParent = uicls.Container(parent=self.sr.rightMainPanel, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOTOP, height=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOBOTTOM, height=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOLEFT, width=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TORIGHT, width=const.defaultPadding)
        uicls.Frame(parent=bottomParent)
        self.sr.shipIcon = uicls.Icon(parent=topParent, state=uiconst.UI_HIDDEN, size=64, left=const.defaultPadding, ignoreSize=True)
        self.sr.techicon = uicls.Sprite(name='techIcon', parent=topParent, align=uiconst.RELATIVE, left=const.defaultPadding, width=16, height=16, idx=0)
        self.sr.dragIcon = dragIcon = xtriui.FittingDraggableIcon(name='theicon', align=uiconst.TOPLEFT, parent=topParent, height=64, width=64, top=const.defaultPadding, left=const.defaultPadding)
        dragIcon.Startup(self.fitting)
        dragIcon.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/FittingIconHint')
        dragIcon.OnClick = self.ClickDragIcon
        dragIcon.state = uiconst.UI_NORMAL
        fittingNameContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        self.sr.fittingName = uicls.SinglelineEdit(name='fittingName', parent=fittingNameContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding,
         1,
         120,
         0), maxLength=40)
        shipInfoContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        self.sr.shipTypeName = uicls.EveLabelMedium(text='', parent=shipInfoContainer, align=uiconst.RELATIVE, state=uiconst.UI_NORMAL, left=const.defaultPadding)
        self.sr.infoicon = uicls.InfoIcon(parent=shipInfoContainer, size=16, left=1, top=0, idx=0, state=uiconst.UI_HIDDEN)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.sr.radioButton = uicls.Container(name='', parent=topRightParent, align=uiconst.TOPLEFT, height=50, width=100, top=fittingNameContainer.height + shipInfoContainer.height)
        radioBtns = []
        for cfgname, value, label, checked, group in [['fittingNone',
          session.charid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Personal'),
          self.ownerID == None,
          'ownership'], ['fittingOwnerCorporation',
          session.corpid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Corporation'),
          self.ownerID == session.corpid,
          'ownership']]:
            radioBtns.append(uicls.Checkbox(text=label, parent=self.sr.radioButton, configName=cfgname, retval=value, checked=checked, groupname=group, callback=None))

        self.sr.radioButtons = radioBtns
        self.sr.fittingDescription = uicls.EditPlainText(setvalue=None, parent=bottomParent, align=uiconst.TOALL, maxLength=400)
        self.sr.fittingInfo = uicls.Scroll(name='fittingInfoScroll', parent=bottomParent)
        tabs = [[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fittings'),
          self.sr.fittingInfo,
          self,
          None,
          self.sr.fittingInfo], [localization.GetByLabel('UI/Common/Description'),
          self.sr.fittingDescription,
          self,
          None,
          self.sr.fittingDescription]]
        self.fittingInfoTab = uicls.TabGroup(name='tabparent', parent=bottomParent, idx=0)
        self.fittingInfoTab.Startup(tabs, 'fittingInfoTab')
        self.sr.fittingInfo.Startup()
        self.sr.saveDeleteButtons = uicls.ButtonGroup(btns=[[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fit'), self.Fit, ()], [localization.GetByLabel('UI/Common/Buttons/Save'), self.Save, ()], [localization.GetByLabel('UI/Common/Buttons/Delete'), self.Delete, ()]], parent=self.sr.rightBottomPanel, idx=0)
示例#3
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     pad = self.pad = 3
     self.main = uicls.Container(parent=self,
                                 name='main',
                                 pos=(0, 0, 0, 0),
                                 padding=(pad, pad, pad, pad),
                                 state=uiconst.UI_PICKCHILDREN,
                                 align=uiconst.TOALL)
     self.sr.underlay = uicls.WindowUnderlay(parent=self)
     self.sr.underlay.state = uiconst.UI_DISABLED
     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 = ''
     self.header = self._DrawAlignTopCont(18, 'headerCont')
     self.closeBtn = uicls.Icon(name='close',
                                icon='ui_38_16_220',
                                parent=self.header,
                                pos=(0, 0, 16, 16),
                                align=uiconst.TOPRIGHT)
     self.closeBtn.OnClick = self.CloseByUser
     self.infoicon = uicls.InfoIcon(typeID=self.pin.typeID,
                                    size=16,
                                    parent=self.header,
                                    align=uiconst.CENTERLEFT,
                                    top=-1)
     self._DrawHorizLine()
     self.infoContRightColAt = 160
     self.infoContPad = 5
     self.infoCont = self._GetInfoCont()
     self._UpdateInfoCont()
     self._DrawHorizLine()
     self.buttonCont = self._DrawAlignTopCont(40, 'buttonCont')
     self._DrawHorizLine()
     self.buttonTextCont = self._DrawAlignTopCont(22, 'buttonTextCont')
     self.buttonText = uicls.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 = self._DrawAlignTopCont(0,
                                              'actionCont',
                                              padding=(3, 0, 3, 3))
     captionTxt = self._GetPinName()
     caption = uicls.EveLabelSmall(parent=self.header,
                                   text=captionTxt,
                                   state=uiconst.UI_DISABLED)
     caption.left = 20
     caption.top = 2
     dw = uicore.desktop.width
     dh = uicore.desktop.height
     self.default_height = self.header.height + self.infoCont.height + self.infoContPad * 2 + self.buttonCont.height + self.actionCont.height + self.pad * 2 + self.buttonTextCont.height
     self.height = self.default_height
     self.width = self.default_width
     self.left = settings.user.ui.Get('planetContPositionX',
                                      (dw - self.width) / 2)
     self.top = settings.user.ui.Get('planetContPositionY',
                                     (dh - self.height) / 2)
     if self.left < 0:
         self.left = 0
     elif self.left > dw - self.width:
         self.left = dw - self.width
     if self.top < 0:
         self.top = 0
     elif self.top > dh - self.height:
         self.top = dh - self.height
     self.LoadActionButtons(self._GetActionButtons())
     self.uiEffects.MorphUI(self,
                            'opacity',
                            1.0,
                            time=250.0,
                            float=1,
                            newthread=1,
                            maxSteps=1000)
     self.updateInfoContTimer = base.AutoTimer(100, self._UpdateInfoCont)
     sm.GetService('audio').SendUIEvent(
         'wise:/msg_pi_pininteraction_open_play')
示例#4
0
 def Startup(self, *args):
     self.sr.main = uicls.Container(name='main',
                                    parent=self,
                                    align=uiconst.TOALL,
                                    pos=(0, 0, 0, 0),
                                    padding=(0, 0, 0, 0))
     self.sr.main.OnDropData = self.OnDropData
     uicls.Line(parent=self.sr.main, align=uiconst.TOBOTTOM)
     self.sr.icons = uicls.Container(name='icons',
                                     parent=self.sr.main,
                                     align=uiconst.TOLEFT,
                                     pos=(0, 0, 40, 0),
                                     padding=(1, 0, 2, 0))
     self.sr.textstuff = uicls.Container(name='textstuff',
                                         parent=self.sr.main,
                                         align=uiconst.TOALL,
                                         pos=(0, 0, 0, 0),
                                         padding=(0, 0, 0, 0))
     self.sr.infoIcons = uicls.Container(name='textstuff',
                                         parent=self.sr.main,
                                         align=uiconst.TORIGHT,
                                         pos=(0, 0, 20, 0),
                                         padding=(0, 0, 0, 0))
     self.sr.status = uicls.Container(name='status',
                                      parent=self.sr.icons,
                                      align=uiconst.TOLEFT,
                                      pos=(0, 0, 18, 0),
                                      padding=(0, 0, 0, 0))
     self.sr.icon = uicls.Container(name='icon',
                                    parent=self.sr.icons,
                                    align=uiconst.TOALL,
                                    pos=(0, 0, 0, 0),
                                    padding=(0, 0, 0, 0))
     self.sr.name = uicls.Container(name='name',
                                    parent=self.sr.textstuff,
                                    align=uiconst.TOTOP,
                                    pos=(0, 0, 0, 16),
                                    padding=(0, 0, 0, 0))
     self.sr.level = uicls.Container(name='level',
                                     parent=self.sr.textstuff,
                                     align=uiconst.TOALL,
                                     pos=(0, 0, 0, 0),
                                     padding=(0, 0, 0, 0))
     self.sr.nameLabel = uicls.EveLabelMedium(text='',
                                              parent=self.sr.name,
                                              align=uiconst.TOPLEFT,
                                              state=uiconst.UI_DISABLED,
                                              maxLines=1)
     self.sr.levelLabel = uicls.EveLabelMedium(text='',
                                               parent=self.sr.level,
                                               align=uiconst.TOPLEFT,
                                               state=uiconst.UI_DISABLED,
                                               maxLines=1)
     self.sr.selection = uicls.Fill(parent=self,
                                    padTop=1,
                                    padBottom=1,
                                    color=(1.0, 1.0, 1.0, 0.25))
     self.sr.infoicon = uicls.InfoIcon(size=16,
                                       left=0,
                                       top=0,
                                       parent=self.sr.infoIcons,
                                       idx=0,
                                       align=uiconst.CENTERRIGHT,
                                       name='infoicon')
     self.sr.infoicon.OnClick = self.ShowInfo
示例#5
0
    def Draw(self):
        self.sr.main.Flush()
        uicls.Container(name='push', parent=self.sr.main, align=uiconst.TOTOP, height=6)
        topParent = uicls.Container(parent=self.sr.main, align=uiconst.TOTOP, height=80)
        topLeftParent = uicls.Container(parent=topParent, align=uiconst.TOLEFT, width=70)
        topRightParent = uicls.Container(parent=topParent, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        bottomParent = uicls.Container(parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOTOP, height=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOBOTTOM, height=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TOLEFT, width=const.defaultPadding)
        uicls.Container(name='push', parent=bottomParent, align=uiconst.TORIGHT, width=const.defaultPadding)
        self.sr.shipIcon = uicls.Icon(parent=topParent, state=uiconst.UI_HIDDEN, size=64, left=const.defaultPadding, typeID=self.fitting.shipTypeID, ignoreSize=True)
        self.sr.techicon = uicls.Sprite(name='techIcon', parent=topParent, align=uiconst.RELATIVE, left=const.defaultPadding, width=16, height=16, idx=0)
        uix.GetTechLevelIcon(self.sr.techicon, 0, self.fitting.shipTypeID)
        dragIcon = xtriui.FittingDraggableIcon(name='theicon', align=uiconst.TOPLEFT, parent=topParent, height=64, width=64, top=const.defaultPadding, left=const.defaultPadding)
        dragIcon.Startup(self.fitting)
        dragIcon.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/FittingIconHint')
        dragIcon.OnClick = self.ClickDragIcon
        dragIcon.state = uiconst.UI_NORMAL
        self.sr.shipIcon.state = uiconst.UI_DISABLED
        fittingNameContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        self.sr.fittingName = uicls.SinglelineEdit(name='fittingName', parent=fittingNameContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding,
         1,
         160,
         0), maxLength=40)
        self.sr.fittingName.SetText(self.fitting.name)
        if self.truncated:
            uicls.EveLabelMedium(text=localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Truncated'), parent=fittingNameContainer, left=self.sr.fittingName.width + 10, top=3, width=60, height=20, state=uiconst.UI_NORMAL)
        shipInfoContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        shipName = cfg.invtypes.Get(self.fitting.shipTypeID).typeName
        self.sr.shipName = uicls.EveLabelMedium(text=shipName, parent=shipInfoContainer, align=uiconst.RELATIVE, state=uiconst.UI_NORMAL, left=const.defaultPadding)
        self.sr.infoicon = uicls.InfoIcon(parent=shipInfoContainer, size=16, left=1, top=0, idx=0)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.sr.infoicon.left = self.sr.shipName.textwidth + 6
        self.sr.radioButton = uicls.Container(name='', parent=topRightParent, align=uiconst.TOPLEFT, height=50, width=100, top=fittingNameContainer.height + shipInfoContainer.height)
        radioBtns = []
        for cfgname, value, label, checked, group in [['fittingNone',
          session.charid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Personal'),
          True,
          'ownership'], ['fittingOwnerCorporation',
          session.corpid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Corporation'),
          False,
          'ownership']]:
            radioBtns.append(uicls.Checkbox(text=label, parent=self.sr.radioButton, configName=cfgname, retval=value, checked=checked, groupname=group, callback=None))

        self.sr.radioButtons = radioBtns
        self.sr.fittingDescription = uicls.EditPlainText(parent=bottomParent, align=uiconst.TOALL, maxLength=400)
        self.sr.fittingDescription.SetText(self.fitting.description)
        self.sr.fittingInfo = uicls.Scroll(name='fittingInfoScroll', parent=bottomParent)
        scrolllist = self.fittingSvc.GetFittingInfoScrollList(self.fitting)
        self.sr.fittingInfo.Load(contentList=scrolllist)
        tabs = [[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fittings'),
          self.sr.fittingInfo,
          self,
          None,
          self.sr.fittingInfo], [localization.GetByLabel('UI/Common/Description'),
          self.sr.fittingDescription,
          self,
          None,
          self.sr.fittingDescription]]
        self.fittingInfoTab = uicls.TabGroup(name='tabparent', parent=bottomParent, idx=0)
        self.fittingInfoTab.Startup(tabs, 'fittingInfoTab')
        self.sr.saveDeleteButtons = uicls.ButtonGroup(btns=[[localization.GetByLabel('UI/Common/Buttons/Save'), self.Save, ()], [localization.GetByLabel('UI/Common/Buttons/Cancel'), self.CloseByUser, ()]], parent=self.sr.main, idx=0)
示例#6
0
    def Startup(self, *args):
        sub = uicls.Container(name='sub', parent=self)
        self.sr.inTrainingHilite = uicls.Fill(parent=self,
                                              name='inTrainingHilite',
                                              padTop=1,
                                              padBottom=1,
                                              color=self.blueColor,
                                              state=uiconst.UI_HIDDEN)
        self.sr.inTrainingHilite.SetAlpha(0.15)
        self.sr.icon = uicls.Icon(name='skillIcon',
                                  parent=sub,
                                  align=uiconst.TOPLEFT,
                                  top=2,
                                  size=32,
                                  width=32,
                                  height=32,
                                  ignoreSize=True)
        self.sr.icon.state = uiconst.UI_DISABLED
        self.sr.haveicon = uicls.Icon(name='haveIcon',
                                      parent=sub,
                                      size=16,
                                      left=20,
                                      align=uiconst.TOPRIGHT,
                                      state=uiconst.UI_HIDDEN)
        self.sr.levelParent = uicls.Container(name='levelParent',
                                              parent=sub,
                                              align=uiconst.TORIGHT,
                                              state=uiconst.UI_DISABLED,
                                              padRight=18)
        self.sr.levelHeaderParent = uicls.Container(name='levelHeaderParent',
                                                    parent=sub,
                                                    align=uiconst.TORIGHT,
                                                    state=uiconst.UI_HIDDEN)
        self.sr.levels = uicls.Container(name='levels',
                                         parent=self.sr.levelParent,
                                         align=uiconst.TOPLEFT,
                                         left=0,
                                         top=5,
                                         width=48,
                                         height=10)
        uicls.Frame(parent=self.sr.levels, color=self.whiteColor)
        for i in xrange(5):
            f = uicls.Fill(parent=self.sr.levels,
                           name='level%d' % i,
                           align=uiconst.RELATIVE,
                           color=(1.0, 1.0, 1.0, 0.5),
                           left=2 + i * 9,
                           top=2,
                           width=8,
                           height=6)
            setattr(self.sr, 'box_%s' % i, f)

        self.sr.progressbarparent = uicls.Container(name='progressbarparent',
                                                    parent=self.sr.levelParent,
                                                    align=uiconst.TOPLEFT,
                                                    left=0,
                                                    top=20,
                                                    width=48,
                                                    height=6)
        self.sr.progressBar = uicls.Fill(parent=self.sr.progressbarparent,
                                         name='progressbar',
                                         align=uiconst.RELATIVE,
                                         color=self.whiteColor,
                                         height=4,
                                         top=1,
                                         left=1,
                                         state=uiconst.UI_HIDDEN)
        uicls.Frame(parent=self.sr.progressbarparent)
        self.sr.levelHeader1 = uicls.EveLabelSmall(
            text='',
            parent=self.sr.levelHeaderParent,
            left=10,
            top=3,
            state=uiconst.UI_DISABLED,
            idx=0,
            align=uiconst.TOPRIGHT)
        self.sr.levelHeader1.name = 'levelHeader1'
        textCont = uicls.Container(name='textCont',
                                   parent=sub,
                                   align=uiconst.TOALL,
                                   padLeft=32,
                                   clipChildren=1)
        self.sr.nameLevelLabel = uicls.EveLabelMedium(
            text='',
            parent=textCont,
            left=0,
            top=0,
            state=uiconst.UI_DISABLED,
            maxLines=1)
        self.sr.nameLevelLabel.name = 'nameLevelLabel'
        self.sr.pointsLabel = uicls.EveLabelMedium(text='',
                                                   parent=textCont,
                                                   left=0,
                                                   top=16,
                                                   state=uiconst.UI_DISABLED,
                                                   maxLines=1)
        self.sr.pointsLabel.name = 'pointsLabel'
        self.sr.selection = uicls.Fill(parent=self,
                                       padTop=1,
                                       padBottom=1,
                                       color=(1.0, 1.0, 1.0, 0.25))
        self.sr.selection.name = 'selection'
        self.sr.selection.state = uiconst.UI_HIDDEN
        self.sr.timeLeftText = uicls.EveHeaderSmall(
            text='',
            parent=self.sr.levelHeaderParent,
            left=10,
            top=17,
            state=uiconst.UI_DISABLED,
            idx=0,
            align=uiconst.TOPRIGHT)
        self.sr.timeLeftText.name = 'timeLeftText'
        uicls.Line(parent=self, align=uiconst.TOBOTTOM)
        self.sr.hilite = uicls.Fill(parent=self,
                                    name='hilite',
                                    padTop=1,
                                    padBottom=1,
                                    color=(1.0, 1.0, 1.0, 0.25))
        self.sr.infoicon = uicls.InfoIcon(size=16,
                                          left=2,
                                          top=2,
                                          parent=sub,
                                          idx=0,
                                          name='infoicon',
                                          align=uiconst.TOPRIGHT)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.endOfTraining = None