def Setup(self, menu, parent = None, minwidth = None): log.LogInfo('Menu.Setup', id(self)) entries = menu.GetEntries() wasLine = 0 idNo = 0 for i, entry in enumerate(entries): if entry is None: if not len(self.sr.entries.children) or i == len(entries) - 1 or wasLine: continue item = Line(align=uiconst.TOTOP, parent=self.sr.entries, opacity=0.1) wasLine = 1 else: size = settings.user.ui.Get('cmenufontsize', 10) from carbonui.control.menu import MenuEntryViewCoreOverride as MenuEntryView menuEntryViewClass = entry.menuClass or MenuEntryView item = menuEntryViewClass(name='entry', align=uiconst.TOTOP, state=uiconst.UI_NORMAL, parent=self.sr.entries) item.Setup(entry, size, menu, idNo) idNo += 1 wasLine = 0 self.height = sum([ each.height for each in self.sr.entries.children ]) + self.sr.entries.top + self.sr.entries.height if len(self.sr.entries.children): self.width = max(max([ each.width for each in self.sr.entries.children ]) + 8, minwidth or 0) + self.sr.entries.left + self.sr.entries.width else: self.width = 100 self.menu = menu log.LogInfo('Menu.Setup Completed', id(self))
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.showNavigationBar = settings.user.ui.Get('browserShowNavBar', True) self.showStatusBar = settings.user.ui.Get('browserShowStatusBar', True) self.SetCaption(localization.GetByLabel('UI/Browser/BrowserSettings/BrowserSettingsCaption')) self.SetButtons(uiconst.OKCLOSE, okLabel=localization.GetByLabel('UI/Browser/BrowserSettings/SaveChanges'), okFunc=self.Save, okModalResult=uiconst.ID_NONE) main = self.GetMainArea() main.clipChildren = 0 main.padding = 6 c = Container(name='homeCont', parent=main, align=uiconst.TOTOP, height=32) l = Container(name='left', parent=c, align=uiconst.TOLEFT, width=100, state=uiconst.UI_PICKCHILDREN) r = Container(name='right', parent=c, align=uiconst.TORIGHT, width=80, state=uiconst.UI_PICKCHILDREN) text = Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/Homepage'), align=uiconst.TOALL, state=uiconst.UI_DISABLED, parent=l, left=0, top=4, width=2) top = (text.textheight - 16) / 2 + 2 if text.textheight > 16 else 0 totalTop = top btn = Button(parent=r, label=localization.GetByLabel('UI/Browser/BrowserSettings/ResetHomepage'), func=self.ResetHomePage, pos=(0, top, 0, 0), align=uiconst.TOPRIGHT) if btn.width > 80: r.width = btn.width self.homeEdit = SinglelineEdit(name='homeEdit', setvalue=settings.user.ui.Get('HomePage2', browserutil.DefaultHomepage()), align=uiconst.TOTOP, pos=(0, top, 0, 0), parent=c) Line(parent=main, align=uiconst.TOTOP, color=(0.5, 0.5, 0.5, 0.75)) self.showHideContainer = Container(name='showHideContainer', parent=main, align=uiconst.TOTOP, height=35, top=0, state=uiconst.UI_PICKCHILDREN) self.showStatusBarCbx = Checkbox(text=localization.GetByLabel('UI/Browser/BrowserSettings/ShowStatusBar'), parent=self.showHideContainer, configName='', retval=0, checked=self.showStatusBar) self.showNavBarCbx = Checkbox(text=localization.GetByLabel('UI/Browser/BrowserSettings/ShowNavigationBar'), parent=self.showHideContainer, configName='', retval=0, checked=self.showNavigationBar) Line(parent=main, align=uiconst.TOTOP, color=(0.5, 0.5, 0.5, 0.75)) self.cacheContainer = Container(name='cacheContainer', parent=main, align=uiconst.TOTOP, height=26, top=8, state=uiconst.UI_PICKCHILDREN) l = Container(name='cacheLeft', parent=self.cacheContainer, align=uiconst.TOLEFT, width=100, state=uiconst.UI_PICKCHILDREN) r = Container(name='cacheRight', parent=self.cacheContainer, align=uiconst.TORIGHT, width=80, state=uiconst.UI_PICKCHILDREN) if not blue.win32.IsTransgaming(): text = Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/CacheLocation'), align=uiconst.TOLEFT, state=uiconst.UI_DISABLED, parent=l, padding=(2, 4, 2, 4)) top = (text.textheight - 16) / 2 + 2 if text.textheight > 16 else 0 totalTop += top btn = Button(parent=r, label=localization.GetByLabel('UI/Browser/BrowserSettings/ResetCacheLocation'), func=self.ResetCacheLocation, pos=(0, top, 0, 0), align=uiconst.TOPRIGHT) if btn.width > r.width: r.width = btn.width if text.textwidth > l.width: l.width = text.textwidth + 4 self.cacheEdit = SinglelineEdit(name='cacheEdit', setvalue=settings.public.generic.Get('BrowserCache', corebrowserutil.DefaultCachePath()), align=uiconst.TOTOP, pos=(0, top, 0, 0), parent=self.cacheContainer) explainContainer = Container(name='cacheExplainContainer', parent=main, align=uiconst.TOTOP, height=26) Label(text=localization.GetByLabel('UI/Browser/BrowserSettings/CacheCaption'), align=uiconst.TOALL, state=uiconst.UI_DISABLED, parent=explainContainer, padLeft=4, fontsize=10) totalTop += 26 clearCacheContainer = Container(name='clearCacheContainer', parent=main, align=uiconst.TOTOP, height=14) btn = Button(parent=clearCacheContainer, label=localization.GetByLabel('UI/Browser/BrowserSettings/ClearCache'), func=self.ClearCache) btn.hint = (localization.GetByLabel('UI/Browser/BrowserSettings/ClearCacheHint'),) totalTop += 16 else: totalTop -= 32 self.SetMinSize((500, 204 + totalTop)) sm.StartService('sites')
def ConstructLoginCont(self): Line(parent=self.loginCont, align=uiconst.TOTOP, padBottom=10, opacity=0.1) EveCaptionSmall(parent=self.loginCont, align=uiconst.TOTOP, text=GetByLabel('UI/Twitch/LoginCaption')) twitchSvc = sm.GetService('twitch') username = twitchSvc.GetUsername() if username is None or not twitchSvc.HasToken(): password = None else: password = PASSWORD_IF_HAS_TOKEN self.usernameCont = EditWithLabel(parent=self.loginCont, text=GetByLabel('UI/Login/Username'), value=username, OnChange=self.CheckEnableStreamBtn) self.passwordCont = EditWithLabel(parent=self.loginCont, text=GetByLabel('UI/Login/Password'), OnReturn=self.StartStream, OnChange=self.CheckEnableStreamBtn, OnSetFocus=self.OnPasswordContFocus) self.passwordCont.edit.SetPasswordChar(u'\u2022') self.passwordCont.edit.SetValue(password) Label(parent=self.loginCont, align=uiconst.TOTOP, state=uiconst.UI_NORMAL, padding=(LABELWIDTH, 7, 0, 0), text=GetByLabel('UI/Twitch/SignupLink'), fontsize=10) Line(parent=self.loginCont, align=uiconst.TOBOTTOM, idx=0, opacity=0.1)
def _DecorateCell(self, cell, hour, interval, lineColor, firstCol=False): Line(parent=cell, align=uiconst.TORIGHT, color=lineColor) if firstCol: Line(parent=cell, align=uiconst.TOLEFT, color=lineColor) if hour == 23: Line(parent=cell, align=uiconst.TOBOTTOM, color=lineColor) if hour % interval == 0: Line(parent=cell, align=uiconst.TOTOP, color=lineColor)
def Startup_textarea(self, wnd, attrs): if getattr(attrs, 'maxlength', None): wnd.SetMaxLength(attrs.maxlength) if hasattr(attrs, 'readonly'): wnd.ReadOnly() if attrs.value: wnd.SetValue(attrs.value) color = self.browser.attrStack[-1]['color'] Line(parent=wnd, align=uiconst.TOTOP, color=color, weight=1) Line(parent=wnd, align=uiconst.TOBOTTOM, color=color, weight=1) Line(parent=wnd, align=uiconst.TOLEFT, color=color, weight=1) Line(parent=wnd, align=uiconst.TORIGHT, color=color, weight=1)
def CreateSectionContainer(parent): Line(parent=parent, align=uiconst.TOTOP, color=LINE_COLOR) container = ContainerAutoSize(parent=parent, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=BACKGROUND_GRAY_COLOR) Line(parent=parent, align=uiconst.TOTOP, color=LINE_COLOR) SpriteThemeColored( bgParent=container, name='blinkSprite', texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png', state=uiconst.UI_HIDDEN, colorType=uiconst.COLORTYPE_UIHILIGHTGLOW) return container
def Startup_text(self, wnd, attrs, password=0): wnd.OnReturn = self.OnSubmit if password: wnd.SetPasswordChar('*') maxlength = getattr(attrs, 'maxlength', None) if maxlength is not None: wnd.SetMaxLength(int(maxlength)) if attrs.value: wnd.SetValue(attrs.value, updateIndex=0) if hasattr(self.browser, 'attrStack'): color = self.browser.attrStack[-1]['color'] Line(parent=wnd, align=uiconst.TOTOP, color=color, weight=1) Line(parent=wnd, align=uiconst.TOBOTTOM, color=color, weight=1) Line(parent=wnd, align=uiconst.TOLEFT, color=color, weight=1) Line(parent=wnd, align=uiconst.TORIGHT, color=color, weight=1)
def _ConstructGuideLines(self): self.centerDot = Line(name='centerDot', align=uiconst.TOPLEFT, weight=2, opacity=1.0, parent=self.layer, width=2, height=2, color=(0.6, 0.6, 0.6)) self.leftLine = self._MakeGuideLine(name='leftline', width=10, height=2, color=(1, 0, 0)) self.rightLine = self._MakeGuideLine(name='rightline', width=10, height=2, color=(0, 1, 0)) self.topLine = self._MakeGuideLine(name='topLine', width=10, height=2, color=(0, 0, 1)) self.bottomLine = self._MakeGuideLine(name='bottomLine', width=10, height=2, color=(0.5, 0.5, 1)) self.allLines = [ self.leftLine, self.rightLine, self.topLine, self.bottomLine, self.centerDot ]
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetWndIcon(None) self.SetCaption('Window manager') self.SetTopparentHeight(10) self.SetMinSize([360, 220]) options = [] for wndCls in Window.__subclasses__(): options.append((wndCls.__name__, wndCls)) options.sort() topCont = Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pad=(5, 5, 5, 5), pos=(0, 10, 0, 30)) self.mainCont = Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 50), padding=(5, 15, 5, 5)) self.extrasCont = Container(name='params', parent=self.sr.main, align=uiconst.TOALL, padding=(5, 15, 5, 5)) self.combo = Combo(parent=topCont, label='Select window', options=options, name='', select=settings.user.ui.Get('windowManagerOpenWindow'), callback=self.OnComboChanged, pos=(5, 0, 0, 0), width=150, align=uiconst.TOPLEFT) self.startupArgs = SinglelineEdit(name='', label='attributes', parent=topCont, setvalue='', align=uiconst.TOPLEFT, left=165, width=100) Button(parent=topCont, label='Load', align=uiconst.RELATIVE, func=self.OpenWindow, pos=(300, 0, 0, 0)) self.filenameEdit = SinglelineEdit(name='', label='Location', parent=self.mainCont, setvalue='', align=uiconst.TOTOP, top=15, readonly=True) Label(text='RELOAD', parent=self.extrasCont, top=10, state=uiconst.UI_NORMAL) Line(parent=self.extrasCont, align=uiconst.TOTOP) buttonCont = Container(name='buttonCont', parent=self.extrasCont, align=uiconst.TOTOP, pos=(0, 30, 0, 30)) Button(parent=buttonCont, label='ShipUI', align=uiconst.TOLEFT, func=self.ReloadShipUI) Button(parent=buttonCont, label='NEOCOM', align=uiconst.TOLEFT, func=self.ReloadNeocom, padLeft=1) Button(parent=buttonCont, label='Info Panels', align=uiconst.TOLEFT, func=self.ReloadInfoPanels, padLeft=1) Button(parent=buttonCont, label='Lobby', align=uiconst.TOLEFT, func=self.ReloadLobby, padLeft=1) Button(parent=buttonCont, label='Overview', align=uiconst.TOLEFT, func=self.ReloadOverview, padLeft=1) Button(parent=buttonCont, label='Mapbrowser', align=uiconst.TOLEFT, func=self.ReloadMapBrowser, padLeft=1) self.UpdateInfo(self.combo.GetKey(), self.combo.GetValue())
def ConstructOutputSection(self): self.CloseOutputSection() blue.pyos.synchro.Sleep(1000) self.CloseOutputSection() self.outputSection = Container(name='outputSection', parent=self.mainContainer, align=uiconst.TOTOP_PROP, height=0.5, padding=(5, 0, 5, 0)) self.outputHeader = Container(name='outputHeader', parent=self.outputSection, align=uiconst.TOTOP, height=50) Label(parent=self.outputHeader, text=GetByLabel( 'UI/Inflight/SpaceComponents/ItemTrader/DeliveredItems', itemCount=2), fontsize=25, align=uiconst.CENTER) Line(parent=self.outputHeader, align=uiconst.TOBOTTOM) self.outputListSection = ScrollContainer(name='outputListSection', parent=self.outputSection, align=uiconst.TOTOP, height=128) self.PopulateItemsToScroll(self.outputListSection, self.itemTrader.GetOutputItems())
def _MakeSeperationLine(self, parent): Line(name='topLine', parent=parent, align=uiconst.TOTOP, weight=1, padBottom=2, opacity=0.3)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) trustUrl = attributes.trustUrl inputUrl = attributes.inputUrl self.SetCaption(localization.GetByLabel('UI/Browser/AskTrustedSites')) self.SetMinSize((400, 300)) main = self.GetMainArea() self.ignoreAlwaysBtnPar = Container(name='ignoreAlwaysBtnPar', parent=main, align=uiconst.TOBOTTOM, height=22, top=2) self.ignoreBtnPar = Container(name='ignoreBtnPar', parent=main, align=uiconst.TOBOTTOM, height=22, top=2) self.trustBtn = Button(parent=self.ignoreBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/TrustSite'), align=uiconst.TOLEFT, pos=(4, 0, 0, 0), func=self.TrustSite) self.trustBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/TrustButtonHint') self.ignoreBtn = Button(parent=self.ignoreBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreOnce'), align=uiconst.TORIGHT, pos=(4, 0, 0, 0), func=self.IgnoreThisRequest) self.ignoreBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreOnceHint') self.ignoreAlwaysBtn = Button(parent=self.ignoreAlwaysBtnPar, label=localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreAlways'), align=uiconst.TORIGHT, pos=(4, 0, 0, 0), func=self.AlwaysIgnoreRequests) self.ignoreAlwaysBtn.hint = localization.GetByLabel('UI/Browser/TrustPrompt/IgnoreAlwaysHint') self.sourcePar = Container(name='sourcePar', parent=main, align=uiconst.TOBOTTOM, height=32) self.sourceTxtPar = Container(name='sourceTxtPar', parent=self.sourcePar, align=uiconst.TOTOP, height=14) self.sourceUrlPar = Container(name='sourceUrlPar', parent=self.sourcePar, align=uiconst.TOTOP, height=16) self.sourceTxt = Label(text=localization.GetByLabel('UI/Browser/TrustPrompt/RequestFrom'), parent=self.sourceTxtPar, state=uiconst.UI_DISABLED, color=(0.5, 0.5, 0.5, 0.7), align=uiconst.TOALL, padLeft=8) self.sourceUrl = Label(text=inputUrl, parent=self.sourceUrlPar, state=uiconst.UI_NORMAL, color=(0.5, 0.5, 0.5, 0.7), align=uiconst.TOALL, padLeft=8) self.sourceUrl.hint = inputUrl Line(parent=self.sourcePar, align=uiconst.TOTOP, color=(0.4, 0.4, 0.4, 0.9)) self.promptPar = Container(name='promptPar', parent=main, align=uiconst.TOALL, pos=(8, 2, 8, 2)) trustDescription = localization.GetByLabel('UI/Browser/TrustPrompt/TrustDescription', trustUrl=trustUrl) self.promptTxt = Edit(setvalue=trustDescription, parent=self.promptPar, readonly=1, align=uiconst.TOALL) self.trustUrl = trustUrl self.inputUrl = inputUrl
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.conditionText = attributes.Get('conditionText') self.conditionCount = attributes.Get('conditionCount') self.label = EveLabelMedium(name='myLabel', parent=self, align=uiconst.CENTERLEFT, text='', left=4, tabs=[200, 300], maxline=1) self.SetConditionText(self.conditionText, self.conditionCount) Line(parent=self, align=uiconst.TOBOTTOM, opacity=0.1)
def Build(self): width, height = self.parent.GetAbsoluteSize() if self.verticalAxis is not None: count = self.verticalAxis.gridLineCount for i in xrange(count): vertContainer = Container(parent=self, align=uiconst.TOTOP_PROP, height=1.0 / count) delta = float(i) / count color = geo2.Vec4Lerp(self.topColor, self.bottomColor, delta) Line(name='topLine', parent=vertContainer, align=uiconst.TOBOTTOM, padding=(0, 0, 0, 0), weight=1, color=color) if self.horizontalAxis is not None: verticalLines = self.horizontalAxis.GetGridLines() count = len(verticalLines) for i, line in enumerate(verticalLines): delta = float(i) / count color = geo2.Vec4Lerp(self.leftColor, self.rightColor, delta) VectorLine(parent=self, align=uiconst.TOALL, translationFrom=(line, 0), translationTo=(line, height), color=color, widthFrom=1.0, widthTo=1.0, spriteEffect=trinity.TR2_SFX_FILL) self.width = width self.height = height
def Prepare_Background_(self): Line(parent=self, idx=0, align=uiconst.TOBOTTOM, color=uiconst.ENTRY_LINE_COLOR) self.sr.background = Fill(parent=self, color=(0.0, 0.0, 0.0, 0.5), pos=(0, 1, 0, 1))
def ConstructTotalStrikethroughLine(self): if self.totalStrikethroughLine: return self.totalStrikethroughLine = Line(parent=self.totalCont, align=uiconst.CENTERRIGHT, pos=(2, 0, 0, 1), idx=0, color=(1, 1, 1, 0.8))
def PrepareMenuBar(self): mainArea = self.GetMainArea() self.menuBar = Container(name='menuBar', parent=mainArea, align=uiconst.TOTOP, height=16, padBottom=2) Line(parent=self.menuBar, align=uiconst.TOBOTTOM)
def _MakeGuideLine(self, name, width, height, color): return Line(name=name, align=uiconst.TOPLEFT, weight=2, opacity=1.0, parent=self.layer, width=width, height=height, color=color)
def PrepareLayout(self): Line(parent=self, align=uiconst.TORIGHT) self.textLabel = EveLabelSmall(text=self.name, parent=self, align=uiconst.CENTER, state=uiconst.UI_DISABLED) self.hilite = Fill(parent=self, state=uiconst.UI_HIDDEN, padding=1) self.width = self.textLabel.width + 10 self.cursor = uiconst.UICURSOR_SELECT
def ApplyAttributes(self, attributes): SE_BaseClassCore.ApplyAttributes(self, attributes) self.node = self.sr.node = attributes.node if not self.node.Get('hideLines', None): Line(align=uiconst.TOBOTTOM, parent=self, color=uiconst.ENTRY_LINE_COLOR) if self.node.selected: self.Select()
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.achievement = attributes.Get('achievement', None) textColor = (1.0, 0.5, 0.5) if self.achievement.completed: textColor = (0.0, 0.7, 0.0) self.label = EveLabelMedium(name='myLabel', parent=self, align=uiconst.CENTERLEFT, text='%s - %s' % (self.achievement.id, self.achievement.name), left=4, hint='bleggibleg', textColor=textColor) self.label.SetTextColor(textColor) self.hint = self.achievement.description Line(parent=self, align=uiconst.TOBOTTOM, opacity=0.1)
def Startup(self, *args): listentry.Generic.Startup(self, args) Line(parent=self, align=uiconst.TOBOTTOM) self.sr.legendColor = Container(name='legendColor', parent=self, align=uiconst.TOPLEFT, pos=(2, 2, 12, 12), idx=0) self.sr.colorFill = Fill(parent=self.sr.legendColor) Frame(parent=self.sr.legendColor, color=(0.25, 0.25, 0.25), idx=0)
def _ConstructResizeLine(self): if self.verticalAlignment is ExpandAlignmentConst.EXPAND_ALIGNMENT_VERTICAL_UP: resizeAlignment = uiconst.TOTOP else: resizeAlignment = uiconst.TOBOTTOM self.resizeLineCont = Container(parent=self.windowunderlay, name='resizeLineCont', align=uiconst.TOALL) self.resizeLine = Line(parent=self.resizeLineCont, color=(0, 0, 0, 0), align=resizeAlignment, weight=3, state=uiconst.UI_NORMAL) self.resizeLine.OnMouseDown = self.OnResizeLineMouseDown self.resizeLine.cursor = uiconst.UICURSOR_TOP_BOTTOM_DRAG self._DisableResize()
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.marketQuoteSvc = sm.GetService('marketQuote') self.InitializeVariables(attributes) self.SetCaption(GetByLabel(self.captionTextPath)) self.scope = 'station_inflight' self.SetTopparentHeight(0) self.mainCont = mainCont = Container(parent=self.sr.main, name='mainCont', padding=4) self.infoCont = Container(parent=mainCont, name='bottomCont', align=uiconst.TOBOTTOM, height=88, padTop=4) Line(parent=self.infoCont, align=uiconst.TOTOP) self.bottomLeft = Container(parent=self.infoCont, name='bottomLeft', padLeft=6, padTop=6) self.bottomRight = Container(parent=self.infoCont, name='bottomRight', align=uiconst.TORIGHT, width=250, padRight=6, padTop=6) self.dropCont = Container(parent=mainCont, name='dropCont', align=uiconst.TOTOP, height=28, state=uiconst.UI_NORMAL, padBottom=4) self.dropLabel = EveCaptionSmall(text=GetByLabel(self.dropLabelPath), parent=self.dropCont, align=uiconst.CENTER) self.dropLabel.opacity = 0.6 self.fakeItemsCont = Container(parent=self.dropCont, align=uiconst.TOALL, clipChildren=True) self.locationCont = Container(parent=mainCont, name='locationCont', align=uiconst.TOTOP) scrollCont = Container(parent=mainCont, name='scrollCont') self.itemsScroll = ScrollContainer(parent=scrollCont, id=self.scrollId) btnGroup = ButtonGroup(parent=self.sr.main, idx=0, line=False) btnGroup.AddButton(GetByLabel(self.tradeTextPath), self.PerformTrade, isDefault=self.tradeOnConfirm) btnGroup.AddButton(GetByLabel('UI/Generic/Cancel'), self.Cancel) self.DrawNumbers() corpAcctName = self._CanTradeForCorp() if corpAcctName is not None: self.DrawCheckBox(corpAcctName) self.globalDragHover = uicore.event.RegisterForTriuiEvents( uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
def CreateTreeIndent(self, attributes): Container(name='pad', parent=self, align=uiconst.TOLEFT, width=self.PADDING) for x in xrange(attributes.indent): c = Container(name='Indent', parent=self, align=uiconst.TOLEFT, width=ENTRY_HEIGHT) Line(parent=c, align=uiconst.TOLEFT)
def AddStation(self, station, buttonIsDisabled): parent = self.sameSolarSystem container = ContainerAutoSize(parent=parent, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0.2, 0.2, 0.2, 0.3)) container.DisableAutoSize() label = GetShowInfoLink(station['typeID'], station['name'], station['itemID']) EveLabelMediumBold(parent=container, height=30, align=uiconst.TOTOP, state=uiconst.UI_NORMAL, text=label, padding=(7, 8, 140, 5)) btn = Button(parent=container, label=GetByLabel('UI/Inventory/AssetSafety/DeliverBtn'), align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=140, fixedheight=25, pos=(5, 0, 0, 0), func=self.DoDeliver, args=station['itemID']) if buttonIsDisabled: btn.Disable() Line(parent=parent, align=uiconst.TOTOP, color=self.LINE_COLOR) container.EnableAutoSize()
def PrepareLayout(self): Line(parent=self, align=uiconst.TORIGHT) self.label = Label(text=self.name, parent=self, align=uiconst.CENTER, fontsize=9, letterspace=1, top=1, state=uiconst.UI_DISABLED, uppercase=1) self.hilite = Fill(parent=self, state=uiconst.UI_HIDDEN, padding=1) self.width = self.label.width + 10 self.cursor = uiconst.UICURSOR_SELECT
def _construct_season_expander(self): expander_container = Container(name='expander_container', parent=self, align=uiconst.TOTOP, height=SEASON_EXPANDER_HEIGHT) add_base_border_line_to_container(expander_container, uiconst.TOLEFT) self.expander_bottom_line = Line( parent=expander_container, align=uiconst.TOBOTTOM, weight=SEASON_DEFAULT_BORDER_LINE_WEIGHT, color=SEASON_DEFAULT_BORDER_LINE_COLOR, state=uiconst.UI_HIDDEN) expander_content_container = Container( name='expander_container', parent=expander_container, align=uiconst.TOTOP, height=expander_container.height, state=uiconst.UI_NORMAL) fill_default_background_color_for_container(expander_content_container) EveLabelMediumBold(name='expander_label', parent=expander_content_container, text=SEASON_EXPANDER_LABEL_TEXT, align=uiconst.CENTERLEFT, padLeft=SEASON_BASE_PADDING) expander_sprite_container = Container( name='expander_sprite_container', parent=expander_content_container, align=uiconst.TORIGHT, width=SEASON_EXPANDER_SPRITE_SIZE, padRight=SEASON_BASE_PADDING) self.expander_sprite = Sprite( name='expander_sprite', parent=expander_sprite_container, texturePath=SEASON_EXPANDER_ARROW_RES_PATH, align=uiconst.CENTER, width=SEASON_EXPANDER_SPRITE_SIZE, height=SEASON_EXPANDER_SPRITE_SIZE) expander_content_container.OnClick = self._toggle_display_season self.expander_sprite.OnClick = self._toggle_display_season
def AddBackground(self, where, s): for i, side in enumerate(['top', 'left', 'right', 'bottom']): if s['border-%s-width' % side]: align = [ uiconst.TOTOP, uiconst.TOLEFT, uiconst.TORIGHT, uiconst.TOBOTTOM ][i] Line(parent=where, align=align, weight=s['border-%s-width' % side], color=s['border-%s-color' % side], idx=0) if s['background-image'] and where.sr.background: browser = GetBrowser(self) currentURL = None if browser: currentURL = browser.sr.currentURL texture, tWidth, tHeight = sm.GetService( 'browserImage').GetTextureFromURL( s['background-image'], currentURL, fromWhere='VirtualTable::AddBackground') pic = Sprite() pic.left = pic.top = 0 pic.width = tWidth pic.height = tHeight pic.texture = texture row = Container(name='row', align=uiconst.TOTOP, pos=(0, 0, 0, tHeight), clipChildren=1) if s['background-repeat'] in ('repeat', 'repeat-x'): for x in xrange(max(where.width / tWidth, 2) + 1): row.children.append(pic.CopyTo()) pic.left += pic.width else: row.children.append(pic.CopyTo()) if s['background-repeat'] in ('repeat', 'repeat-y'): for y in xrange(max(where.height / tHeight, 2) + 1): row.height = min(where.height - tHeight * y, row.height) where.sr.background.children.append(row.CopyTo()) else: where.sr.background.children.append(row.CopyTo()) if s['background-color']: Fill(parent=where, color=s['background-color'])
def GetHistoryMenuEntry(self, displayText, text, menuSub, mp, info = None): ep = Container(name='entryParent', parent=menuSub, clipChildren=1, pos=(0, 0, 0, 16), align=uiconst.TOTOP, state=uiconst.UI_NORMAL) ep.OnMouseEnter = (self.HEMouseEnter, ep) ep.OnMouseDown = (self.HEMouseDown, ep) ep.OnMouseUp = (self.HEMouseUp, ep) Line(parent=ep, align=uiconst.TOBOTTOM) t = Label(text=displayText, parent=ep, left=6, align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED) ep.height = t.textheight + 4 ep.sr.hilite = Fill(parent=ep, color=(1.0, 1.0, 1.0, 0.25), pos=(1, 1, 1, 1), state=uiconst.UI_HIDDEN) ep.selected = 0 ep.sr.menu = mp ep.string = text mp.height += ep.height if self.dynamicHistoryWidth: mp.width = max(mp.width, t.width + 12) ep.info = info