示例#1
0
 def ApplyAttributes(self, attributes):
     attributes.align = uiconst.TOPLEFT
     attributes.width = 128
     attributes.height = 128
     uicls.ContainerAutoSize.ApplyAttributes(self, attributes)
     if attributes.GetUtilMenu:
         self._getMenuFunction = attributes.GetUtilMenu
     else:
         raise RuntimeError(
             'GetUtilMenu has to be provided in order to use UtilMenu')
     self.controller = attributes.controller
     self.isTopLevelWindow = True
     self.menuAlign = attributes.Get('menuAlign', self.default_menuAlign)
     self.minWidth = attributes.minWidth or 0
     uicls.Frame(bgParent=self, color=FRAMECOLOR)
     uicls.Fill(bgParent=self, color=BGCOLOR)
     uicls.Frame(bgParent=self,
                 frameConst=('ui_105_32_26', 15, 0),
                 color=(0, 0, 0, 0.25),
                 padding=(-12, -5, -12, -15))
     uicore.uilib.RegisterForTriuiEvents([uiconst.UI_MOUSEDOWN],
                                         self.OnGlobalMouseDown)
     self.ReloadMenu()
     self.AnimFadeIn()
     self.UpdateMenuPosition()
示例#2
0
    def ApplyAttributes(self, attributes):
        uicls.Container.ApplyAttributes(self, attributes)
        import ccConst
        uicore.desktop3D.depthMin = -50
        uicore.desktop3D.depthMax = 50
        uicore.layer.menu3d.depthMin = -1
        uicore.layer.menu3d.depthMax = 1
        self.depthMin = -1
        self.depthMax = 1
        for i in xrange(6):
            btn = Button(parent=self, left=20, top=i * 40 + 250)
            shadow = uicls.Frame(name='shadow',
                                 parent=self,
                                 frameConst=uiconst.FRAME_FILLED_CORNER8,
                                 align=uiconst.CENTERTOP,
                                 pos=(20, i * 40 + 254, btn.width, btn.height),
                                 depth=0.25,
                                 color=(0, 0, 0, 0.25))

        self.sr.menuParent = uicls.Container(parent=self,
                                             pos=(50, 0, 700, 500),
                                             align=uiconst.CENTERRIGHT,
                                             depthMin=1.0,
                                             depthMax=1.0)
        uicls.Frame(parent=self.sr.menuParent,
                    name='background',
                    state=uiconst.UI_DISABLED,
                    frameConst=uiconst.FRAME_FILLED_CORNER3,
                    color=(0, 0, 0, 0.25))
        uicls.Fill(parent=self)
        self._AddTarget()
示例#3
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.align = uiconst.CENTERTOP
     self.height = 32
     self.width = 300
     self.state = uiconst.UI_NORMAL
     self.depthMin = 0
     self.depthMax = 0
     self.animation = None
     self.sr.label = uicls.Label(text='SOME BUTTON',
                                 align=uiconst.CENTER,
                                 parent=self,
                                 fontsize=18,
                                 shadow=None)
     uicls.Frame(parent=self,
                 name='background',
                 state=uiconst.UI_DISABLED,
                 frameConst=uiconst.FRAME_BORDER2_CORNER6,
                 color=(1.0, 1.0, 1.0, 0.5),
                 depth=1)
     uicls.Frame(parent=self,
                 name='background',
                 state=uiconst.UI_DISABLED,
                 frameConst=uiconst.FRAME_FILLED_CORNER6,
                 color=(1.0, 1.0, 1.0, 0.25),
                 depth=1)
示例#4
0
 def Prepare_Appearance_(self):
     uicls.Line(parent=self.sr.buttonParent,
                align=uiconst.TOLEFT,
                color=(0.0, 0.0, 0.0, 0.1))
     uicls.Line(parent=self.sr.buttonParent,
                align=uiconst.TORIGHT,
                color=(0.0, 0.0, 0.0, 0.1))
     shape = uicls.Container(parent=self,
                             name='shape',
                             state=uiconst.UI_DISABLED,
                             align=uiconst.TOALL,
                             padding=(3, 3, 3, 3))
     uicls.Frame(parent=shape,
                 name='dot',
                 texturePath='res:/UI/Texture/Shared/windowButtonDOT.png',
                 cornerSize=2,
                 spriteEffect=trinity.TR2_SFX_DOT,
                 blendMode=trinity.TR2_SBM_ADD)
     uicls.Sprite(
         parent=shape,
         name='gradientFill',
         texturePath='res:/UI/Texture/Shared/windowButtonGradient.png',
         align=uiconst.TOALL,
         filter=False,
         color=(1, 1, 1, 0.8))
     uicls.Fill(name='solidFill', parent=shape, color=(0, 0, 0, 0.95))
     uicls.Frame(parent=shape,
                 padding=(-4, -4, -4, -4),
                 name='shadow',
                 texturePath='res:/UI/Texture/Shared/windowShadow.png',
                 cornerSize=9,
                 state=uiconst.UI_DISABLED,
                 color=(0.0, 0.0, 0.0, 0.5))
