def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.minSec = attributes.minSec self.maxSec = attributes.maxSec self.secRange = self.maxSec - self.minSec self.typeID = attributes.typeID self.numSecSections = int(self.secRange / 0.5) sectionWidth = self.width / self.numSecSections uiprimitives.Line(parent=self, align=uiconst.TORIGHT, color=(0, 0, 0, 0.5)) icon = uicontrols.Icon(parent=self, typeID=self.typeID, size=48, align=uiconst.CENTER, ignoreSize=True, OnClick=self.OnIconClick, state=uiconst.UI_NORMAL) icon.GetMenu = lambda : sm.GetService('menu').GetMenuFormItemIDTypeID(None, self.typeID, ignoreMarketDetails=False) secMeter = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=SEC_METER_HEIGHT) for n in xrange(self.numSecSections): sec = self.minSec + n * const.securityGainPerTag for data in SEC_BAND_DATA: if sec < data.maxSec: break if data.altColor is not None and n % 2 == 1: color = data.altColor else: color = data.color uiprimitives.Fill(parent=secMeter, align=uiconst.TOLEFT, width=sectionWidth, color=color.GetRGBA(), hint=localization.GetByLabel(data.pveHintLable) + '<br>' + localization.GetByLabel(data.pvpHintLabel), state=uiconst.UI_NORMAL) self.quantitySpentText = uicontrols.EveLabelSmallBold(parent=self, align=uiconst.CENTER, top=30, color=(1, 1, 1, 1)) self.SetQuantity(0)
def SetText(self, text): if not self.label: self.label = uicontrols.EveLabelSmallBold( parent=self, align=uiconst.TOTOP, state=uiconst.UI_DISABLED, maxLines=1, padBottom=1, idx=0) self.label.text = text
def ConstructLayout(self): cont = uiprimitives.Container(parent=self.sr.main, align=uiconst.TOTOP, padding=const.defaultPadding, height=16) checkBoxCont = uicontrols.ContainerAutoSize(parent=self.sr.main, name='checkBoxCont', align=uiconst.TOTOP, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) selectLabel = uicontrols.EveLabelSmallBold(parent=cont, text=localization.GetByLabel('UI/Corporations/CorporationWindow/Alliances/Home/SelectShortName'), height=16, align=uiconst.TOTOP) shortNames = sm.GetService('corp').GetSuggestedAllianceShortNames(self.allianceName) checked = True for shortNameRow in shortNames: shortName = shortNameRow.shortName if shortName is None: continue checkBox = uicontrols.Checkbox(text=shortName, parent=checkBoxCont, configName='shortNames', retval=shortName, checked=checked, groupname='state', align=uiconst.TOTOP, height=19) self.checkBoxes.append(checkBox) checked = False self.height = checkBoxCont.height + 70
def ConstructLayout(self): allianceName = cfg.eveowners.Get(self.allianceID).name allianceInfoCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) allianceLogoCont = uiprimitives.Container(name='allianceLogo', parent=allianceInfoCont, align=uiconst.TOLEFT, width=68) allianceTextCont = uiprimitives.Container(name='allianceName', parent=allianceInfoCont, align=uiconst.TOALL) applicationCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(allianceLogoCont, self.allianceID, size=64, noServerCall=True) allianceText = localization.GetByLabel('UI/Corporations/CorpApplications/YourApplicationToJoin', corpName=allianceName) allianceNameLabel = uicontrols.EveLabelLarge(parent=allianceTextCont, text=allianceText, top=12, align=uiconst.TOPLEFT, width=270) editText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=editText, height=16, align=uiconst.TOTOP) if self.application.applicationText is not None: appText = self.application.applicationText else: appText = '' self.applicationText = uicls.EditPlainText(setvalue=appText, parent=applicationCont, align=uiconst.TOTOP, maxLength=1000, height=100, readonly=True) status = uicontrols.EveLabelSmall(parent=applicationCont, text=localization.GetByLabel('UI/Corporations/CorporationWindow/Alliances/Applications/Status'), align=uiconst.TOTOP, top=6) statusLabel = uicontrols.EveLabelSmallBold(parent=applicationCont, text=_GetApplicationStatusStr(self.application.state), height=12, align=uiconst.TOTOP)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.isTabStop = True self.safetyButton = attributes.get('safetyButton') self.color = attributes.get('color', (1, 1, 1, 1)) self.bgColor = (self.color[0] * 0.3, self.color[1] * 0.3, self.color[2] * 0.3, 1.0) self.label = uicontrols.EveLabelSmallBold( parent=self, text=localization.GetByLabel('UI/Common/Confirm'), color=self.color, align=uiconst.CENTER) self.frame = uicontrols.Frame(parent=self, frameConst=('ui_105_32_1', 8, -4), color=self.color, opacity=0.5) self.fill = uiprimitives.Fill(parent=self, color=self.bgColor) self.SetHint( localization.GetByLabel( 'UI/Crimewatch/SafetyLevel/SafetyConfirmHint', color=self.safetyButton.data.color.GetHex()))
def CreateBar(self): self.barContainer = uiprimitives.Container(name='barContainer', parent=self, align=uiconst.TOTOP, height=BAR_HEIGHT, padTop=20, padLeft=BAR_PADDING, padRight=BAR_PADDING) uicontrols.Frame(parent=self.barContainer, color=(0.5, 0.5, 0.5, 0.5), offset=1) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPLEFT, text='-10', padTop=3, left=1, color=(1, 1, 1, 1)) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-8', padTop=3, left=4 * BOX_WIDTH - 3, color=(1, 1, 1, 1)) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-5', padTop=3, left=3 * BOX_WIDTH - 3, color=(1, 1, 1, 1)) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-2', padTop=3, left=2 * BOX_WIDTH - 3, color=(1, 1, 1, 1)) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='0', padTop=3, left=BOX_WIDTH - 3, color=(1, 1, 1, 1)) uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='10', padTop=3, left=1, color=(1, 1, 1, 1)) bucketContainer = uiprimitives.Container(name='bucketContainer', parent=self.barContainer, align=uiconst.TOPLEFT, height=BAR_HEIGHT, width=BAR_WIDTH) self.buckets = [] for data in TAG_BUCKETS: if data.typeID is None: bucket = uicls.LastBucket(parent=bucketContainer) else: bucket = uicls.BucketOfTags(parent=bucketContainer, name='bucket_%s' % data.typeID, typeID=data.typeID, minSec=data.minSec, maxSec=data.maxSec) self.buckets.append(bucket) self.sliderContainer = uiprimitives.Container(name='sliderContainer', parent=self.barContainer, align=uiconst.TOALL) uicontrols.GradientSprite(parent=self.barContainer, align=uiconst.TOALL, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.5), (0.9, 0.15)], state=uiconst.UI_DISABLED, rotation=math.pi / 2)