def LoadLogo(self, corporationID): if self is None or self.destroyed: return loc = getattr(self, 'logoContainer', None) if loc is not None: uix.Flush(loc) uiutil.GetLogoIcon(itemID=corporationID, parent=loc, align=uiconst.RELATIVE, name='logo', state=uiconst.UI_NORMAL, left=12, top=3, idx=0, size=48, ignoreSize=True) loc = getattr(self, 'captionContainer', None) if loc is not None: uix.Flush(loc) caption = uicontrols.CaptionLabel(text=localization.GetByLabel( 'UI/Corporations/CorpUIHome/CorpNamePlaceholder', corpName=cfg.eveowners.Get(eve.session.corpid).ownerName), parent=loc, align=uiconst.RELATIVE, uppercase=False) caption.left = 0 infoicon = uicontrols.InfoIcon(typeID=const.typeCorporation, itemID=corporationID, parent=loc, size=16, left=caption.width + 4, top=3, state=uiconst.UI_NORMAL)
def SetDoublePaneView(self, briefingHtml = None, objectiveHtml = None): if self.viewMode == 'DoublePaneView': if briefingHtml: self.LoadHTML(briefingHtml, 'briefingBrowser') if objectiveHtml: self.LoadHTML(objectiveHtml, 'objectiveBrowser') if self.buttonCache: uix.Flush(self.sr.rightPaneBottom) self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom) return if briefingHtml: self.SetHTML(briefingHtml, 'briefingBrowser') if objectiveHtml: self.SetHTML(objectiveHtml, 'objectiveBrowser') uix.Flush(self.sr.main) self.sr.leftPane = uicls.Container(name='leftPane', parent=self.sr.main, align=uiconst.TOLEFT, height=self.paneHeight, width=self.paneWidth, left=0, top=0) uicls.Container(name='bottomBorder', parent=self.sr.leftPane, align=uiconst.TOBOTTOM, height=1) self.sr.rightPane = uicls.Container(name='rightPane', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) uicls.Line(parent=self.sr.rightPane, align=uiconst.TOLEFT) self.sr.rightPaneBottom = uicls.Container(name='rightPaneBottom', parent=self.sr.rightPane, align=uiconst.TOBOTTOM, height=self.rightPaneBottomHeight, width=self.mainContainerWidth, left=0, top=0) self.sr.rightPaneTop = uicls.Container(name='rightPaneTop', parent=self.sr.rightPane, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.SetMinSize([self.windowWidth, self.windowHeight]) self.LockWidth(self.windowWidth) self.viewMode = 'DoublePaneView' if self.buttonCache: self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom) self.InitializeBrowsers() for browserName in self.htmlCache: self.LoadHTML(self.htmlCache[browserName], browserName)
def _LoadSvc(self, inout, service=None): self.loading = 1 wnd = self.GetUnderlay() newsvc = None if inout == 1 and wnd is not None: self.ClearHint() newsvc, svctype = self.SetupService(wnd, service) if wnd.absoluteRight - wnd.absoluteLeft < 700 and inout == 1: sm.GetService('neocom').Minimize() height = uicore.desktop.height - 180 wnd.state = uiconst.UI_PICKCHILDREN if inout == 1: sm.GetService('neocom').SetLocationInfoState(0) wnd.height = height if inout: wnd.top = -height uicore.effect.MorphUI(wnd, 'top', [-height, 0][inout], 500.0, 1, 1) snd = service if inout == 0: snd = self.selected_service if snd is not None: eve.Message('LoadSvc_%s%s' % (snd, ['Out', 'In'][inout])) blue.pyos.synchro.SleepWallclock([750, 1250][inout]) if inout == 0: sm.GetService('neocom').SetLocationInfoState(1) if newsvc is not None: if svctype == 'form': newsvc.Startup(self) elif settings.user.ui.Get('nottry', 0): newsvc.Initialize(wnd.sr.svcparent) else: try: newsvc.Initialize(wnd.sr.svcparent) except: log.LogException(channel=self.__guid__) sys.exc_clear() self.active_service = newsvc self.selected_service = service else: uix.Flush(wnd.sr.svcparent) if self.active_service and hasattr(self.active_service, 'Reset'): self.active_service.Reset() self.active_service = None self.selected_service = service self.loading = 0 if inout == 0 and service is not None: self._LoadSvc(1, service) if inout == 0 and service is None: uix.Flush(wnd.sr.svcparent)
def SetupService(self, wnd, servicename): uix.Flush(wnd.sr.svcparent) svc = None topheight = 128 btmheight = 0 icon = 'ui_9_64_14' sz = 128 top = -16 icon = uicls.Icon(icon=icon, parent=wnd.sr.svcparent, left=0, top=top, size=sz, idx=0) iconpar = uicls.Container(name='iconpar', parent=wnd.sr.svcparent, align=uiconst.TOTOP, height=96, clipChildren=1, state=uiconst.UI_PICKCHILDREN) bigicon = icon.CopyTo() bigicon.width = bigicon.height = sz * 2 bigicon.top = -64 bigicon.color.a = 0.1 iconpar.children.append(bigicon) closeX = uicls.Icon(icon='ui_38_16_220') closeX.align = uiconst.TOPRIGHT closeX.left = closeX.top = 2 closeX.OnClick = self.CloseSvc iconpar.children.append(closeX) line = uicls.Line(parent=iconpar, align=uiconst.TOPRIGHT, height=1, left=2, top=16, width=18) icon.state = uiconst.UI_DISABLED wnd.sr.caption.text = self.GetServiceDisplayName(servicename) wnd.sr.caption.state = uiconst.UI_DISABLED return (svc, 'service')
def ExpandActionMenu(self, itemID, x, y, clickedObject, **kwargs): if util.IsCharacter(itemID): kwargs['charID'] = itemID slimItem = util.SlimItemFromCharID(itemID) if slimItem: itemID = slimItem.itemID else: slimItem = uix.GetBallparkRecord(itemID) isRadialMenuButtonActive = spaceRadialMenuFunctions.IsRadialMenuButtonActive( ) if not isRadialMenuButtonActive: return uix.Flush(uicore.layer.menu) radialMenuClass = kwargs.get('radialMenuClass', uicls.RadialMenuSpace) radialMenu = radialMenuClass(name='radialMenu', parent=uicore.layer.menu, state=uiconst.UI_HIDDEN, align=uiconst.TOPLEFT, updateDisplayName=True, slimItem=slimItem, itemID=itemID, x=x, y=y, clickedObject=clickedObject, **kwargs) uicore.layer.menu.radialMenu = radialMenu uicore.uilib.SetMouseCapture(radialMenu) isRadialMenuButtonActive = spaceRadialMenuFunctions.IsRadialMenuButtonActive( ) if not isRadialMenuButtonActive: radialMenu.Close() return sm.StartService('state').SetState(itemID, state.mouseOver, 0) radialMenu.state = uiconst.UI_NORMAL sm.ScatterEvent('OnRadialMenuExpanded')
def OnSpeakingEvent_Local(self, data): if self.destroyed: return caption = localization.GetByLabel( 'UI/Fleet/FleetBroadcast/BroadcastEventSpeaking', charID=data.charID, channelName=data.channelName) iconName = '73_35' roleIcon = fleetbr.GetRoleIconFromCharID(data.charID) uix.Flush(self.sr.lastVoiceEventCont) t = uicontrols.EveLabelMedium(text=caption, parent=self.sr.lastVoiceEventCont, align=uiconst.TOALL, left=25, maxLines=1) lt = t lt.GetMenu = lambda: fleetbr.GetVoiceMenu(None, data.charID, data. channelID) lt.hint = localization.GetByLabel( 'UI/Fleet/FleetBroadcast/VoiceBroadcastReceivedAt', time=data.time) icon = uicontrols.Icon(align=uiconst.RELATIVE, left=6, top=0, icon=iconName, width=16, height=16) icon.state = uiconst.UI_DISABLED self.sr.lastVoiceEventCont.children.append(icon)
def Load(self, data): uix.Flush(self.sr.icon) uix.Flush(self.sr.status) self.typeID = data.typeInfo.typeID self.typeInfo = data.typeInfo self.groupID = data.groupID self.item = data.typeInfo.item self.hubID = data.hubID if self.item is None: self.itemID = None self.flagID = None else: self.itemID = self.item.itemID self.flagID = self.item.flagID if data.Get('selected', 0): self.Select() else: self.Deselect() sovSvc = sm.GetService('sov') self.sr.nameLabel.text = '%s' % self.typeInfo.typeName info = sovSvc.GetUpgradeLevel(self.typeID) if info is None: levelText = '' else: levelText = localization.GetByLabel('UI/InfrastructureHub/LevelX', level=sovSvc.GetUpgradeLevel(self.typeID).level) self.sr.levelLabel.text = levelText uicontrols.Icon(parent=self.sr.icon, align=uiconst.CENTER, pos=(0, 0, 24, 24), ignoreSize=True, typeID=self.typeID, size=24) if self.item is not None: statusIconPath = 'ui_38_16_193' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeAlreadyInstalled') elif self.typeInfo.canInstall: statusIconPath = 'ui_38_16_195' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeMeetsRequirements') else: statusIconPath = 'ui_38_16_194' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeRequirementsNotMet') statusIcon = uicontrols.Icon(icon=statusIconPath, parent=self.sr.status, align=uiconst.CENTER, pos=(0, 0, 16, 16)) statusIcon.hint = hint if self._CanUpgradeBeManuallyToggled(): self.MakeFlagSwitch() else: self.SetFlagIcon() hinttext = localization.GetByLabel('UI/InfrastructureHub/PrereqsShort', level=sovSvc.GetUpgradeLevel(self.typeID).level) preReqs = sovSvc.GetPrerequisite(self.typeID) if preReqs is not None: hinttext = localization.GetByLabel('UI/InfrastructureHub/PrereqsLong', level=sovSvc.GetUpgradeLevel(self.typeID).level, preReqs=preReqs) self.hint = hinttext
def SetEndPointDates(self): uix.Flush(self.sr.dates) uicls.EveLabelMedium(text=util.FmtDate(blue.os.GetWallclockTime()), parent=self.sr.dates, align=uiconst.TORIGHT) uicls.EveLabelMedium(text=util.FmtDate(blue.os.GetWallclockTime()), parent=self.sr.dates, align=uiconst.TOLEFT)
def Refresh(self, *args): self.station_inited = 0 self.search_inited = 0 self.filt_inited = 0 try: self.scrollPosition[ self.key] = self.sr.scroll.GetScrollProportion() except: self.scrollPosition[self.key] = 0.0 uix.Flush(self.sr.main) self.sr.scroll = uicontrols.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll.sr.id = 'assets' self.sr.scroll.sr.minColumnWidth = { localization.GetByLabel('UI/Common/Name'): 44 } self.sr.scroll.allowFilterColumns = 1 self.sr.scroll.OnNewHeaders = self.ReloadTabs self.sr.scroll.sortGroups = True self.sr.scroll.SetColumnsHiddenByDefault( uix.GetInvItemDefaultHiddenHeaders()) tabs = [ [ localization.GetByLabel('UI/Inventory/AssetsWindow/AllItems'), self.sr.scroll, self, 'allitems' ], [ localization.GetByLabel('UI/Common/LocationTypes/Region'), self.sr.scroll, self, 'regitems' ], [ localization.GetByLabel( 'UI/Common/LocationTypes/Constellation'), self.sr.scroll, self, 'conitems' ], [ localization.GetByLabel('UI/Common/LocationTypes/SolarSystem'), self.sr.scroll, self, 'sysitems' ], [ localization.GetByLabel('UI/Common/Buttons/Search'), self.sr.scroll, self, 'search' ] ] if eve.session.stationid: tabs.insert(4, [ localization.GetByLabel('UI/Common/LocationTypes/Station'), self.sr.scroll, self, 'station' ]) self.sr.maintabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=0, tabs=tabs, groupID='assetspanel', silently=True)
def SetHint(self, hint): hp = self.sr.hintCont uix.Flush(hp) if hint: t = uicontrols.EveLabelMedium(text=hint, parent=hp, top=-3, align=uiconst.CENTER, width=self.minsize[0] - 32, state=uiconst.UI_DISABLED) hp.state = uiconst.UI_DISABLED hp.height = t.height + 4 else: hp.state = uiconst.UI_HIDDEN
def SetBroadcastScopeButton(self): uix.Flush(self.sr.toggleCont) scope = sm.GetService('fleet').broadcastScope hint = localization.GetByLabel('UI/Fleet/FleetBroadcast/CycleBroadcastScope', scope=fleetbr.GetBroadcastScopeName(scope)) self.sr.broadcastScopeButton = par = xtriui.FleetAction(parent=self.sr.toggleCont, align=uiconst.TOPRIGHT, top=4, left=4, width=21, height=16, state=uiconst.UI_NORMAL) icon = {fleetcommon.BROADCAST_DOWN: 'ui_73_16_28', fleetcommon.BROADCAST_UP: 'ui_73_16_27', fleetcommon.BROADCAST_ALL: 'ui_73_16_29'}.get(scope, 'ui_73_16_28') par.OnClick = self.CycleBroadcastScope par.Startup(hint, icon)
def OnEntrySelected(self, typeID): uix.Flush(self.sr.icon) typeIcon = uicls.Icon(parent=self.sr.icon, align=uiconst.TOPLEFT, pos=(0, 10, 64, 64), ignoreSize=True, typeID=typeID, size=64) text = cfg.invtypes.Get(typeID).description info = localization.GetByLabel('UI/InfrastructureHub/EntryDescription', item=typeID, description=text) self.sr.desc.SetValue(info)
def SetSinglePaneView(self, briefingHtml=None): if self.viewMode == 'SinglePaneView': if briefingHtml: self.LoadHTML(briefingHtml, 'briefingBrowser') if self.buttonCache: uix.Flush(self.sr.rightPaneBottom) self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom) return if briefingHtml: self.SetHTML(briefingHtml, 'briefingBrowser') uix.Flush(self.sr.main) self.sr.rightPaneBottom = FlowContainer( name='rightPaneBottom', parent=self.sr.main, align=uiconst.TOBOTTOM, contentSpacing=uiconst.BUTTONGROUPMARGIN, centerContent=True, padding=(6, 0, 6, 6)) self.sr.leftPane = uiprimitives.Container(name='leftPane', parent=self.sr.main, align=uiconst.TOLEFT, height=self.paneHeight, width=self.paneWidth, left=0, top=0) self.sr.rightPaneTop = uiprimitives.Container(name='rightPaneTop', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.sr.rightPaneTop.state = uiconst.UI_HIDDEN self.SetMinSize([self.mainContainerWidth / 2 + 10, self.windowHeight]) self.LockWidth(self.mainContainerWidth / 2 + 10) self.viewMode = 'SinglePaneView' if self.buttonCache: self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom) self.InitializeBrowsers() if 'briefingBrowser' in self.htmlCache: self.LoadHTML(self.htmlCache['briefingBrowser'], 'briefingBrowser')
def SetHint(self, hint): hp = uiutil.GetChild(self, 'hintparent') uix.Flush(hp) if hint: t = uicls.EveLabelMedium(text=hint, parent=hp, top=-3, width=self.minsize[0] - 32, state=uiconst.UI_DISABLED, align=uiconst.CENTER) hp.state = uiconst.UI_PICKCHILDREN hp.height = t.height + 8 else: hp.state = uiconst.UI_HIDDEN
def _MarkAreas(self, areas): size = self.absoluteRight - self.absoluteLeft uix.Flush(self.sr.areas) for area in areas: id, hint, (absX, absY, absZ), radius, color = area maxdist = self.GetMaxDist() sizefactor = size / 2 / maxdist * self.fillSize x = FLIPMAP * absX * sizefactor / float(size) + 0.5 y = absZ * sizefactor / float(size) + 0.5 rad = radius * sizefactor / float(size) mark = uiprimitives.Sprite(parent=self.sr.areas, name='area', left=int(int(x * size) - mark.width / 2), top=int(int(y * size) - mark.height / 2 + 1), width=int(rad * size * 2), height=int(rad * size * 2), state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/circle_full.png', color=(1.0, 0.2, 0.2, 1.0)) mark.sr.x = x mark.sr.y = y mark.sr.rad = rad
def Load(self, node): self.sr.node = node data = node self.corporationID = data.corporationID self.confirmOnDblClick = data.Get('confirmOnDblClick', 0) self.sr.label.text = data.label self.hint = data.Get('hint', '') or self.sr.label.text.replace( '<t>', ' ') self.sr.icon.state = uiconst.UI_NORMAL uix.Flush(self.sr.icon) uiutil.GetLogoIcon(itemID=data.corporationID, parent=self.sr.icon, acceptNone=False, align=uiconst.TOALL) self.sr.infoicon.OnClick = self.ShowInfo self.sr.infoicon.state = uiconst.UI_NORMAL for eventName in self.sr.events: if data.Get(eventName, None): self.sr.Set(eventName, data.Get(eventName, None)) if node.Get('selected', 0): self.sr.selection.state = uiconst.UI_DISABLED else: self.sr.selection.state = uiconst.UI_HIDDEN self.sr.hilite.state = uiconst.UI_HIDDEN self.sr.label.top = int((self.height - self.sr.label.textheight) / 2) if data.Get('button', None): caption, size, function, args = data.button if self.sr.Get('button%s' % size, None) is None: btn = self.sr.Get( 'button%s' % size, uicls.Button(parent=self, label=caption, func=function, align=uiconst.TOPRIGHT)) btn.top = (node.height - btn.height) / 2 - 3 setattr(self.sr, 'button%s' % size, btn) btn = self.sr.Get('button%s' % size, None) btn.text = '<center>%s' % caption btn.OnClick = (function, args) btn.state = uiconst.UI_NORMAL btn.left = -size + 6 + node.height * (self.sr.infoicon.state == uiconst.UI_NORMAL) else: for size in [51, 66, 81]: if self.sr.Get('button%s' % size, None): self.sr.Get('button%s' % size, None).state = uiconst.UI_HIDDEN
def Error(self, error): ep = uiutil.GetChild(self, 'errorParent') uix.Flush(ep) if error: t = uicls.EveLabelMedium(text=localization.GetByLabel( 'UI/Control/ListWindow/DisplayError', errorMessage=error), top=-3, parent=ep, width=self.minsize[0] - 32, state=uiconst.UI_DISABLED, color=(1.0, 0.0, 0.0, 1.0), align=uiconst.CENTER) ep.state = uiconst.UI_DISABLED ep.height = t.height + 8 else: ep.state = uiconst.UI_HIDDEN
def Load(self, template): entries = [] headers = ['qty', 'name'] state = uiconst.UI_NORMAL if template: if template.Valid(): self.typeID = template.typeID info = template.GetModuleInfo() capt = GetTypeName(template.typeID) name = template.name for typeID in info['modulelist']: entries.append(listentry.Get('Generic', {'label': '%s<t>%s' % (info[typeID], GetTypeName(typeID)), 'typeID': typeID, 'showinfo': True})) else: state = uiconst.UI_HIDDEN capt = 'TEMPLATE ERROR' name = 'This template does not contain a valid ship setup' entries.append(listentry.Get('Generic', {'label': '%s<t>%s' % (template.errorTypeID, template.errorMessage)})) headers = ['typeID', 'error'] else: state = uiconst.UI_HIDDEN capt = name = '' uix.Flush(self.toolbar) if state == uiconst.UI_NORMAL: self.icon.LoadIconByTypeID(template.typeID) m = template.GetMenuInline(info=False, store=not self.readonly, spiffy=True) x = 0 for item in m: if item: hint, icon = item[0] btn = uix.GetBigButton(TOOLSIZE, self.toolbar, left=x, hint=hint) btn.sr.icon.LoadIcon(icon) btn.sr.icon.left += 1 btn.sr.icon.top += 2 btn.menuitem = item btn.OnClick = (self.Clicketyclick, btn) x += TOOLSIZE else: self.typeID = None self.icon.LoadTexture('res:/UI/Texture/notavailable.dds') self.capt.text = capt self.text.text = name self.infoframe.state = self.infoicon.state = self.toolbar.state = state self.scroll.Load(contentList=entries, headers=headers)
def Load(self, node): listentry.LabelTextTop.Load(self, node) uix.Flush(self.sr.medalribbonobject) typeID = node.Get('typeID', None) itemID = node.Get('itemID', None) abstractinfo = node.Get('abstractinfo', None) if None not in (typeID, itemID, abstractinfo): self.sr.infoicon.state = uiconst.UI_NORMAL else: self.sr.infoicon.state = uiconst.UI_HIDDEN size = node.Get('iconsize', 32) self.sr.icon.state = uiconst.UI_HIDDEN self.sr.medalribbonobject.width = size * 2 self.sr.medalribbonobject.height = size self.sr.medalribbonobject.left = 8 self.sr.medalribbonobject.top = 3 self.sr.medalribbonobject.Startup(node.abstractinfo, size) self.sr.label.left = self.sr.text.left = 32
def InitBroadcastBottom(self): self.sr.broadcastBottom = uicls.Container(name='broadcastBottom', parent=self.sr.main, align=uiconst.TOBOTTOM, height=BROADCAST_HEIGHT, state=uiconst.UI_HIDDEN) broadcastHeaderParent = uicls.Container(name='lastbroadcastheader', parent=self.sr.main, align=uiconst.TOBOTTOM, state=uiconst.UI_NORMAL, height=24) broadcastHeaderParent.padBottom = 3 expanderCont = uicls.Container(name='expanderCont', parent=broadcastHeaderParent, align=uiconst.TORIGHT, state=uiconst.UI_NORMAL, width=18) expanderCont.OnClick = self.ToggleBroadcasts broadcastHeaderParent.height = 16 self.sr.broadcastHeaderParent = broadcastHeaderParent expander = uicls.Sprite(parent=expanderCont, pos=(5, 0, 11, 11), name='expandericon', state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/Shared/expanderUp.png', align=uiconst.TOPRIGHT) self.sr.broadcastExpanderIcon = expander uix.Flush(self.sr.broadcastBottom) self.sr.lastBroadcastCont = uicls.Container(name='lastBroadcastCont', parent=broadcastHeaderParent, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_NORMAL) uicls.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoBroadcasts'), parent=self.sr.lastBroadcastCont, left=6, top=1, width=500, state=uiconst.UI_NORMAL) self.sr.lastVoiceEventCont = uicls.Container(name='lastVoiceEventCont', parent=self.sr.broadcastBottom, align=uiconst.TOTOP_PROP, top=0, left=0, height=1.0, width=1.0, state=uiconst.UI_PICKCHILDREN) uicls.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoVoiceBroadcasts'), parent=self.sr.lastVoiceEventCont, left=6, top=0, width=500) self.sr.actionsCont = uicls.Container(name='actionsCont', parent=self.sr.broadcastBottom, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_NORMAL) self.sr.toggleCont = uicls.Container(name='toggleCont', parent=self.sr.actionsCont, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_PICKCHILDREN) self.sr.line = uicls.Container(name='lineparent', align=uiconst.TOTOP, parent=self.sr.actionsCont, idx=0, height=1) uicls.Line(parent=self.sr.line, align=uiconst.TOALL) self.InitActions()
def Load(self, data): uix.Flush(self.sr.icon) uix.Flush(self.sr.status) self.typeID = data.typeInfo.typeID self.typeInfo = data.typeInfo self.item = data.typeInfo.item self.hubID = data.hubID if self.item is None: self.itemID = None self.online = None else: self.itemID = self.item.itemID self.online = self.item.online if data.Get('selected', 0): self.sr.selection.state = uiconst.UI_DISABLED else: self.sr.selection.state = uiconst.UI_HIDDEN sovSvc = sm.GetService('sov') self.sr.nameLabel.text = '%s' % self.typeInfo.typeName info = sovSvc.GetUpgradeLevel(self.typeID) if info is None: levelText = '' else: levelText = localization.GetByLabel('UI/InfrastructureHub/LevelX', level=sovSvc.GetUpgradeLevel( self.typeID).level) self.sr.levelLabel.text = levelText typeIcon = uicls.Icon(parent=self.sr.icon, align=uiconst.CENTER, pos=(0, 0, 24, 24), ignoreSize=True, typeID=self.typeID, size=24) hint = '' if self.item is not None: statusIconPath = 'ui_38_16_193' hint = localization.GetByLabel( 'UI/InfrastructureHub/UpgradeAlreadyInstalled') elif self.typeInfo.canInstall: statusIconPath = 'ui_38_16_195' hint = localization.GetByLabel( 'UI/InfrastructureHub/UpgradeMeetsRequirements') else: statusIconPath = 'ui_38_16_194' hint = localization.GetByLabel( 'UI/InfrastructureHub/UpgradeRequirementsNotMet') statusIcon = uicls.Icon(icon=statusIconPath, parent=self.sr.status, align=uiconst.CENTER, pos=(0, 0, 16, 16)) statusIcon.hint = hint self.SetOnline(self.online) hinttext = localization.GetByLabel('UI/InfrastructureHub/PrereqsShort', level=sovSvc.GetUpgradeLevel( self.typeID).level) preReqs = sovSvc.GetPrerequisite(self.typeID) if preReqs is not None: hinttext = localization.GetByLabel( 'UI/InfrastructureHub/PrereqsLong', level=sovSvc.GetUpgradeLevel(self.typeID).level, preReqs=preReqs) self.hint = hinttext
def AddSliders(self, *args): self.currentselection = None self.ribbonsliders = [] self.medalsliders = [] uix.Flush(self.sr.main) ribbondata = [ xtriui.Ribbon, [('', None, None), ('', None, None), ('', None, None), ('', None, None), ('', None, None)] ] medaldata = [ xtriui.Medal, [('', None, None), ('', None, None), ('', None, None), ('', None, None)] ] top = 0 imgSize = 128 self.sr.buttoncont = uicls.Container(name='Buttons', align=uiconst.TOBOTTOM, parent=self.sr.main) self.sr.mainpar = uicls.Container(name='MainPar', align=uiconst.TOALL, parent=self.sr.main, pos=(0, 0, 0, 0)) mp = uicls.Container(name='Left', align=uiconst.TOLEFT, width=imgSize, left=const.defaultPadding, top=const.defaultPadding, parent=self.sr.mainpar) medalribbonobject = xtriui.MedalRibbon(name='MedalRibbonParent', width=128, height=256, parent=mp, align=uiconst.CENTER) medalribbonobject.Startup([ribbondata, medaldata], imgSize * 2) self.sr.medalribbonobject = medalribbonobject btns = [] btns.append([ localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/Submit'), self.SubmitData, None, None ]) btns.append([ localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/Reset'), self.AddSliders, None, None ]) buttons = uicls.ButtonGroup(btns=btns, parent=self.sr.buttoncont, unisize=0) self.sr.buttoncont.height = 20 if not len(btns) else buttons.height uicls.Line(parent=self.sr.mainpar, align=uiconst.TOLEFT) self.sr.mainselector = uicls.Container(name='MainSelector', align=uiconst.TOALL, parent=self.sr.mainpar, pos=(const.defaultPadding, 0, const.defaultPadding, 0)) uix.GetContainerHeader( localization.GetByLabel('UI/Contracts/BasicInfo'), self.sr.mainselector, 0, -4) uicls.Container(name='push', align=uiconst.TOTOP, height=6, parent=self.sr.mainselector) medalnamecont = uicls.Container(parent=self.sr.mainselector, align=uiconst.TOTOP) uicls.Container(name='push', align=uiconst.TOTOP, height=24, parent=medalnamecont) uicls.Container(name='push', align=uiconst.TOLEFT, width=4, parent=medalnamecont) uicls.Container(name='push', align=uiconst.TORIGHT, width=4, parent=medalnamecont) self.sr.medalname = uicls.SinglelineEdit( name='medalname', parent=medalnamecont, setvalue=None, pos=(0, 12, 284, 0), label=localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/DecorationName'), maxLength=100) top = const.defaultPadding + self.sr.medalname.top + self.sr.medalname.height uicls.EveLabelSmall(text=localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/Description'), parent=medalnamecont, top=top, width=100) self.sr.medaldesc = uicls.EditPlainText(setvalue='', parent=medalnamecont, align=uiconst.TOPLEFT, name='medaldesc', maxLength=1000, top=top + 16, left=-1, width=286, height=64) medalnamecont.height = self.sr.medalname.height + self.sr.medaldesc.height + 8 + 23 uicls.Container(name='push', align=uiconst.TOTOP, height=4, parent=self.sr.mainselector) uix.GetContainerHeader( localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/Ribbon'), self.sr.mainselector, 1, -4) labels = ['caldari', 'minmatar', 'gallente', 'amarr'] data = [] for label in labels: data.append([ xtriui.Ribbon, [(label, '1_1', None), ('', None, None), ('', None, None), ('', None, None), (label, '1_2', None)] ]) slider = self.GetImageSlider(data) slider.SetParentListener(self.sr.medalribbonobject.sr.ribbon, None) slider.SetAlign(uiconst.TOPRIGHT) slider.PostOnClick = self.PostOnClick self.sr.baseribbonslider = slider self.ribbonsliders.append(slider) parent = slider.parent colorPreview = xtriui.ColorPreview(name='colorPreview', align=uiconst.TORIGHT, height=32, width=32) uicls.Frame(parent=colorPreview) colorPreview.Startup() colorPreview.sr.layerid = 4 colorPreview.sr.dad = self.sr.medalribbonobject.sr.ribbon colorPreview.FromInt(-330271) colorPreview.state = uiconst.UI_HIDDEN push = uicls.Container(name='push', align=uiconst.TORIGHT, height=32, width=4) slider.parent.children.insert(0, push) slider.parent.children.insert(0, colorPreview) ranger = range(1, 4) ranger.reverse() for x in ranger: data = [] data = self.GetRibbonShapeData('Caldari') slider = self.GetImageSlider(data, True) slider.SetParentListener(self.sr.medalribbonobject.sr.ribbon, x) slider.SetAlign(uiconst.TOPRIGHT) slider.PostOnClick = self.PostOnClick parent = slider.parent self.AddSliderReset(slider) colorPreview = xtriui.ColorPreview(name='colorPreview', align=uiconst.TORIGHT, width=32, height=32) uicls.Frame(parent=colorPreview) colorPreview.Startup() colorPreview.sr.layerid = x colorPreview.sr.dad = self.sr.medalribbonobject.sr.ribbon colorPreview.FromInt(-330271) colorPreview.state = uiconst.UI_HIDDEN push = uicls.Container(name='push', align=uiconst.TORIGHT, height=32, width=4) slider.parent.children.insert(0, push) slider.parent.children.insert(0, colorPreview) slider.parent.state = uiconst.UI_HIDDEN self.ribbonsliders.append(slider) uicls.Container(name='push', align=uiconst.TOTOP, height=4, parent=self.sr.mainselector) uix.GetContainerHeader( localization.GetByLabel( 'UI/Corporations/CreateDecorationWindow/Medal'), self.sr.mainselector, 1, -4) labels = (('compass', 2), ('imperial', 2), ('pentagon', 1), ('rombus', 1), ('round', 6), ('shield', 1), ('square', 2), ('star', 7)) data = [] for label, amount in labels: for x in xrange(0, amount * 4): icon = '%s_%s' % (x / 4 + 1, x % 4 + 1) data.append([xtriui.Medal, [(label, icon, None)]]) slider = self.GetImageSlider(data) slider.SetParentListener(self.sr.medalribbonobject.sr.medal, 3) slider.SetAlign(uiconst.TOPRIGHT) slider.PostOnClick = self.PostOnClick self.sr.basemedalslider = slider self.medalsliders.append(slider) labels = (('elements', 33), ) ranger = range(0, 3) ranger.reverse() for i in ranger: data = [] for label, amount in labels: for x in xrange(0, amount * 4): icon = '%s_%s' % (x / 4 + 1, x % 4 + 1) data.append([xtriui.Medal, [(label, icon, None)]]) slider = self.GetImageSlider(data) slider.SetParentListener(self.sr.medalribbonobject.sr.medal, i) slider.PostOnClick = self.PostOnClick slider.SetAlign(uiconst.TOPRIGHT) slider.parent.state = uiconst.UI_HIDDEN self.AddSliderReset(slider) self.medalsliders.append(slider)
def Initialize(self, wnd, panelName=None): while eve.session.mutating: blue.pyos.BeNice() wnd.ShowLoad() uix.Flush(wnd.sr.main) self.toparea = uicls.Container(parent=wnd.sr.main, name='corptop', pos=(0, 0, 0, 54), align=uiconst.TOTOP, state=uiconst.UI_NORMAL) uicls.Icon(parent=self.toparea, name='simplepic', pos=(4, 0, 64, 64), icon='ui_7_64_5') self.panelHome = None self.members = None self.recruitment = None self.wars = None self.standings = None self.votes = None self.sanctionable = None self.accounts = None self.auditing = None self.membertracking = None self.findmember = None self.titles = None self.alliances = None tabpanels = [] homeHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/AboutThisCorp') warsHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorpWarsHint') standingsHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorpStandingsHint') votesHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorpVotesHint') sanctionableActionsHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorpSanctionableActionsHint') accountsHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorpAccountsHint') alliancesHint = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/AlliancesHint') self.panelHome = form.CorpUIHome(name='corp_home', parent=wnd.sr.main, state=uiconst.UI_PICKCHILDREN) tabpanels.append([ localization.GetByLabel('UI/Corporations/BaseCorporationUI/Home'), self.panelHome, self, 'home', None, homeHint ]) self.panels['home'] = [self.panelHome] self.recruitment = form.CorpRecruitment(name='recruitmentpar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.recruitment) tabpanels.append([ uiutil.FixedTabName( 'UI/Corporations/BaseCorporationUI/Recruitment'), self.recruitment, self, 'recruitment', None, None ]) self.panels['recruitment'] = [self.recruitment] membersTabEntries = [] self.panels['members'] = [] if not util.IsNPC(eve.session.corpid): self.membertracking = form.CorpMemberTracking( name='membertrackingpar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.membertracking) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/MemberList'), self.membertracking, self.membertracking, 'main' ]) self.panels['members'].append(self.membertracking) grantableRoles, grantableRolesAtHQ, grantableRolesAtBase, grantableRolesAtOther = self.corp.GetMyGrantableRoles( ) if session.corprole & const.corpRolePersonnelManager | grantableRoles: self.findmember = form.CorpFindMembersInRole( name='findmember', parent=wnd.sr.main, left=const.defaultPadding, width=const.defaultPadding) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/FindMemberInRole'), self.findmember, self.findmember, 'findmember' ]) self.panels['members'].append(self.findmember) self.members = form.CorpMembers(name='members', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.members) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/RoleManagement'), self.members, self.members, 'roles' ]) self.panels['members'].append(self.members) if const.corpRoleDirector & eve.session.corprole == const.corpRoleDirector: self.titles = form.CorpTitles(name='titles', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.titles) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/TitleManagement'), self.titles, self.titles, 'titles' ]) self.panels['members'].append(self.titles) if eve.session.corprole & const.corpRoleAuditor == const.corpRoleAuditor: self.auditing = form.CorpAuditing(name='auditingpar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.auditing) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Auditing'), self.auditing, self.auditing, 'main' ]) self.panels['members'].append(self.auditing) self.decorations = form.CorpDecorations(name='decorations', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.decorations) membersTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Decorations'), self.decorations, self.decorations, 'decorations' ]) self.panels['members'].append(self.decorations) wnd.sr.membersTabs = uicls.TabGroup(name='tabparent', parent=wnd.sr.main, idx=0) wnd.sr.membersTabs.Startup(membersTabEntries, 'corpmembersstab', autoselecttab=0) tabpanels.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Members'), None, self, 'members', wnd.sr.membersTabs ]) if not util.IsNPC(session.corpid): self.standings = form.CorpStandings(name='standingspar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.standings) tabpanels.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Standings'), self.standings, self, 'standings', None, standingsHint ]) self.panels['standings'] = [self.standings] politicsTabEntries = [] self.panels['politics'] = [] if self.corp.CanViewVotes(eve.session.corpid): self.votes = form.CorpVotes(name='votespar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.votes) politicsTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Votes'), self.votes, self.votes, 'votes', None, votesHint ]) self.panels['politics'].append(self.votes) self.sanctionable = form.CorpSanctionableActions( name='sanctionablepar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.sanctionable) politicsTabEntries.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/SanctionableActions'), self.sanctionable, self.sanctionable, 'sanctionable', None, sanctionableActionsHint ]) self.panels['politics'].append(self.sanctionable) self.wars = form.CorpWars(name='warspar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.wars) tabpanels.append([ localization.GetByLabel('UI/Corporations/BaseCorporationUI/Wars'), self.wars, self, 'wars', None, warsHint ]) self.panels['wars'] = [self.wars] if len(self.panels['politics']): wnd.sr.politicsTabs = uicls.TabGroup(name='tabparent', parent=wnd.sr.main, idx=0) wnd.sr.politicsTabs.Startup(politicsTabEntries, 'corppoliticsstab', autoselecttab=0) tabpanels.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Politics'), None, self, 'politics', wnd.sr.politicsTabs ]) if const.corpRoleAccountant & eve.session.corprole != 0 or self.corp.UserIsCEO( ): self.accounts = form.CorpAccounts(name='accountspar', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.accounts) tabpanels.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Assets'), self.accounts, self, 'accounts', None, accountsHint ]) self.panels['accounts'] = [self.accounts] self.alliances = form.Alliances(name='alliances', pos=(0, 0, 0, 0)) wnd.sr.main.children.append(self.alliances) tabpanels.append([ localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/Alliances'), self.alliances, self, 'alliances', None, alliancesHint ]) self.panels['alliances'] = [self.alliances] wnd.sr.maintabs = uicls.TabGroup(name='tabparent', parent=wnd.sr.main) wnd.sr.maintabs.Startup(tabpanels, 'corporationpanel', UIIDPrefix='corporationTab', autoselecttab=False) if panelName: wnd.sr.maintabs.ShowPanelByName(panelName) else: wnd.sr.maintabs.AutoSelect() if wnd is None or wnd.destroyed: self.Reset(1, 0, 0) return uiutil.SetOrder(wnd.sr.maintabs, 0) wnd.HideLoad() wnd.state = uiconst.UI_NORMAL uthread.new(sm.StartService('wallet').AskSetWalletDivision)
def Load(self, slimItem, centerItem=None, setposition=1): if not (uicore.uilib.leftbtn or uicore.uilib.midbtn): return actions = sm.StartService('menu').CelestialMenu(slimItem.itemID, slimItem=slimItem, ignoreTypeCheck=1) reasonsWhyNotAvailable = getattr(actions, 'reasonsWhyNotAvailable', {}) if not (uicore.uilib.leftbtn or uicore.uilib.midbtn): return self.itemID = slimItem.itemID warptoLabel = DefaultWarpToLabel()[0] warpops = {warptoLabel: ('ui_44_32_18', 0, 0, 1, 0)} self.actionMenuOptions.update(warpops) serial = '' valid = {} inactive = None for each in actions: if each: if isinstance(each[0], tuple): name = each[0][0] else: name = each[0] if name in self.actionMenuOptions: valid[name] = each if type(each[1]) not in (str, unicode): serial += '%s_' % name if not (uicore.uilib.leftbtn or uicore.uilib.midbtn): return if serial != self.lastActionSerial: uix.Flush(self) i = 0 order = [ 'UI/Commands/ShowInfo', ['UI/Inflight/LockTarget', 'UI/Inflight/UnlockTarget'], ['UI/Inflight/ApproachObject', warptoLabel], 'UI/Inflight/OrbitObject', 'UI/Inflight/Submenus/KeepAtRange' ] default = [ None, ['UI/Inflight/LookAtObject', 'UI/Inflight/ResetCamera'], None ] lookAtString = 'UI/Inflight/LookAtObject' resetCameraString = 'UI/Inflight/ResetCamera' openCargoString = 'UI/Commands/OpenCargo' groups = { const.groupStation: [ None, [lookAtString, resetCameraString], 'UI/Inflight/DockInStation' ], const.groupCargoContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupMissionContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupSecureCargoContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupAuditLogSecureContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupFreightContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupSpawnContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupSpewContainer: [None, [lookAtString, resetCameraString], openCargoString], const.groupDeadspaceOverseersBelongings: [None, [lookAtString, resetCameraString], openCargoString], const.groupWreck: [None, [lookAtString, resetCameraString], openCargoString], const.groupStargate: [None, [lookAtString, resetCameraString], 'UI/Inflight/Jump'], const.groupWormhole: [ None, [lookAtString, resetCameraString], 'UI/Inflight/EnterWormhole' ], const.groupWarpGate: [ None, [lookAtString, resetCameraString], 'UI/Inflight/ActivateGate' ], const.groupBillboard: [ None, [lookAtString, resetCameraString], 'UI/Commands/ReadNews' ], const.groupAgentsinSpace: [ 'UI/Chat/StartConversation', [lookAtString, resetCameraString], None ], const.groupDestructibleAgentsInSpace: [ 'UI/Chat/StartConversation', [lookAtString, resetCameraString], None ], const.groupPlanetaryCustomsOffices: [ None, [lookAtString, resetCameraString], 'UI/PI/Common/AccessCustomOffice' ] } categories = { const.categoryShip: [ 'UI/Chat/StartConversation', [lookAtString, resetCameraString], 'UI/Inflight/BoardShip' ], const.categoryDrone: [ None, [lookAtString, resetCameraString], 'UI/Drones/ScoopDroneToBay' ] } if slimItem.itemID == session.shipid: order = [ 'UI/Commands/ShowInfo', 'UI/Inflight/EjectFromShip', ['UI/Inflight/StopMyShip', 'UI/Inflight/StopMyCapsule'], [ 'UI/Inflight/ActivateAutopilot', 'UI/Inflight/DeactivateAutopilot' ], [lookAtString, resetCameraString] ] elif slimItem.groupID in groups: order += groups[slimItem.groupID] elif slimItem.categoryID in categories: order += categories[slimItem.categoryID] else: order += default step = 360.0 / 8 rad = 48 angle = 180.0 for actionName in order: if actionName is None: angle += step i += 1 continue if type(actionName) == list: action = None for each in actionName: tryaction = valid.get(each, None) if tryaction and type( tryaction[1]) not in (str, unicode): actionName = each action = tryaction break if action is None: actionName = actionName[0] if actionName in valid: action = valid.get(actionName) elif actionName in reasonsWhyNotAvailable: action = (actionName, reasonsWhyNotAvailable.get(actionName)) else: action = ( actionName, localization.GetByLabel( 'UI/Menusvc/MenuHints/NoReasonGiven')) elif actionName in valid: action = valid.get(actionName) elif actionName in reasonsWhyNotAvailable: action = (actionName, reasonsWhyNotAvailable.get(actionName)) else: action = (actionName, localization.GetByLabel( 'UI/Menusvc/MenuHints/NoReasonGiven')) disabled = type(action[1]) in (str, unicode) props = self.actionMenuOptions[actionName] btnpar = uiprimitives.Container(parent=self, align=uiconst.TOPLEFT, width=40, height=40, state=uiconst.UI_NORMAL) btnpar.left = int(rad * math.cos( angle * math.pi / 180.0)) + (self.width - btnpar.width) / 2 btnpar.top = int(rad * math.sin(angle * math.pi / 180.0)) + ( self.height - btnpar.height) / 2 btn = uiprimitives.Sprite( parent=btnpar, name='hudBtn', pos=(0, 0, 40, 40), state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/Shared/actionMenuBtn.png') btnpar.actionID = actionName btnpar.name = actionName btnpar.action = action btnpar.itemIDs = [slimItem.itemID] btnpar.killsub = props[3] btnpar.pickRadius = -1 icon = uicontrols.Icon(icon=props[0], parent=btnpar, pos=(4, 4, 0, 0), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, idx=0) if disabled: icon.color.a = 0.5 btn.color.a = 0.1 if props[4]: icon = uicontrols.Icon(icon='ui_44_32_8', parent=btnpar, pos=(5, 5, 0, 0), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, idx=0) angle += step i += 1 self.lastActionSerial = serial if self.sr.actionTimer is None: self.sr.actionTimer = base.AutoTimer(1000, self.Load, slimItem, None, 0) if centerItem: self.left = max( 0, min( uicore.desktop.width - self.width, centerItem.absoluteLeft - (self.width - centerItem.width) / 2)) self.top = max( 0, min( uicore.desktop.height - self.height, centerItem.absoluteTop - (self.height - centerItem.height) / 2)) elif setposition: self.left = max( 0, min(uicore.desktop.width - self.width, uicore.uilib.x - self.width / 2)) self.top = max( 0, min(uicore.desktop.height - self.height, uicore.uilib.y - self.height / 2))
def InitOptions(self): uix.Flush(self.sr.options) showingPriceHistoryType = settings.user.ui.Get('pricehistorytype', 0) if showingPriceHistoryType: buttonLabel = localization.GetByLabel('UI/PriceHistory/ShowGraph') buttonHint = localization.GetByLabel( 'Tooltips/Market/MarketDetailsHistoryGraph') else: buttonLabel = localization.GetByLabel('UI/PriceHistory/ShowTable') buttonHint = localization.GetByLabel( 'Tooltips/Market/MarketDetailsHistoryTable') btn = uicontrols.Button(parent=self.sr.options, label=buttonLabel, align=uiconst.TOPLEFT, pos=(0, 16, 0, 0), func=self.ToggleView, args='self', fixedwidth=100, hint=buttonHint) pos = btn.width + btn.left + 10 timeOptions = [ [ localization.GetByLabel( '/Carbon/UI/Common/WrittenDateTimeQuantity/Day', days=5), 5 ], [ localization.GetByLabel( '/Carbon/UI/Common/WrittenDateTimeQuantity/Day', days=10), 10 ], [localization.GetByLabel('UI/Common/DateWords/Month'), 30], [ localization.GetByLabel( '/Carbon/UI/Common/WrittenDateTimeQuantity/Month', months=3), 90 ], [ localization.GetByLabel( '/Carbon/UI/Common/WrittenDateTimeQuantity/Month', months=6), 180 ], [localization.GetByLabel('UI/Common/DateWords/Year'), 365] ] timeLabel = localization.GetByLabel('/Carbon/UI/Common/Time') timeCombo = uicontrols.Combo(label=timeLabel, parent=self.sr.options, options=timeOptions, name='pricehistorytime', select=settings.user.ui.Get( 'pricehistorytime', 90), callback=self.ChangeOption, pos=(pos, 16, 0, 0)) pos += timeCombo.width + 10 graphTipCont = uiprimitives.Container(name='graphTipCont', parent=self.sr.options, align=uiconst.BOTTOMLEFT, height=20, width=200, left=pos, top=0) self.graphTip = uicontrols.EveLabelMedium(text=localization.GetByLabel( 'UI/Market/PriceHistory/RightClickHintForChart'), parent=graphTipCont, align=uiconst.TOTOP, state=uiconst.UI_DISABLED, idx=0) graphTipCont.height = self.graphTip.textheight + 10 if showingPriceHistoryType: self.graphTip.state = uiconst.UI_HIDDEN else: self.graphTip.state = uiconst.UI_NORMAL self.optionsinited = 1