示例#5
0
 def Startup(self, hsv = None, *args):
     leftPush = 0
     self.SetHSV(hsv)
     hsv = self.orgcolor.GetHSV()
     colorPanel = xtriui.ColorPanel(name='ColorPanel', align=uiconst.TOPLEFT, width=255, height=255, parent=self, state=uiconst.UI_NORMAL, clipChildren=1)
     uicls.Frame(parent=colorPanel)
     colorPanel.Startup()
     colorPanel.OnChange = self.ColorPanelChange
     colorPanel.SetHSV(hsv)
     self.sr.colorPanel = colorPanel
     leftPush = colorPanel.left + colorPanel.width + const.defaultPadding
     colorSlider = xtriui.ColorSlider(name='ColorSlider', align=uiconst.TOPLEFT, left=leftPush, height=255, width=36, parent=self, state=uiconst.UI_NORMAL)
     colorSlider.Startup()
     colorSlider.OnSliderChange = self.ColorSliderChange
     colorSlider.SetHSV(hsv)
     self.sr.colorSlider = colorSlider
     leftPush = colorSlider.left + colorSlider.width + const.defaultPadding
     self.sr.colorInfo = uicls.Container(name='colorInfo', align=uiconst.TOPLEFT, left=leftPush, width=56, height=255, parent=self)
     colorPreview = xtriui.ColorPreview(name='colorPreview', align=uiconst.TOPLEFT, height=32, width=self.sr.colorInfo.width, parent=self.sr.colorInfo)
     uicls.Frame(parent=colorPreview)
     colorPreview.Startup()
     colorPreview.SetHSV(hsv)
     self.sr.colorPreview = colorPreview
     colorControl = xtriui.ColorControl(name='colorControl', align=uiconst.TOPLEFT, width=self.sr.colorInfo.width, top=36, height=219, parent=self.sr.colorInfo)
     colorControl.Startup()
     colorControl.OnColorControlChange = self.ColorControlChange
     colorControl.SetHSV(hsv)
     self.sr.colorControl = colorControl
示例#6
0
文件: buttons.py 项目: R4M80MrX/eve-1
 def Prepare_(self):
     self.sr.label = uicls.Label(parent=self,
                                 state=uiconst.UI_DISABLED,
                                 align=uiconst.CENTER,
                                 bold=1,
                                 uppercase=1,
                                 idx=0,
                                 fontFamily=self.fontFamily,
                                 fontStyle=self.fontStyle,
                                 fontPath=self.fontPath,
                                 fontsize=self.fontsize)
     self.sr.activeframe = uicls.Frame(
         parent=self,
         name='activeframe',
         state=uiconst.UI_HIDDEN,
         color=(1.0, 1.0, 1.0, 0.3),
         frameConst=uiconst.FRAME_BORDER1_SHADOW_CORNER4)
     self.sr.hilite = uicls.Fill(parent=self,
                                 name='hilite',
                                 state=uiconst.UI_HIDDEN,
                                 color=(1.0, 1.0, 1.0, 0.25),
                                 padding=(2, 2, 2, 2))
     uicls.Frame(parent=self,
                 name='background',
                 state=uiconst.UI_DISABLED,
                 frameConst=uiconst.FRAME_BORDER1_SHADOW_CORNER4,
                 color=(1.0, 1.0, 1.0, 0.5))
示例#7
0
 def ShowHistoryMenu(self, history):
     hadMenu = 0
     if self.historyMenu and self.historyMenu():
         hadMenu = 1
     self.CloseHistoryMenu()
     if not history:
         return
     l, t, w, h = self.GetAbsolute()
     mp = uicls.Container(name='historyMenuParent',
                          parent=uicore.layer.menu,
                          pos=(l, t + h + 2, w, 0),
                          align=uiconst.TOPLEFT)
     if not hadMenu:
         mp.opacity = 0.0
     uicls.Frame(parent=mp,
                 frameConst=uiconst.FRAME_BORDER1_CORNER0,
                 color=(1.0, 1.0, 1.0, 0.2))
     uicls.Frame(parent=mp,
                 frameConst=uiconst.FRAME_FILLED_CORNER0,
                 color=(0.0, 0.0, 0.0, 0.75))
     mps = uicls.Container(name='historyMenuSub', parent=mp, idx=0)
     self.PopulateHistoryMenu(mps, mp, history)
     mp.sr.entries = mps
     self.historyMenu = weakref.ref(mp)
     if not hadMenu:
         uicore.effect.MorphUI(mp, 'opacity', 1.0, 250.0, float=1)
