def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.vulnerableHoursInt = attributes.vulnerableHours isSameSchedule = attributes.get('isSameSchedule', True) today = datetime.datetime.today().weekday() blocks = self.GetBlocks() for eachDay, eachBlock in blocks: toTop = eachBlock * self.BLOCK_HEIGHT left = self.GetLeftForDay(eachDay) Fill(parent=self, pos=(left, toTop, self.DAY_WIDTH, self.BLOCK_HEIGHT - 1), align=uiconst.TOPLEFT, color=(1, 1, 0, 0.75)) for i in xrange(7): if i == today: color = self.TODAY_COLOR else: color = self.DAY_COLOR left = self.GetLeftForDay(dayNum=i) Fill(parent=self, pos=(left, 0, self.DAY_WIDTH, 0), align=uiconst.TOLEFT_NOPUSH, color=color) if not isSameSchedule: Frame(bgParent=self, color=(1, 0, 0, 0.2), padding=-4) Fill(bgParent=self, color=(1, 0, 0, 0.1), padding=-4)
def Prepare_(self): Frame(parent=self) self.sr.label = Label(parent=self, state=uiconst.UI_DISABLED, fontsize=10, letterspace=1, pos=(8, 4, 0, 0), uppercase=1, idx=2) self.sr.icon = Sprite(parent=self, state=uiconst.UI_DISABLED) self.sr.icon.LoadIcon('ui_1_16_102') self.sr.hilite = Fill(parent=self) self.sr.blink = Fill(parent=self)
def Startup(self, *args): listentry.Checkbox.Startup(self, *args) colorPicker = Container(parent=self, pos=(0, 0, 27, 20), name='colorPicker', state=uiconst.UI_NORMAL, align=uiconst.CENTERRIGHT, idx=0) Sprite(parent=colorPicker, pos=(0, 0, 16, 16), name='arrow', align=uiconst.CENTERRIGHT, texturePath='res:/ui/texture/icons/38_16_229.png', color=(1, 1, 1, 0.5), state=uiconst.UI_DISABLED) self.colorCont = Container(parent=colorPicker, name='colorCont', pos=(2, 0, 10, 10), align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED) Frame(parent=self.colorCont, name='colorFrame', color=(1, 1, 1, 0.2)) self.colorFill = Fill(parent=self.colorCont, color=(0, 0, 0, 0)) colorPicker.LoadTooltipPanel = self.LoadColorTooltipPanel colorPicker.GetTooltipPointer = self.GetColorTooltipPointer colorPicker.GetTooltipDelay = self.GetTooltipDelay
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, (CoreBrowserPane,)): fontsize = 24 if not self.compWindow: self.compWindow = Container(name='IME', parent=uicore.desktop, align=uiconst.TOPLEFT, idx=0) self.compCursor = Fill(parent=self.compWindow, align=uiconst.TOPLEFT, width=1, top=2, color=(1.0, 1.0, 1.0, 0.75)) self.compText = LabelCore(parent=self.compWindow, fontsize=fontsize, state=uiconst.UI_DISABLED, left=3, top=1) Frame(parent=self.compWindow, color=(1, 1, 1, 0.3)) 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()
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.node = attributes.node if self.node.IsRestricted(): self.bgPattern = Sprite( bgParent=self, aling=uiconst.TOALL, state=uiconst.UI_DISABLED, texturePath= 'res:/UI/Texture/classes/ShipTree/groups/hatchPattern.png', textureSecondaryPath= 'res:/UI/Texture/classes/ShipTree/groups/bgVignette.png', spriteEffect=trinity.TR2_SFX_MODULATE, tileX=True, tileY=True, color=(0.965, 0.467, 0.157, 0.4)) self.bgFrame = Frame( name='bgFrame', bgParent=self, texturePath= 'res:/UI/Texture/Classes/ShipTree/Groups/groupIconFrame.png') self.bgFill = Fill(name='bgFill', bgParent=self, color=shipTreeConst.COLOR_BG) self.bgBlinkFill = None self.icon = Sprite( parent=self, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=cfg.fsdInfoBubbleGroups[self.node.shipGroupID].icon, color=shipTreeConst.COLOR_HILIGHT, width=32, height=32)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) mainArea = self.GetMainArea() mainArea.padding = 6 self._selectedObject = None self.SetTopparentHeight(0) self._infoContainer = Container(parent=mainArea, align=uiconst.TOTOP, height=72) self.searchInput = SinglelineEdit(parent=self._infoContainer, align=uiconst.BOTTOMRIGHT, left=4, top=8, width=100, OnChange=self.OnSearchInputChange, hinttext='Search') self.searchInput.SetHistoryVisibility(False) self.searchInput.ShowClearButton() m = UtilMenu(menuAlign=uiconst.TOPRIGHT, parent=self._infoContainer, align=uiconst.TOPRIGHT, GetUtilMenu=self.SettingMenu) self._infoLabel = Label(parent=self._infoContainer, state=uiconst.UI_DISABLED, color=(1.0, 1.0, 1.0, 0.75), left=2) self.searchResultParent = ContainerAutoSize(parent=mainArea, align=uiconst.TOTOP_NOPUSH, padding=(26, -6, 4, 0), bgColor=(0.5, 0.5, 0.5, 1)) self.attributeScroll = Scroll(parent=mainArea, align=uiconst.TOBOTTOM, name='attributeScroll') self.attributeScroll.height = min(self.height / 2, max(72, settings.user.ui.Get('uitree_attributeScroll_height', 200))) settings.user.ui.Set('uitree_attributeScroll_height', self.attributeScroll.height) self.divider = Divider(align=uiconst.TOBOTTOM, parent=mainArea, height=11, state=uiconst.UI_NORMAL) self.divider.OnChange_ = self.OnDividerMove self.divider.OnChangeStart_ = self.OnDividerMoveStart Fill(parent=self.divider, align=uiconst.CENTER, pos=(0, 0, 20, 1)) self.scroll = Scroll(parent=mainArea, name='treeScroll') self._hiliteFrame = Fill(parent=uicore.desktop, align=uiconst.ABSOLUTE, color=(0, 1, 0, 0.3), idx=0, state=uiconst.UI_DISABLED) self._selectedFrame = Frame(parent=uicore.desktop, align=uiconst.ABSOLUTE, color=(0, 1, 0, 0.3), idx=0, state=uiconst.UI_DISABLED) self.ReloadUIRoots() uthread.new(self.UpdateInfo) self._keyDownCookie = uicore.uilib.RegisterForTriuiEvents([uiconst.UI_KEYDOWN], self.OnGlobalKeyDown)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.radius = attributes.Get('radius', self.default_radius) self.lineWidth = attributes.Get('lineWidth', self.default_lineWidth) self.startAngle = attributes.Get('startAngle', self.default_startAngle) self.value = attributes.Get('value', self.default_value) self.colorStart = attributes.Get('colorStart', self.default_colorStart) self.colorEnd = attributes.Get('colorEnd', self.default_colorEnd) self.colorBg = attributes.Get('colorBg', self.default_colorBg) colorMarker = attributes.Get('colorMarker', self.default_colorMarker) self.callback = attributes.Get('callback', self.default_callback) self.isHoverMarkerEnabled = attributes.Get('hoverMarkerEnabled', self.default_hoverMarkerEnabled) if colorMarker is None: colorMarker = self.colorStart self.width = self.height = self.radius * 2 + self.lineWidth self.pickRadius = self.radius + self.lineWidth self._angle = 0.0 hoverMarkerSize = self.lineWidth * 1.7 self.hoverMarker = Sprite(name='hoverMarker', parent=self, color=colorMarker, width=hoverMarkerSize, height=hoverMarkerSize, state=uiconst.UI_DISABLED, opacity=0.0, texturePath='res:/UI/Texture/Classes/Gauge/circle.png') self.markerTransform = Transform(name='markerTransform', parent=self, align=uiconst.TOALL, rotationCenter=(0.5, 0.5), rotation=-self.startAngle - pi / 2) height = self.lineWidth + 5 self.marker = Fill(name='marker', parent=self.markerTransform, color=colorMarker, align=uiconst.CENTERTOP, pos=(0, -(height - self.lineWidth), 2, height)) self.gauge = None self.bgGauge = None self.Reconstruct() uthread.new(self.UpdateThread)
def ApplyAttributes(self, attributes): LayoutGrid.ApplyAttributes(self, attributes) self.columns = 5 self.cellPadding = 1 self.cellSpacing = 1 self.margin = (2, 2, 2, 2) self.addClear = attributes.get('addClear', True) self.colorList = attributes['colorList'] self.callback = attributes.callback currentColor = attributes.currentColor colorPos = (0, 0, 10, 10) for eachColor in self.colorList: if eachColor == currentColor: c = Container(name='colorFill', pos=colorPos, align=uiconst.NOALIGN, state=uiconst.UI_NORMAL) Frame(parent=c, name='selectedColorFrame', color=(1, 1, 1, 0.75)) Fill(parent=c, name='colorFill', color=eachColor, padding=1) else: c = Fill(name='colorFill', pos=colorPos, color=eachColor, align=uiconst.NOALIGN, state=uiconst.UI_NORMAL) c.OnClick = (self.callback, eachColor) self.AddCell(cellObject=c, colSpan=1, cellPadding=1) if self.addClear: c = Frame(name='colorFill', pos=colorPos, color=(1, 1, 1, 0.2), align=uiconst.NOALIGN, state=uiconst.UI_NORMAL) c.OnClick = (self.callback, None) self.AddCell(cellObject=c, colSpan=1)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.colorFill = Fill(bgParent=self, color=attributes.color or self.BGCOLOR) self.shadow = Frame(bgParent=self, frameConst=FRAME_SOFTSHADE, color=(0, 0, 0, 0.25), padding=(-10, -10, -10, -10))
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.bgFill = Fill(bgParent=self, color=COLOR_OFF) self.label = Label(parent=self, align=uiconst.CENTERLEFT, text=attributes.text, padLeft=5, padRight=5)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.flagBackground = Fill(bgParent=self) self.flagBackground.opacity = 0 self.flagIcon = Sprite(parent=self, pos=(0, 0, 9, 9), name='flagIcon', state=uiconst.UI_DISABLED, align=uiconst.CENTER)
def Build(self): self.minGridLineHeight = 32 self.graph.Flush() self.legend.Flush() self.isBuilding = True minutes = 60 self.data = blue.pyos.cpuUsage[-minutes * 60 / 10:] memData = [] pymemData = [] bluememData = [] othermemData = [] workingsetData = [] startTime = self.data[0][0] endTime = startTime for t, cpu, mem, sched in self.data: mem, pymem, workingset, pagefaults, bluemem = mem memData.append(mem) pymemData.append(pymem) bluememData.append(bluemem) othermem = mem - bluemem othermemData.append(othermem) workingsetData.append(workingset) endTime = t maxValues = [] for each in [memData, pymemData, bluememData, othermemData, workingsetData]: maxValues.append(max(each)) self.overallMaxValue = max(maxValues) bottom = Container(parent=self.graph, align=uiconst.TOBOTTOM, height=24) Fill(parent=bottom, align=uiconst.TOLEFT, width=80, spriteEffect=trinity.TR2_SFX_NONE) self.horizontalAxisLabels = HorizontalAxisLabels(parent=bottom, align=uiconst.TOBOTTOM, height=24, padRight=8, labelClass=Label, fontsize=12, minValue=startTime, maxValue=endTime, step=64, formatter=_TimeLabel) self.axisLabels = VerticalAxisLabels(parent=self.graph, align=uiconst.TOLEFT, width=80, padRight=8, labelClass=Label, fontsize=16, formatter=lambda x: str(int(x * 1e-06))) self.grid = Grid(parent=self.graph) self.graphContainer = Container(parent=self.graph, align=uiconst.TOALL) Fill(parent=self.graph, color=(0, 0, 0, 0.25)) Fill(parent=self.legend, align=uiconst.TOLEFT, width=80, spriteEffect=trinity.TR2_SFX_NONE) self.graphs = [] graphSources = [(memData, Color.RED, 'Total memory'), (pymemData, Color.GREEN, 'Python memory'), (bluememData, Color.BLUE, 'Blue memory'), (othermemData, Color.YELLOW, 'Other memory'), (workingsetData, Color.AQUA, 'Working set')] for source, color, text in graphSources: graph = LineGraph(parent=self.graphContainer, color=color, lineWidth=1, data=source, spriteEffect=trinity.TR2_SFX_FILL) self.graphs.append(graph) self.AddLegend(color, text, graph) self.AdjustForSize() self.isBuilding = False
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.themeID = attributes.themeID uiColorSvc = sm.GetService('uiColor') baseColor = uiColorSvc.GetThemeBaseColor(self.themeID) hiliteColor = uiColorSvc.GetThemeHiliteColor(self.themeID) text = uiColorSvc.GetThemeName(self.themeID) Fill(parent=self, align=uiconst.TOLEFT, color=hiliteColor, width=20, padding=(2, 2, 0, 2)) Fill(parent=self, align=uiconst.TOLEFT, color=baseColor, width=20, padding=(1, 2, 2, 2)) Label(parent=self, align=uiconst.CENTERLEFT, left=45, text=text) self.underlay = EntryUnderlay(bgParent=self) self.UpdateSelected()
def OnOpenView(self): sm.RegisterNotify(self) self.Flush() for child in self.background: child.Close() self.isZooming = False self.isPanning = False self.zoomLevel = ZOOMED_IN self.shipTreeCont = None self.isFadingFrame = False self.bg = Fill(name='bg', bgParent=self, color=COLOR_BG) self.panCont = PanContainer(parent=self, state=uiconst.UI_PICKCHILDREN, callback=self.OnPanContainer) self.UpdatePanContainerBorder()
class StateCont(ContainerAutoSize): def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.bgFill = Fill(bgParent=self, color=COLOR_OFF) self.label = Label(parent=self, align=uiconst.CENTERLEFT, text=attributes.text, padLeft=5, padRight=5) def SetActive(self, isActive): if isActive: self.bgFill.SetRGB(*COLOR_ON) else: self.bgFill.SetRGB(*COLOR_OFF)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) bgColor = attributes.get('bgColor', (1, 1, 1, 0.1)) Fill(bgParent=self, color=bgColor) textColor = attributes.get('textColor', (1, 1, 1, 0.3)) self.textLabel = EveLabelMedium(align=uiconst.CENTER, parent=self, text=attributes.text, bold=True, color=textColor) self.AdjustSize()
def ApplyAttributes(self, attributes): LayoutGridRow.ApplyAttributes(self, attributes) self.isCompact = attributes.isCompact or False bracket = attributes.bracket self.bracket = bracket if not self.IsBracketStillValid(): return self.hilite = Fill(bgParent=self, color=(1, 1, 1, 0.0)) self.iconParent = Container(align=uiconst.CENTER, pos=(0, 0, 26, MINENTRYHEIGHT), parent=self) self.iconObj = self.CreateIcon() self.radialMenuSprite = None if self.isCompact: self.mainLabel = attributes.sideContainer.CreateBracketEntry() self.mainLabel.DelegateEvents(self) else: self.mainLabel = BracketShadowLabel(text='', align=uiconst.CENTERLEFT, width=TOOLTIPLABELCUTOFF, autoFitToText=True, state=uiconst.UI_DISABLED) self.AddCell(cellObject=self.mainLabel, cellPadding=(2, 2, 6, 2)) self.distanceLabel = EveLabelSmall(parent=self, align=uiconst.CENTERRIGHT, left=4) self.dynamicsUpdateTimer = None
def HiliteLink(self, link): if link.sr.attrs.alink_color: c = link.sr.attrs.alink_color Fill(parent=link, color=(c[0], c[1], c[2], c[3] * 0.5), pos=(-2, 0, -2, 0))
def LoadTooltip(self, header, description, on_continue, on_quit): self.AddCell(EveLabelLarge(text=header, state=uiconst.UI_DISABLED, width=250), width=250) self.AddCell(uicontrols.ButtonIcon( texturePath='res:/UI/Texture/icons/38_16_220.png', iconSize=16, width=16, height=16, func=on_quit), margin=(0, 0, 0, 0)) self.AddCell(Fill(align=uiconst.TOTOP, state=uiconst.UI_DISABLED, color=(1, 1, 1, 0.3), height=1, padding=(0, 3, 0, 3)), colSpan=self.columns) self.AddCell(EveLabelMedium(text=description, state=uiconst.UI_DISABLED, width=250), width=250, colSpan=self.columns) self.AddCell(uicontrols.Button(label=localization.GetByLabel( 'UI/ProjectDiscovery/TutorialContinueButtonLabel'), align=uiconst.CENTER, func=lambda _: on_continue()), colSpan=self.columns)
def ApplyAttributes(self, _self, *args): setattr( _self, '_hoverEffect_bgFill', Fill(bgParent=_self, padding=self.padding, color=self.color, state=uiconst.UI_HIDDEN))
def UpdateSelectionHilite(self): if not self.sr.node: return scrollAbove = self.GetScrollAbove() f = uicore.registry.GetFocus() if not scrollAbove or scrollAbove is not f or not trinity.app.IsActive(): selectionAlpha = 0.125 else: selectionAlpha = 0.25 if self.sr.node.selectionStartIndex is not None: if self.sr.textselection is None: self.sr.textselection = Fill(parent=self, align=uiconst.TOPLEFT, state=uiconst.UI_HIDDEN) self.sr.textselection.SetAlpha(selectionAlpha) if self.sr.node.inlines: left = 0 width = 0 for inline, x in self.sr.node.inlines: width = max(width, inline.width) else: left = uicore.font.GetWidthToIdx(self.sr.node, self.sr.node.selectionStartIndex) right = uicore.font.GetWidthToIdx(self.sr.node, self.sr.node.selectionEndIndex) width = uicore.ReverseScaleDpi(right - left) left = uicore.ReverseScaleDpi(left) self.sr.textselection.left = self.leftM + left self.sr.textselection.width = width self.sr.textselection.height = self.height self.sr.textselection.top = 0 self.sr.textselection.state = uiconst.UI_DISABLED elif self.sr.textselection: self.sr.textselection.state = uiconst.UI_HIDDEN
def ApplyAttributes(self, attributes): LayoutGridRow.ApplyAttributes(self, attributes) self.markerObject = attributes.markerObject self.icon = Sprite(pos=(0, 0, 16, 16), texturePath=self.markerObject.texturePath, state=uiconst.UI_DISABLED) self.AddCell(cellObject=self.icon, cellPadding=(3, 1, 4, 1)) self.highLight = Fill(bgParent=self, color=(1, 1, 1, 0.1), state=uiconst.UI_HIDDEN) if self.markerObject.celestialData: labelText = cfg.evelocations.Get( self.markerObject.celestialData.itemID).name label = EveLabelSmall(text=labelText, align=uiconst.CENTERLEFT, width=150, autoFitToText=True) self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1)) infoIcon = InfoIcon(size=14, align=uiconst.CENTERRIGHT, itemID=self.markerObject.celestialData.itemID, typeID=self.markerObject.celestialData.typeID) self.AddCell(cellObject=infoIcon, cellPadding=(0, 1, 1, 1)) else: labelText = self.markerObject.hintString label = EveLabelSmall(text=labelText, align=uiconst.CENTERLEFT, width=150, autoFitToText=True) self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1)) self.FillRow()
def Prepare_(self): self.sr.label = Label(parent=self, state=uiconst.UI_DISABLED, align=uiconst.CENTER, bold=1, idx=0, fontFamily=self.fontFamily, fontStyle=self.fontStyle, fontPath=self.fontPath, fontsize=self.fontsize) self.sr.activeframe = 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 = Fill(parent=self, name='hilite', state=uiconst.UI_HIDDEN, color=(1.0, 1.0, 1.0, 0.25), padding=(2, 2, 2, 2)) Frame(parent=self, name='background', state=uiconst.UI_DISABLED, frameConst=uiconst.FRAME_BORDER1_SHADOW_CORNER4, color=(1.0, 1.0, 1.0, 0.5))
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetTopparentHeight(0) self.preSelectedItems = attributes.selectedItems self.outputPrice = 0 self.outputItemsCount = 0 mainCont = Container(name='mainCont', parent=self.sr.main, padding=const.defaultPadding) bottomCont = Container(name='bottomCont', parent=mainCont, align=uiconst.TOBOTTOM, height=36) reprocessingCont = Container(name='reprocessingCont', parent=mainCont, align=uiconst.TOALL) inputCont = Container(name='inputCont', parent=reprocessingCont, align=uiconst.TOLEFT_PROP, width=0.48) centerCont = Container(name='centerCont', parent=reprocessingCont, align=uiconst.TOLEFT_PROP, width=0.02) outputCont = Container(name='outputCont', parent=reprocessingCont, align=uiconst.TORIGHT_PROP, width=0.48) self.inputInfoCont = ReprocessInputContainer(name='inputInfo', parent=inputCont, dropFunc=self.AddItemByDrag, removeFunc=self.RemoveItem) self.outputInfoCont = ReprocessOutputContainer(name='outputInfo', parent=outputCont) self.loadingOverlay = Container(parent=self.inputInfoCont, idx=0) Fill(bgParent=self.loadingOverlay, color=(0.0, 0.0, 0.0, 0.3)) LoadingWheel(name='loadingWheel', parent=self.loadingOverlay, align=uiconst.CENTER, width=80, height=80) self.loadingOverlay.opacity = 0.0 self.controller = CreateReprocessingWindowController(self, self.inputInfoCont, self.outputInfoCont, sm.GetService('invCache'), sm.GetService('reprocessing'), GetActiveShip) self.inputInfoCont.captionLabel.text = GetByLabel('UI/Reprocessing/ReprocessingWindow/InputMaterials') self.outputInfoCont.captionLabel.text = GetByLabel('UI/Reprocessing/ReprocessingWindow/OutputResults') btnCont = Container(name='buttonCont', parent=bottomCont, align=uiconst.TOBOTTOM, height=36, idx=0, padding=(-4, 3, -4, -2)) GradientUnderlay(bgParent=btnCont) self.reprocessButton = Button(parent=btnCont, label=GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessButton'), func=self.ReprocessItems, align=uiconst.CENTER, fixedheight=28) self.cancelButton = Button(parent=btnCont, label=GetByLabel('UI/Common/Buttons/Cancel'), func=self.Cancel, align=uiconst.CENTERRIGHT, left=8) self.DisableReprocessButton(disable=True) if self.preSelectedItems: start_tasklet(self.AddPreselectedItems, self.preSelectedItems)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.groupID = attributes.groupID self.groupName = attributes.groupName Fill(bgParent=self, color=(0.0, 0.0, 0.0, 0.5)) leftCont = Container(parent=self, align=uiconst.TOALL) self.headerText = EveLabelMedium(text=self.groupName, parent=leftCont, left=2, maxLines=1, align=uiconst.CENTERLEFT, bold=True, padLeft=4)
def Layout(self): Fill(bgParent=self, color=(0, 0, 0, 0.2)) BlurredBackgroundSprite(bgParent=self, color=(1, 1, 1, 0.9)) headerContainer = ContainerAutoSize(parent=self, align=uiconst.TOTOP, alignMode=uiconst.TOPLEFT) self.completedFill = FillThemeColored( bgParent=headerContainer, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.0) self.headerFill = InfoPanelHeaderBackground(bgParent=headerContainer) headerGrid = LayoutGrid(parent=headerContainer) if self.quest.isComplete: texturePath = RES_COMPLETED else: texturePath = RES_AVAILABLE self.check = Sprite(align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, texturePath=texturePath, width=14, height=14) headerGrid.AddCell(self.check, cellPadding=(4, 3, 4, 3)) headerGrid.AddCell(EveLabelMedium(align=uiconst.TOPLEFT, text=self.quest.titleLabel), cellPadding=(0, 2, 0, 2)) self.timer = EveLabelMedium(parent=headerContainer, align=uiconst.CENTERRIGHT, state=uiconst.UI_DISABLED, left=4, opacity=0.0)
def GetSelectionLayer(self): w, h = self.GetAbsoluteSize() if not self.sr.selection: self.sr.selection = Fill(parent=self._textClipper, name='selection', align=uiconst.TOPLEFT, pos=(0, 1, 0, h - 2), idx=1)
def SetFilterOptions(self): self.filterContainer.Flush() Fill(name='SlipUnderLayer', bgParent=self.filterContainer, color=BACKGROUND_COLOR, opacity=CONTENT_SLIP_UNDER_AREA_OPACITY, padTop=-HEADER_PADDING * 2) options = [(localization.GetByLabel( 'UI/VirtualGoodsStore/Sorting/ByPriceAscending'), SORT_PRICE_ASCENDING), (localization.GetByLabel( 'UI/VirtualGoodsStore/Sorting/ByPriceDescending'), SORT_PRICE_DESCENDING), (localization.GetByLabel( 'UI/VirtualGoodsStore/Sorting/ByNameAscending'), SORT_NAME_ASCENDING), (localization.GetByLabel( 'UI/VirtualGoodsStore/Sorting/ByNameDescending'), SORT_NAME_DESCENDING)] self.filterCombo = VgsFilterCombo(parent=self.filterContainer, align=uiconst.TORIGHT, options=options, callback=self.OnSortOrderChanged, select=GetSortOrder(), padding=(4, 2, 0, 4)) self.filterBar = VgsOfferFilterBar( parent=self.filterContainer, onFilterChanged=self.OnFilterChanged)
def Load(self, node): self.sr.leftmargin.width = node.Get('leftmargin', 0) self.sr.rightmargin.width = node.Get('rightmargin', 0) self.sr.line.Flush() Fill(parent=self.sr.line, color=ParseHTMLColor(node.attrs.color or '#88ffffff', 1)) align = uiconst.RELATIVE if node.attrs.width: if unicode(node.attrs.width).endswith('%'): node.attrs.width = self.sr.node.scroll.GetContentWidth() * int( node.attrs.width[:-1]) / 100 self.sr.line.width = int(node.attrs.width) if node.attrs.align and node.attrs.align.lower() in ('left', 'right'): if node.attrs.align.lower() == 'right': align = uiconst.TORIGHT else: align = uiconst.TOLEFT elif node.attrs.align is None: align = uiconst.RELATIVE else: align = uiconst.CENTER else: self.sr.line.left = self.sr.line.width = 0 align = uiconst.TOALL self.sr.line.SetAlign(align)
def ResetOpacity(self, *args): shade = Fill(bgParent=self, color=(0, 0, 0, 0.0)) uicore.animations.FadeTo(shade, startVal=0.0, endVal=0.5, duration=1.0) uicore.animations.FadeTo(self, startVal=self.opacity, endVal=1.0, duration=0.5)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.showHint = attributes.get('showHint', False) self.currentIndex = attributes.get('currentIndex', 0) self.partialValue = attributes.get('partialValue', 0) self.boxTooltipFunc = attributes.get('boxTooltipFunc', None) self.levelBoxes = [] gapSize = 0 for i in xrange(self.numLevels): levelBox = Container(parent=self, name='box', align=uiconst.TOLEFT, width=self.boxWidth, left=gapSize) levelBox.boxNumber = i levelBox.partialValue = 0 if self.boxTooltipFunc: levelBox.state = uiconst.UI_NORMAL fullBox = Fill(bgParent=levelBox, color=self.inactiveColor) levelBox.fullBox = fullBox partialBox = Fill(parent=levelBox, color=self.partialColor, align=uiconst.TOLEFT_PROP) partialBox.display = False levelBox.partialBox = partialBox self.levelBoxes.append(levelBox) gapSize = self.gapSize self.width = self.numLevels * self.boxWidth + (self.numLevels - 1) * self.gapSize self.SetIndexStatus(self.currentIndex, self.partialValue)
def AddLegend(self, color, text, graph): fill = Fill(parent=self.legend, color=color, align=uiconst.TOLEFT, state=uiconst.UI_NORMAL, width=16) fill.OnMouseEnter = lambda : _OnMouseEnterLegend(graph) fill.OnMouseExit = lambda : _OnMouseExitLegend(graph) Label(parent=self.legend, text=text, align=uiconst.TOLEFT, padLeft=8, padRight=16)