示例#8
0
 def CheckFrames(self, underlay, wnd):
     underlayParent = getattr(underlay, 'parent', None)
     if underlayParent is None:
         return
     noBackground = getattr(underlayParent, 'noBackground', 0)
     if noBackground:
         return
     underlayFrame = underlayParent.FindChild('underlayFrame')
     underlayFill = underlayParent.FindChild('underlayFill')
     if wnd.IsPinned():
         underlay.state = uiconst.UI_HIDDEN
         if not underlayFill:
             underlayFill = uicls.Frame(name='underlayFill', color=(0.0, 0.0, 0.0, 0.3), frameConst=uiconst.FRAME_FILLED_CORNER0, parent=underlayParent)
         else:
             underlayFill.state = uiconst.UI_DISABLED
         if not underlayFrame:
             underlayFrame = uicls.Frame(name='underlayFrame', color=(1.0, 1.0, 1.0, 0.2), frameConst=uiconst.FRAME_BORDER1_CORNER0, parent=underlayParent, pos=(-1, -1, -1, -1))
         else:
             underlayFrame.state = uiconst.UI_DISABLED
     else:
         if not noBackground:
             underlay.state = uiconst.UI_DISABLED
         if underlayFrame:
             underlayFrame.state = uiconst.UI_HIDDEN
         if underlayFill:
             underlayFill.state = uiconst.UI_HIDDEN
示例#9
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.btnData = attributes.btnData
     self.btnNum = attributes.btnNum
     self.width = attributes.width
     self._isDraggable = attributes.get('isDraggable',
                                        self.default_isDraggable)
     self._openNeocomPanel = None
     self.height = self.width
     self.top = self.height * self.btnNum
     self.panel = None
     self.blinkThread = None
     self.realTop = self.top
     self.dragEventCookie = None
     self.disableClick = False
     self.iconSize = self.height - 2 * self.PADVERTICAL
     self.iconTransform = uicls.Transform(name='iconTransform',
                                          parent=self,
                                          align=uiconst.TOALL,
                                          scalingCenter=(0.5, 0.5))
     self.iconLabelCont = None
     self.icon = uicls.Sprite(parent=self.iconTransform,
                              name='icon',
                              state=uiconst.UI_DISABLED,
                              align=uiconst.CENTER,
                              width=self.iconSize,
                              height=self.iconSize)
     self.UpdateIcon()
     PAD = 1
     self.mouseHoverFrame = uicls.Sprite(
         bgParent=self,
         name='mouseHoverFrame',
         texturePath='res:/UI/Texture/classes/Neocom/buttonHover.png',
         state=uiconst.UI_HIDDEN)
     self.blinkSprite = uicls.Sprite(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
         state=uiconst.UI_HIDDEN)
     self.mouseDownFrame = uicls.Frame(
         bgParent=self,
         name='mosueDownFrame',
         texturePath='res:/UI/Texture/classes/Neocom/buttonDown.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN)
     self.activeFrame = uicls.Frame(
         bgParent=self,
         name='hoverFill',
         texturePath='res:/UI/Texture/classes/Neocom/buttonActive.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN)
     self.CheckIfActive()
     self.dropFrame = uicls.Frame(parent=self,
                                  name='hoverFrame',
                                  color=util.Color.GetGrayRGBA(1.0, 0.5),
                                  state=uiconst.UI_HIDDEN)
     sm.RegisterNotify(self)
示例#10
0
 def Prepare_(self, text='', contactLevel=None, *args):
     self.isTabStop = 1
     self.state = uiconst.UI_NORMAL
     flag = None
     iconNum = 0
     if contactLevel == const.contactHighStanding:
         flag = state.flagStandingHigh
         iconNum = 3
     elif contactLevel == const.contactGoodStanding:
         flag = state.flagStandingGood
         iconNum = 3
     elif contactLevel == const.contactNeutralStanding:
         flag = state.flagStandingNeutral
         iconNum = 5
     elif contactLevel == const.contactBadStanding:
         flag = state.flagStandingBad
         iconNum = 4
     elif contactLevel == const.contactHorribleStanding:
         flag = state.flagStandingHorrible
         iconNum = 4
     if flag:
         col = sm.GetService('state').GetStateFlagColor(flag)
         if not self.enabled:
             avgCol = col[0] / 3.0 + col[1] / 3.0 + col[1] / 3.0
             col = (avgCol, avgCol, avgCol)
         flag = uicls.Container(parent=self,
                                pos=(0, 0, 20, 20),
                                name='flag',
                                state=uiconst.UI_DISABLED,
                                align=uiconst.RELATIVE)
         selected = uicls.Frame(parent=flag,
                                color=(1.0, 1.0, 1.0, 0.75),
                                state=uiconst.UI_HIDDEN)
         hilite = uicls.Frame(parent=flag,
                              color=(1.0, 1.0, 1.0, 0.75),
                              state=uiconst.UI_HIDDEN)
         uicls.Sprite(
             parent=flag,
             pos=(3, 3, 15, 15),
             name='icon',
             state=uiconst.UI_DISABLED,
             rectLeft=iconNum * 10,
             rectWidth=10,
             rectHeight=10,
             texturePath='res:/UI/Texture/classes/Bracket/flagIcons.png',
             align=uiconst.RELATIVE)
         fill = uicls.Fill(parent=flag, color=col)
         uicls.Frame(parent=self, color=(1.0, 1.0, 1.0, 0.2))
         fill.color.a = 0.6
         self.sr.hilite = hilite
         self.sr.selected = selected
         if self.enabled:
             self.hint = text
示例#11
0
 def AddFill(self, *args):
     self.sr.fill = uicls.Frame(
         parent=self,
         name='fill',
         frameConst=uiconst.FRAME_FILLED_SHADOW_CORNER0,
         color=(1.0, 1.0, 1.0, 0.05))
     self.sr.hilite = uicls.Frame(
         parent=self,
         name='hilite',
         frameConst=uiconst.FRAME_FILLED_SHADOW_CORNER0,
         pos=(1, 1, 0, 0),
         color=(1.0, 1.0, 1.0, 0.25),
         state=uiconst.UI_HIDDEN)
示例#12
0
 def ShowCompWindow(self):
     if self.debug:
         self.LogInfo('    ShowCompWindow')
     edit = self.currentFocus
     if not edit or edit.destroyed:
         self.HideCompWindow()
         if self.debug:
             self.LogInfo('    <<ShowCompWindow (HideCompWindow) edit:', edit)
         return
     fontsize = 14
     if hasattr(edit, 'GetFontParams'):
         fontsize = max(fontsize, edit.GetFontParams().fontsize)
     elif isinstance(edit, (browser.BrowserPane,)):
         fontsize = 24
     if not self.compWindow:
         self.compWindow = uicls.Container(name='IME', parent=uicore.desktop, align=uiconst.TOPLEFT, idx=0)
         self.compCursor = uicls.Fill(parent=self.compWindow, align=uiconst.TOPLEFT, width=1, top=2, color=(1.0, 1.0, 1.0, 0.75))
         self.compText = uicls.Label(parent=self.compWindow, fontsize=fontsize, state=uiconst.UI_DISABLED, left=3, top=1)
         uicls.Frame(parent=self.compWindow)
         uicls.Fill(parent=self.compWindow, color=(0.0, 0.0, 0.0, 1.0))
     if self.s_bInsertOnType:
         self.compWindow.state = uiconst.UI_HIDDEN
     else:
         self.compWindow.state = uiconst.UI_DISABLED
     if self.debug:
         self.LogInfo('    ShowCompWindow self.s_CompString:', [ ord(char) for char in self.s_CompString ])
     self.compText.fontsize = fontsize
     self.compText.text = self.s_CompString
     self.compWindow.width = self.compText.textwidth + self.compText.left * 2
     self.compWindow.height = self.compText.textheight + self.compText.top * 2
     self.compCursor.height = self.compWindow.height - self.compCursor.top * 2
     self.compWindowParent = edit
     self.compCursor.left = self.compText.left + self.GetCompCursorPos(self.s_nCompCaret)
     self.PositionCompositionWindow()
示例#13
0
 def Prepare_RightSide_(self):
     rightSideLine = uicls.Frame(parent=self,
                                 align=uiconst.TOALL,
                                 state=uiconst.UI_DISABLED,
                                 color=MAINCOLOR,
                                 name='rightSideLine',
                                 frameConst=('ui_1_16_96', 4, 0, 0))
示例#14
0
 def PanelShowStats(self, *args):
     cont = uicls.Container(parent=self.actionCont,
                            pos=(0, 0, 0, 175),
                            align=uiconst.TOTOP,
                            state=uiconst.UI_HIDDEN)
     self.statsScroll = scroll = uicls.Scroll(parent=cont,
                                              name='StatsScroll',
                                              align=uiconst.TOTOP,
                                              height=170)
     scroll.HideUnderLay()
     uicls.Frame(parent=scroll, color=(1.0, 1.0, 1.0, 0.2))
     scrolllist = []
     link = self.pin.link
     strCpuUsage = localization.GetByLabel('UI/PI/Common/TeraFlopsAmount',
                                           amount=int(link.GetCpuUsage()))
     data = util.KeyVal(
         label='%s<t>%s' %
         (localization.GetByLabel('UI/PI/Common/CpuUsage'), strCpuUsage))
     scrolllist.append(listentry.Get('Generic', data=data))
     strPowerUsage = localization.GetByLabel('UI/PI/Common/MegaWattsAmount',
                                             amount=int(
                                                 link.GetPowerUsage()))
     data = util.KeyVal(label='%s<t>%s' %
                        (localization.GetByLabel('UI/PI/Common/PowerUsage'),
                         strPowerUsage))
     scrolllist.append(listentry.Get('Generic', data=data))
     scroll.Load(contentList=scrolllist,
                 headers=[
                     localization.GetByLabel('UI/PI/Common/Attribute'),
                     localization.GetByLabel('UI/Common/Value')
                 ])
     return cont
示例#15
0
 def PanelShowStorage(self):
     cont = uicls.Container(parent=self.actionCont,
                            pos=(0, 0, 0, 200),
                            align=uiconst.TOTOP,
                            state=uiconst.UI_HIDDEN)
     self.storageContentScroll = scroll = uicls.Scroll(
         parent=cont,
         name='storageContentsScroll',
         align=uiconst.TOTOP,
         height=175)
     scroll.HideUnderLay()
     uicls.Frame(parent=scroll, color=(1.0, 1.0, 1.0, 0.2))
     self.LoadStorageContentScroll()
     self.buttonContainer = uicls.Container(parent=self.actionCont,
                                            pos=(0, 0, 0, 30),
                                            align=uiconst.TOBOTTOM,
                                            state=uiconst.UI_PICKCHILDREN)
     btns = [[
         localization.GetByLabel('UI/PI/Common/CreateRoute'),
         self._CreateRoute, 'storageContentScroll'
     ],
             [
                 localization.GetByLabel('UI/PI/Common/ExpeditedTransfer'),
                 self._CreateTransfer, None
             ]]
     self.createRouteButton = uicls.ButtonGroup(btns=btns,
                                                parent=cont,
                                                line=False,
                                                alwaysLite=True)
     return cont
示例#16
0
 def PanelShowProducts(self):
     cont = uicls.Container(parent=self.actionCont,
                            pos=(0, 0, 0, 200),
                            align=uiconst.TOTOP,
                            state=uiconst.UI_HIDDEN)
     self.productScroll = scroll = uicls.Scroll(parent=cont,
                                                name='productsScroll',
                                                align=uiconst.TOTOP,
                                                height=175)
     scroll.HideUnderLay()
     self.LoadProductScroll()
     uicls.Frame(parent=scroll, color=(1.0, 1.0, 1.0, 0.2))
     self.buttonContainer = uicls.Container(parent=self.actionCont,
                                            pos=(0, 0, 0, 30),
                                            align=uiconst.TOBOTTOM,
                                            state=uiconst.UI_PICKCHILDREN)
     btns = [[
         localization.GetByLabel('UI/PI/Common/CreateRoute'),
         self._CreateRoute, 'productScroll'
     ]]
     self.createRouteButton = uicls.ButtonGroup(btns=btns,
                                                parent=cont,
                                                line=False,
                                                alwaysLite=True)
     btns = [[
         localization.GetByLabel('UI/PI/Common/DeleteRoute'),
         self._DeleteRoute, ()
     ]]
     self.deleteRouteButton = uicls.ButtonGroup(btns=btns,
                                                parent=cont,
                                                line=False,
                                                alwaysLite=True)
     self.createRouteButton.state = uiconst.UI_HIDDEN
     self.deleteRouteButton.state = uiconst.UI_HIDDEN
     return cont
示例#17
0
 def Prepare_Underlay_(self):
     self.frame = uicls.Frame(parent=self,
                              align=uiconst.TOBOTTOM,
                              pos=(0, 0, 0, self.height),
                              color=(1.0, 1.0, 1.0, 0.3),
                              state=uiconst.UI_NORMAL)
     self.frame.OnClick = self.OnFrameClicked
示例#18
0
 def PanelShowSchematics(self):
     self.schematicsCont = cont = uicls.Container(parent=self.actionCont,
                                                  name='schematicsCont',
                                                  pos=(0, 0, 0, 155),
                                                  align=uiconst.TOTOP,
                                                  state=uiconst.UI_HIDDEN)
     self.schematicsScroll = uicls.Scroll(parent=cont,
                                          name='schematicsScroll',
                                          align=uiconst.TOTOP,
                                          height=148)
     self.schematicsScroll.Startup()
     self.schematicsScroll.sr.id = 'planetProcessorSchematicsScroll'
     self.schematicsScroll.multiSelect = False
     self.schematicsScroll.HideUnderLay()
     self.schematicsScroll.OnSelectionChange = self.OnSchematicScrollSelectionChange
     uicls.Frame(parent=self.schematicsScroll, color=(1.0, 1.0, 1.0, 0.2))
     self.LoadSchematicsScroll()
     self.selectedSchematicCont = uicls.Container(
         parent=cont,
         name='selectedSchematicCont',
         pos=(0, 0, 0, 0),
         padding=(0, 7, 0, 0),
         align=uiconst.TOALL,
         state=uiconst.UI_PICKCHILDREN)
     return cont
示例#19
0
    def Startup(self,
                numBoxes=20,
                boxColor=None,
                fadeTime=None,
                vpad=1,
                hpad=1,
                *args):
        self.sr.frame = uicls.Frame(parent=self,
                                    padding=(-1, -1, -1, -1),
                                    color=(0.6, 0.6, 0.6, 1.0),
                                    idx=0)
        self.sr.frame.state = uiconst.UI_DISABLED
        self.numBoxes = numBoxes
        self.boxPaddingHorizontal = hpad
        self.boxPaddingVertical = vpad
        if boxColor is None:
            boxColor = (1.0, 0.0, 0.0, 0.95)
        if fadeTime is not None:
            self.fadeTime = fadeTime
        while len(self.boxes) < self.numBoxes:
            self.boxes.append(self.CreateBox(2, 2, boxColor))

        if len(self.boxes) > 0:
            self.boxes[-1].height = 0
            self.boxes[-1].width = 0
            self.boxes[-1].SetAlign(uiconst.TOALL)
        blue.pyos.synchro.Yield()
        self._OnResize()
示例#20
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)
示例#21
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.system = uicls.Container(name='solarsystem', parent=self)
     self.upgrades = uicls.Container(name='upgrades',
                                     parent=self,
                                     align=uiconst.TORIGHT,
                                     pos=(0, 0, 280, 10),
                                     padding=(0, 3, 8, 4))
     self.sr.selection = uicls.Fill(bgParent=self,
                                    padTop=1,
                                    padBottom=1,
                                    color=(1.0, 1.0, 1.0, 0.125),
                                    state=uiconst.UI_HIDDEN)
     self.location = uicls.EveLabelMedium(text='',
                                          parent=self.system,
                                          left=6,
                                          align=uiconst.TOPLEFT,
                                          state=uiconst.UI_DISABLED,
                                          idx=0,
                                          maxLines=1)
     self.upgradeBars = []
     uicls.Frame(bgParent=self.upgrades, color=COLOR)
     barCont = uicls.Container(parent=self.upgrades, padding=1)
     for i in xrange(5):
         f = uicls.Fill(parent=barCont,
                        name='upgrades%d' % i,
                        align=uiconst.TOLEFT_PROP,
                        color=COLOR,
                        width=0.2,
                        padding=1)
         self.upgradeBars.append(f)
示例#22
0
 def AddMoreContFill(self, *args):
     maincolor, backgroundcolor, component, componentsub = self.GetWindowColors(
     )
     uicls.Frame(parent=self.sr.moreCont,
                 name='moreContFill',
                 frameConst=uiconst.FRAME_FILLED_SHADOW_CORNER0,
                 color=(1.0, 1.0, 1.0, 0.5))
示例#23
0
    def ToggleLiteWindowAppearance(self, wnd, forceLiteState = None):
        if forceLiteState is not None:
            wnd._SetPinned(forceLiteState)
        state = uiconst.UI_DISABLED
        for each in wnd.children[:]:
            if each.name.startswith('_lite'):
                each.Close()

        if wnd.IsPinned():
            for align in (uiconst.TOLEFT,
             uiconst.TOTOP,
             uiconst.TORIGHT,
             uiconst.TOBOTTOM):
                uicls.Line(parent=wnd, align=align, color=(0.0, 0.0, 0.0, 0.3), idx=0, name='_liteline')

            uicls.Frame(parent=wnd, color=(1.0, 1.0, 1.0, 0.2), name='_liteframe')
            uicls.Fill(parent=wnd, color=(0.0, 0.0, 0.0, 0.3), name='_litefill')
            state = uiconst.UI_HIDDEN
        for each in wnd.children:
            for _each in wnd.sr.underlay.background:
                if _each.name in ('base', 'color', 'shadow', 'solidBackground'):
                    _each.state = state

        m = wnd.sr.maincontainer
        if state == uiconst.UI_DISABLED:
            m.left = m.top = m.width = m.height = 1
        else:
            m.left = m.top = m.width = m.height = 0
        self.ChangeControlAppearance(wnd)
示例#24
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.barUpdateDelayMs = attributes.get('barUpdateDelayMs', self.default_barUpdateDelayMs)
     backgroundColor = attributes.get('backgroundColor', self.default_backgroundColor)
     timeIndicatorColor = attributes.get('timeIndicatorColor', self.default_timeIndicatorColor)
     self.barHintFunc = attributes.get('barHintFunc', None)
     self.bars = []
     self.busy = None
     self.queuedValues = None
     self.numBars = None
     self.setValuesThread = None
     self.timeIndicatorValue = 0.0
     self.maxValue = None
     self.xLabels = None
     self.timeIndicatorThread = None
     self.barWidth = None
     XAXISHEIGHT = 15
     YAXISWIDTH = 40
     self.yAxisCont = uicls.Container(parent=self, name='yAxisCont', align=uiconst.TOLEFT, width=YAXISWIDTH, padBottom=XAXISHEIGHT + 1)
     self.xAxisCont = uicls.Container(parent=self, name='xAxisCont', align=uiconst.TOBOTTOM, height=XAXISHEIGHT)
     self.graphCont = uicls.Container(parent=self, name='graphCont', align=uiconst.TOALL)
     self.timeIndicator = uicls.Line(parent=self.graphCont, name='timeIndicator', state=uiconst.UI_HIDDEN, align=uiconst.TOPLEFT, color=timeIndicatorColor, padding=(0, 1, 0, 1), width=1)
     self.backgroundCont = uicls.Container(parent=self, name='backgroundCont', align=uiconst.TOALL, padding=(1, 2, 1, 1), clipChildren=True)
     uicls.Frame(parent=self, color=COLOR_FRAME)
     uicls.Sprite(parent=self.backgroundCont, name='backgroundStripes', align=uiconst.TOTOP, height=500, texturePath='res:/UI/Texture/Bargraph/background_stripes.dds', ignoreSize=True, color=backgroundColor)
     self.barCont = uicls.Container(parent=self.graphCont, name='barCont', align=uiconst.TOALL, padding=(2, 2, 1, 1), clipChildren=True)
示例#25
0
 def ApplyAttributes(self, attributes):
     uicls.SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.copyicon = uicls.Icon(icon='ui_73_16_1', parent=self, pos=(3, 3, 16, 16), align=uiconst.TOPRIGHT, hint=localization.GetByLabel('UI/Control/Entries/CopyKillInfo'))
     self.copyicon.OnClick = self.GetCombatText
     iconCont = uicls.Container(parent=self, align=uiconst.TOLEFT, width=40)
     self.shipCont = uicls.Container(parent=iconCont, align=uiconst.CENTER, width=32, height=32)
     self.shipFrame = uicls.Frame(parent=self.shipCont)
     self.shipIcon = uicls.Icon(parent=self.shipCont, align=uiconst.TOALL, size=256, ignoreSize=True)
     self.shipIcon.cursor = uiconst.UICURSOR_MAGNIFIER
     self.shipIcon.OnClick = (self.OnPreviewClick, self.shipIcon)
     self.shipIcon.OnMouseEnter = self.OnControlEnter
     self.shipIcon.OnMouseExit = self.OnControlExit
     self.techIcon = uicls.Sprite(name='techIcon', parent=self.shipCont, align=uiconst.RELATIVE, width=16, height=16, idx=0, left=1, top=1)
     self.techIcon.OnMouseEnter = self.OnControlEnter
     self.techIcon.OnMouseExit = self.OnControlExit
     self.timeCont = uicls.Container(parent=self, align=uiconst.TORIGHT, width=35, padRight=6)
     self.textCont = uicls.Container(parent=self, align=uiconst.TOALL, state=uiconst.UI_PICKCHILDREN, clipChildren=True)
     self.victimLabel = uicls.EveLabelMedium(text='', parent=self.textCont, left=5, top=3, state=uiconst.UI_NORMAL, maxLines=1)
     self.killerLabel = uicls.EveLabelMedium(text='', parent=self.textCont, left=5, top=20, state=uiconst.UI_NORMAL, maxLines=1)
     self.dateLabel = uicls.EveLabelMedium(text='', parent=self.timeCont, align=uiconst.TOPRIGHT, top=20)
     self.victimLabel.OnMouseEnter = self.OnControlEnter
     self.victimLabel.OnMouseExit = self.OnControlExit
     self.killerLabel.OnMouseEnter = self.OnControlEnter
     self.killerLabel.OnMouseExit = self.OnControlExit
     self.hilite = uicls.Fill(bgParent=self, color=(1.0, 1.0, 1.0, 0.1), idx=0)
     self.hilite.display = False
示例#26
0
 def AddFill(self, *args):
     self.sr.fill = uicls.Frame(
         parent=self,
         name='fill',
         frameConst=uiconst.FRAME_FILLED_SHADOW_CORNER0,
         color=(0.5, 0.5, 0.5, 0.5),
         padding=(1, 1, 1, 1))
示例#27
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))
示例#28
0
 def LoadFrame(self, color = None, offset = -2, iconPath = 'ui_1_16_209', cornerSize = 7):
     if not self.sr.frame:
         if self.sr.underlay:
             idx = uiutil.GetIndex(self.sr.underlay)
         else:
             idx = -1
         self.sr.frame = uicls.Frame(name='__frame', color=color, frameConst=(iconPath, cornerSize, offset), parent=self, idx=idx)
示例#29
0
文件: loading.py 项目: R4M80MrX/eve-1
 def Startup(self):
     self.abortbtn = None
     self.abortbtnpar = None
     self.confirmbtn = None
     self.abortconfirmbtnpar = None
     self.sr.progresstext = None
     self.sr.readprogress = util.KeyVal(text='', prev=0)
     self.scope = 'all'
     self.sr.main = uicls.Container(parent=self,
                                    pos=(0, 0, 0, 0),
                                    name='maincontainer',
                                    state=uiconst.UI_PICKCHILDREN,
                                    align=uiconst.TOALL)
     self.sr.wndUnderlay = uicls.WindowUnderlay(parent=self,
                                                transparent=False)
     par = uicls.Container(name='progressParent',
                           parent=self.sr.main,
                           align=uiconst.TOBOTTOM,
                           height=32)
     progress = uicls.Container(parent=par,
                                pos=(25, 10, self.width - 50, 10),
                                name='progressbar',
                                state=uiconst.UI_DISABLED,
                                align=uiconst.RELATIVE)
     self.sr.glowClipper = uicls.Container(parent=progress,
                                           pos=(0, 0, 0, 10),
                                           name='glowclipper',
                                           state=uiconst.UI_DISABLED,
                                           clipChildren=True,
                                           align=uiconst.RELATIVE)
     self.sr.glow = uicls.Container(parent=self.sr.glowClipper,
                                    pos=(0, 0, progress.width, 10),
                                    name='glow',
                                    state=uiconst.UI_DISABLED,
                                    align=uiconst.RELATIVE)
     glowFill = uicls.Fill(parent=self.sr.glow,
                           name='glowFill',
                           state=uiconst.UI_DISABLED,
                           color=(1.0, 1.0, 1.0, 0.5),
                           align=uiconst.TOALL)
     shade = uicls.Container(parent=progress,
                             pos=(0, 0, 0, 0),
                             name='shade',
                             state=uiconst.UI_DISABLED,
                             align=uiconst.TOALL)
     shadeFill = uicls.Fill(parent=shade,
                            name='shadeFill',
                            state=uiconst.UI_DISABLED,
                            color=(0.0, 0.0, 0.0, 0.18),
                            align=uiconst.TOALL)
     uicls.Frame(parent=progress)
     self.sr.loading_progress = progress
     self.sr.progresstext = uicls.EveLabelMedium(text='',
                                                 parent=progress,
                                                 width=270,
                                                 left=2,
                                                 top=4,
                                                 state=uiconst.UI_NORMAL)
     self.state = uiconst.UI_PICKCHILDREN
示例#30
0
 def AddLayout(self):
     self.sr.main = uicls.Container(name='main',
                                    parent=self,
                                    align=uiconst.TOPLEFT,
                                    height=ICONHEIGHT,
                                    width=ICONWIDTH)
     self.sr.background = uicls.Container(name='background',
                                          parent=self.sr.main,
                                          align=uiconst.TOTOP,
                                          height=88)
     self.sr.backgroundFrame = uicls.BumpedUnderlay(
         name='backgroundUnderlay', parent=self.sr.background)
     self.sr.iconContainer = uicls.Container(name='iconContainer',
                                             parent=self.sr.main,
                                             align=uiconst.CENTERTOP,
                                             pos=(0, 10, 54, 54),
                                             idx=0)
     invTypeIcon = cfg.invtypes.Get(self.typeID).Icon()
     self.sr.icon = icon = uicls.Icon(parent=self.sr.iconContainer,
                                      align=uiconst.TOALL,
                                      state=uiconst.UI_DISABLED)
     if invTypeIcon is None:
         icon.ChangeIcon(typeID=self.typeID)
     else:
         icon.LoadIcon(invTypeIcon.iconFile)
     self.sr.quantityContainer = uicls.Container(name='quantityContainer',
                                                 parent=self.sr.background,
                                                 align=uiconst.CENTERBOTTOM,
                                                 height=20,
                                                 width=ICONWIDTH - 1,
                                                 idx=0,
                                                 bgColor=(0, 0, 0, 0.5))
     self.sr.quantityLabel = uicls.EveLabelMedium(
         text='',
         parent=self.sr.quantityContainer,
         align=uiconst.CENTERBOTTOM,
         left=3,
         bold=True)
     self.barContainer = uicls.Fill(name='barContainer',
                                    parent=self.sr.quantityContainer,
                                    align=uiconst.TOPLEFT,
                                    color=(1, 1, 1, 0.25),
                                    height=20,
                                    width=0)
     self.sr.typeNameContainer = uicls.Container(name='typeNameContainer',
                                                 parent=self.sr.main,
                                                 align=uiconst.TOALL)
     self.sr.typeName = uicls.LabelLink(
         text=localization.GetByLabel('UI/UpgradeWindow/CenteredTypeText',
                                      type=self.typeID),
         parent=self.sr.typeNameContainer,
         align=uiconst.CENTERTOP,
         maxLines=3,
         width=ICONWIDTH,
         func=(sm.GetService('info').ShowInfo, self.typeID),
         hint=localization.GetByLabel('UI/Commands/ShowInfo'),
         top=3)
     self.sr.typeName.maxLines = None
     self.sr.frame = uicls.Frame(parent=self, state=uiconst.UI_HIDDEN)