def ConstructTopRightCont(self): self.durationEdit = uicls.SinglelineEdit( parent=self.topRightCont, name='durationEdit', align=uiconst.TOPRIGHT, label='duration', floats=(0.0, 10.0), setvalue=self.duration, pos=(5, 14, 100, 0), OnChange=self.OnDurationEditChanged) self.loopsEdit = uicls.SinglelineEdit(parent=self.topRightCont, name='loopEdit', align=uiconst.TOPRIGHT, label='loops', ints=(-1, 20), setvalue=self.loops, pos=(5, 52, 100, 0), OnChange=self.OnLoopEditChanged) options = [ (funcName, getattr(uiconst, funcName)) for funcName in dir(uiconst) if funcName.startswith('ANIM_') and funcName != 'ANIM_LOOPCYCLE' ] self.curveTypeCombo = uicls.Combo(parent=self.topRightCont, label='curveType', options=options, name='', select=uiconst.ANIM_SMOOTH, pos=(5, 92, 100, 0), width=100, align=uiconst.TOPRIGHT)
def ConstructLayout(self): cont = uicls.Container(parent=self.sr.main, align=uiconst.TOALL, padding=const.defaultPadding) if boot.region == 'optic': nameValue = localization.GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Home/NameAlliance', allianceName=cfg.eveowners.Get(session.corpid).ownerName) else: nameValue = localization.GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Home/NameAlliance', languageID=localization.LOCALE_SHORT_ENGLISH, allianceName=cfg.eveowners.Get(session.corpid).ownerName) self.nameEdit = uicls.SinglelineEdit( parent=cont, label=localization.GetByLabel('UI/Common/Name'), align=uiconst.TOTOP, maxLength=100, padTop=12, setvalue=nameValue) shortNameCont = uicls.Container(parent=cont, align=uiconst.TOTOP, height=30, padTop=20) suggestBtn = uicls.Button( parent=shortNameCont, align=uiconst.TOPRIGHT, label=localization.GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Home/SuggestCommand' ), func=self.GetSuggestedTickerNames) editWidth = self.width - suggestBtn.width - 16 self.shortNameEdit = uicls.SinglelineEdit( parent=shortNameCont, label=localization.GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Home/ShortName'), align=uiconst.TOPLEFT, maxLength=5, width=editWidth) self.urlEdit = uicls.SinglelineEdit( parent=cont, label=localization.GetByLabel('UI/Common/URL'), align=uiconst.TOTOP, maxLenght=2048, padTop=12) editLabel = uicls.EveLabelSmall( parent=cont, text=localization.GetByLabel('UI/Common/Description'), height=16, align=uiconst.TOTOP, padTop=12) self.descriptionEdit = uicls.EditPlainText(parent=cont, align=uiconst.TOTOP, maxLength=5000, height=80)
def ShowSearch(self, *args): if not self.sr.search_inited: search_cont = uicls.Container(name='search_cont', parent=self, height=36, align=uiconst.TOTOP, idx=1) self.sr.search_cont = search_cont catOptions = [(localization.GetByLabel('UI/Common/All'), None)] categories = [] for c in cfg.invcategories: if c.categoryID > 0: categories.append([c.categoryName, c.categoryID, c.published]) categories.sort() for c in categories: if c[2]: catOptions.append((c[0], c[1])) typeOptions = [(localization.GetByLabel('UI/Corporations/Common/Offices'), 'offices'), (localization.GetByLabel('UI/Corporations/Assets/Impounded'), 'junk'), (localization.GetByLabel('UI/Corporations/Assets/InSpace'), 'property'), (localization.GetByLabel('UI/Corporations/Assets/Deliveries'), 'deliveries')] left = 5 top = 17 self.sr.fltType = c = uicls.Combo(label=localization.GetByLabel('UI/Common/Where'), parent=search_cont, options=typeOptions, name='flt_type', select=settings.user.ui.Get('corp_assets_filter_type', None), callback=self.ComboChange, width=90, pos=(left, top, 0, 0)) left += c.width + 4 self.sr.fltCategories = c = uicls.Combo(label=localization.GetByLabel('UI/Corporations/Assets/ItemCategory'), parent=search_cont, options=catOptions, name='flt_category', select=settings.user.ui.Get('corp_assets_filter_categories', None), callback=self.ComboChange, width=90, pos=(left, top, 0, 0)) left += c.width + 4 grpOptions = [(localization.GetByLabel('UI/Common/All'), None)] self.sr.fltGroups = c = uicls.Combo(label=localization.GetByLabel('UI/Corporations/Assets/ItemGroup'), parent=search_cont, options=grpOptions, name='flt_group', select=settings.user.ui.Get('corp_assets_filter_groups', None), callback=self.ComboChange, width=90, pos=(left, top, 0, 0)) left += c.width + 4 self.sr.fltItemType = c = uicls.SinglelineEdit(name='flt_exacttype', parent=search_cont, label=localization.GetByLabel('UI/Corporations/Assets/ItemTypeExact'), setvalue=settings.user.ui.Get('corp_assets_filter_itemtype', ''), width=106, top=top, left=left, isTypeField=True) left += c.width + 4 c.OnFocusLost = self.ParseItemType self.sr.fltQuantity = c = uicls.SinglelineEdit(name='flt_quantity', parent=search_cont, label=localization.GetByLabel('UI/Corporations/Assets/MinQuantity'), setvalue=str(settings.user.ui.Get('corp_assets_filter_quantity', '')), width=60, top=top, left=left) left += c.width + 4 c = self.sr.fltSearch = uicls.Button(parent=search_cont, label=localization.GetByLabel('UI/Common/Search'), func=self.Search, pos=(left, top, 0, 0), btn_default=1) self.PopulateGroupCombo(isSel=True) self.sr.search_inited = 1 self.sr.search_cont.state = uiconst.UI_PICKCHILDREN self.sr.scroll.Load(fixedEntryHeight=42, contentList=[], sortby='label', headers=uix.GetInvItemDefaultHeaders()[:], noContentHint=localization.GetByLabel('UI/Corporations/Assets/NoItemsFound'))
def ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self.locationID = attributes.get('locationID') locationName = attributes.get('locationName') note = attributes.get('note', '') self.typeID = attributes.get('typeID') self.scannerInfo = attributes.get('scannerInfo') self.parentID = attributes.get('parentID') self.bookmark = attributes.get('bookmark') if self.bookmark is None: self.SetCaption(localization.GetByLabel('UI/PeopleAndPlaces/NewBookmark')) else: self.SetCaption(localization.GetByLabel('UI/PeopleAndPlaces/EditLocation')) self.SetMinSize([280, 186]) main = uicls.Container(name='main', parent=self.sr.main, align=uiconst.TOALL, left=4, width=4) labelContainer = uicls.Container(name='labelContainer', parent=main, align=uiconst.TOTOP, top=8, height=20, padding=(2, 2, 2, 2)) uicls.EveLabelMedium(text=localization.GetByLabel('UI/PeopleAndPlaces/Label'), parent=labelContainer, align=uiconst.TOLEFT, width=60) self.labelEdit = uicls.SinglelineEdit(name='labelEdit', setvalue=locationName, parent=labelContainer, align=uiconst.TOALL, width=0) self.labelEdit.OnReturn = self.Confirm descriptionContainer = uicls.Container(name='descriptionContainer', parent=main, align=uiconst.TOTOP, top=8, height=60, padding=(2, 2, 2, 2)) uicls.EveLabelMedium(text=localization.GetByLabel('UI/PeopleAndPlaces/Notes'), parent=descriptionContainer, align=uiconst.TOLEFT, width=60) self.notesEdit = uicls.EditPlainText(name='notesEdit', setvalue=note, parent=descriptionContainer, align=uiconst.TOALL) folderContainer = uicls.Container(name='folderContainer', parent=main, align=uiconst.TOTOP, top=8, height=20, padding=(2, 2, 2, 2)) uicls.EveLabelMedium(text=localization.GetByLabel('UI/PeopleAndPlaces/Folder'), parent=folderContainer, align=uiconst.TOLEFT, width=60) options = self.GetFolderOptions() if self.bookmark is not None: ownerID, folderID = self.bookmark.ownerID, self.bookmark.folderID else: ownerID, folderID = settings.char.ui.Get('defaultBookmarkOwnerAndFolder', (session.charid, None)) self.folderCombo = uicls.Combo(name='folderCombo', parent=folderContainer, align=uiconst.TOALL, select=(ownerID, folderID), options=options, width=0) buttons = self.GetButtons() buttonGroup = uicls.ButtonGroup(name='buttonGroup', parent=main, btns=buttons) submitButton = buttonGroup.GetBtnByIdx(0) submitButton.OnSetFocus()
def AskName(caption=None, label=None, setvalue='', maxLength=None, passwordChar=None, validator=None): import uiconst import uicls import localization if caption is None: caption = localization.GetByLabel('UI/Common/Name/TypeInName') if label is None: label = localization.GetByLabel('UI/Common/Name/TypeInName') wnd = GetFormWindow(caption) if label: uicls.Label(parent=wnd.sr.content, text=label, align=uiconst.TOTOP, pos=(0, 0, 0, 0)) edit = uicls.SinglelineEdit(parent=wnd.sr.content, maxLength=maxLength, setvalue=setvalue) AddFormControl(wnd, edit, 'name', retval=None, required=True, errorcheck=validator or NamePopupErrorCheck) if wnd.ShowModal() == uiconst.ID_OK: return wnd.result
def MapCmd(self, cmdname, c=0, a=0, s=0, vkey=None, context=None): if vkey is not None: key = self.GetKeyNameFromVK(vkey) else: key = '' self.mappingcmdname = cmdname wnd = uiutil.GetFormWindow('Add Shortcut') cb1 = uicls.Checkbox(text='Control', parent=wnd.sr.content, checked=c, configName='ctrl') uiutil.AddFormControl(wnd, cb1, 'ctrl', None) cb2 = uicls.Checkbox(text='Alt', parent=wnd.sr.content, checked=a, configName='alt') uiutil.AddFormControl(wnd, cb2, 'alt', None) cb3 = uicls.Checkbox(text='Shift', parent=wnd.sr.content, checked=s, configName='shift') uiutil.AddFormControl(wnd, cb3, 'shift', None) edit = uicls.SinglelineEdit(parent=wnd.sr.content, maxLength=20, setvalue=key) uiutil.AddFormControl(wnd, edit, 'key', None) uiutil.AddFormErrorCheck(wnd, uicore.cmd.MapCmdErrorCheck) if wnd.ShowModal() == uiconst.ID_OK: retval = wnd.result setting = (retval['ctrl'], retval['alt'], retval['shift'], retval['key'].lower()) self.customCmds[cmdname] = setting sm.ScatterEvent('OnMapShortcut', cmdname, *setting) self.Reload() self.mappingcmdname = None
def ConstructMainCont(self): self.spriteCont.Flush() self.mainItem = None self.mainTransform = None self.mainSprite = None self.codeEdit = None if self.mode is MODE_NORMAL: self.mainTransform = uicls.Transform(parent=self.spriteCont, align=uiconst.CENTER, pos=(0, 0, 128, 128)) self.mainSprite = uicls.Sprite( parent=self.mainTransform, align=uiconst.CENTER, pos=(0, 0, 128, 128), texturePath='res:/UI/Texture/CorpLogoLibs/419.png', texturePathSecondary='res:/UI/Texture/colorgradient.dds') elif self.mode is MODE_CODE: self.codeEdit = uicls.SinglelineEdit( parent=self.spriteCont, align=uiconst.TOTOP, label='Code that returns a UI object:', heigt=15, padding=(10, 30, 150, 0), setvalue=settings.user.ui.Get('TestAnimationsWndCode', 'uicore.layer.sidePanels')) uicls.Button(parent=self.spriteCont, align=uiconst.TOPLEFT, label='Assign result', top=60, left=5, func=self.OnAssignCodeBtn) elif self.mode is MODE_INPUT: self.mainItem = self.inputObj
def Create_text(self, attrs): wnd = uicls.SinglelineEdit(name='textedit', align=uiconst.RELATIVE, pos=(0, 0, getattr(attrs, 'width', None) or min(200, 7 * (attrs.size or 30)), 16)) return wnd
def AskAmount(caption=None, question=None, setvalue='', intRange=None, floatRange=None): import uiconst import uicls if caption is None: caption = 'How much?' if question is None: question = 'How much?' wnd = GetFormWindow(caption) if question: uicls.Label(parent=wnd.sr.content, text=question, align=uiconst.TOTOP, pos=(0, 0, 0, 0)) edit = uicls.SinglelineEdit(parent=wnd.sr.content, ints=intRange, floats=floatRange, setvalue=setvalue) AddFormControl(wnd, edit, 'amount', retval=None, required=True, errorcheck=None) if wnd.ShowModal() == uiconst.ID_OK: return wnd.result
def AddEntry(self, rowPos, colPos, variableName, humanName, associatedObject): if not hasattr(associatedObject, variableName): uicls.EveLabelMedium(text=humanName + ': Not on current camera', parent=self.sr.main, align=uiconst.RELATIVE, left=colPos, top=rowPos) else: if variableName not in cameras.ORIGINAL_SETTINGS: cameras.ORIGINAL_SETTINGS[variableName] = getattr( associatedObject, variableName) uicls.EveLabelMedium(text=humanName + ':', parent=self.sr.main, align=uiconst.RELATIVE, left=colPos, top=rowPos) edit = uicls.SinglelineEdit(name=variableName, readonly=False, parent=self.sr.main, maxLines=1, align=uiconst.RELATIVE, pos=(colPos + 145, rowPos - 5, 100, 25), padding=(0, 0, 0, 0)) edit.OnReturn = self.EditEnterPressed edit.associatedObject = associatedObject self.editControls.append(edit) edit.SetValue(str(getattr(associatedObject, variableName))) rowPos += 30 return rowPos
def ApplyAttributes(self, attributes): CriteriaValueBase.ApplyAttributes(self, attributes) options = ( (localization.GetByLabel('UI/Inventory/Filters/CritStartsWith'), CRIT_STARTSWITH), (localization.GetByLabel('UI/Inventory/Filters/CritNotStartsWith'), CRIT_NOTSTARTSWITH), (localization.GetByLabel('UI/Inventory/Filters/CritIs'), CRIT_IS), (localization.GetByLabel('UI/Inventory/Filters/CritIsNot'), CRIT_ISNOT), (localization.GetByLabel('UI/Inventory/Filters/CritContains'), CRIT_CONTAINS), (localization.GetByLabel('UI/Inventory/Filters/CritNotContains'), CRIT_NOTCONTAINS)) self.criteriaCombo = self.CreateCombo(options) self.criteriaCombo.SelectItemByValue(self.criteria) self.valueEdit = uicls.SinglelineEdit(name='valueEdit', parent=self, align=uiconst.TOLEFT_PROP, setvalue=self.value, padLeft=4, width=0.5, OnFocusLost=self.ApplyFilter, OnReturn=self.ApplyFilter, OnChange=self.ApplyFilter)
def DrawLeftSide(self): self.sr.leftside = uicls.Container(name='leftside', parent=self.sr.main, align=uiconst.TOLEFT, width=256) uicls.Container(name='push', parent=self.sr.leftside, align=uiconst.TOTOP, height=6) self.sr.leftBottomPanel = uicls.Container(name='leftBottomPanel', parent=self.sr.leftside, align=uiconst.TOBOTTOM, height=26) self.sr.leftMainPanel = uicls.Container(name='leftMainPanel', parent=self.sr.leftside, align=uiconst.TOALL, pos=(const.defaultPadding, 0, const.defaultPadding, 0)) dummyParent = uicls.Container(name='dummy', parent=self.sr.leftMainPanel, align=uiconst.TOALL, pos=(0, 0, 0, 0)) ownerParent = uicls.Container(name='ownerParent', parent=dummyParent, align=uiconst.TOTOP, height=20) uicls.Container(name='push', parent=ownerParent, align=uiconst.TORIGHT, width=1) options = [(localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/PersonalFittings'), session.charid), (localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/CorporationFittings'), session.corpid)] selected = settings.user.ui.Get('savedFittingsCombo', None) if selected != session.charid and selected != session.corpid: selected = session.charid self.ownerID = selected self.sr.ownerCombo = uicls.Combo(label=None, parent=ownerParent, options=options, name='savedFittingsCombo', select=selected, callback=self.ChangeOwnerFilter, pos=(1, 1, 0, 0), align=uiconst.TOALL) searchContainer = uicls.Container(name='searchContainer', parent=dummyParent, align=uiconst.TOTOP, top=const.defaultPadding, height=20) self.sr.searchTextField = uicls.SinglelineEdit(name='searchTextField', parent=searchContainer, align=uiconst.TOLEFT, width=160, maxLength=40, left=1) self.sr.searchButton = uicls.Button(parent=searchContainer, label=localization.GetByLabel('UI/Common/Buttons/Search'), align=uiconst.CENTERRIGHT, func=self.Search) self.sr.scroll = uicls.Scroll(parent=dummyParent, align=uiconst.TOALL, padding=(0, const.defaultPadding, 0, const.defaultPadding)) self.sr.scroll.multiSelect = 0 buttonContainer = uicls.Container(name='', parent=self.sr.leftBottomPanel, pos=(0, 0, 0, 0)) parent = self.sr.fitButtons = uicls.ButtonGroup(btns=[[localization.GetByLabel('UI/Commands/Export'), self.ExportFittings, ()], [localization.GetByLabel('UI/Commands/Import'), self.ImportFittings, ()]], parent=buttonContainer, idx=0) self.exportButton = parent.GetBtnByLabel(localization.GetByLabel('UI/Commands/Export')) self.DrawFittings()
def ConstructTopLeftCont(self): uicls.Line(parent=self.topLeftCont, align=uiconst.TORIGHT) uicls.Label(parent=self.topLeftCont, text='Select clock:', align=uiconst.TOTOP) uicls.Checkbox(parent=self.topLeftCont, text='Actual', groupname='clockGroup', align=uiconst.TOTOP, checked=not blue.os.useSmoothedDeltaT, callback=self.OnClockRadioButtonsChanged, retval=False) uicls.Checkbox(parent=self.topLeftCont, text='Smoothed', groupname='clockGroup', align=uiconst.TOTOP, checked=blue.os.useSmoothedDeltaT, callback=self.OnClockRadioButtonsChanged, retval=True) uicls.Label(parent=self.topLeftCont, align=uiconst.TOTOP, text='Time Scaler:', pos=(0, 0, 0, 0)) uicls.SinglelineEdit(parent=self.topLeftCont, name='timeScaler', align=uiconst.TOTOP, floats=(0.0, 100.0), setvalue=blue.os.timeScaler, OnChange=self.OnTimeScalerChanged, pos=(0, 0, 20, 12))
def DrawRightSide(self): self.sr.rightside = uicls.Container(name='rightside', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) a = uicls.Container(name='push', parent=self.sr.rightside, align=uiconst.TOTOP, height=6) self.sr.rightBottomPanel = uicls.Container(name='rightBottomPanel', parent=self.sr.rightside, align=uiconst.TOBOTTOM, height=26) self.sr.rightMainPanel = uicls.Container(name='rightMainPanel', parent=self.sr.rightside, align=uiconst.TOALL, pos=(0, 0, 0, 0)) topParent = uicls.Container(parent=self.sr.rightMainPanel, align=uiconst.TOTOP, height=80) topLeftParent = uicls.Container(parent=topParent, align=uiconst.TOLEFT, width=70) topRightParent = uicls.Container(parent=topParent, align=uiconst.TOALL, pos=(0, 0, 0, 0)) bottomParent = uicls.Container(parent=self.sr.rightMainPanel, align=uiconst.TOALL, pos=(0, 0, 0, 0)) uicls.Container(name='push', parent=bottomParent, align=uiconst.TOTOP, height=const.defaultPadding) uicls.Container(name='push', parent=bottomParent, align=uiconst.TOBOTTOM, height=const.defaultPadding) uicls.Container(name='push', parent=bottomParent, align=uiconst.TOLEFT, width=const.defaultPadding) uicls.Container(name='push', parent=bottomParent, align=uiconst.TORIGHT, width=const.defaultPadding) uicls.Frame(parent=bottomParent) self.sr.shipIcon = uicls.Icon(parent=topParent, state=uiconst.UI_HIDDEN, size=64, left=const.defaultPadding, ignoreSize=True) self.sr.techicon = uicls.Sprite(name='techIcon', parent=topParent, align=uiconst.RELATIVE, left=const.defaultPadding, width=16, height=16, idx=0) self.sr.dragIcon = dragIcon = xtriui.FittingDraggableIcon(name='theicon', align=uiconst.TOPLEFT, parent=topParent, height=64, width=64, top=const.defaultPadding, left=const.defaultPadding) dragIcon.Startup(self.fitting) dragIcon.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/FittingIconHint') dragIcon.OnClick = self.ClickDragIcon dragIcon.state = uiconst.UI_NORMAL fittingNameContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20) self.sr.fittingName = uicls.SinglelineEdit(name='fittingName', parent=fittingNameContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 1, 120, 0), maxLength=40) shipInfoContainer = uicls.Container(parent=topRightParent, align=uiconst.TOTOP, height=20) self.sr.shipTypeName = uicls.EveLabelMedium(text='', parent=shipInfoContainer, align=uiconst.RELATIVE, state=uiconst.UI_NORMAL, left=const.defaultPadding) self.sr.infoicon = uicls.InfoIcon(parent=shipInfoContainer, size=16, left=1, top=0, idx=0, state=uiconst.UI_HIDDEN) self.sr.infoicon.OnClick = self.ShowInfo self.sr.radioButton = uicls.Container(name='', parent=topRightParent, align=uiconst.TOPLEFT, height=50, width=100, top=fittingNameContainer.height + shipInfoContainer.height) radioBtns = [] for cfgname, value, label, checked, group in [['fittingNone', session.charid, localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Personal'), self.ownerID == None, 'ownership'], ['fittingOwnerCorporation', session.corpid, localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Corporation'), self.ownerID == session.corpid, 'ownership']]: radioBtns.append(uicls.Checkbox(text=label, parent=self.sr.radioButton, configName=cfgname, retval=value, checked=checked, groupname=group, callback=None)) self.sr.radioButtons = radioBtns self.sr.fittingDescription = uicls.EditPlainText(setvalue=None, parent=bottomParent, align=uiconst.TOALL, maxLength=400) self.sr.fittingInfo = uicls.Scroll(name='fittingInfoScroll', parent=bottomParent) tabs = [[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fittings'), self.sr.fittingInfo, self, None, self.sr.fittingInfo], [localization.GetByLabel('UI/Common/Description'), self.sr.fittingDescription, self, None, self.sr.fittingDescription]] self.fittingInfoTab = uicls.TabGroup(name='tabparent', parent=bottomParent, idx=0) self.fittingInfoTab.Startup(tabs, 'fittingInfoTab') self.sr.fittingInfo.Startup() self.sr.saveDeleteButtons = uicls.ButtonGroup(btns=[[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fit'), self.Fit, ()], [localization.GetByLabel('UI/Common/Buttons/Save'), self.Save, ()], [localization.GetByLabel('UI/Common/Buttons/Delete'), self.Delete, ()]], parent=self.sr.rightBottomPanel, idx=0)
def ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self.specialGroups = util.GetNPCGroups() self.scope = 'inflight' self.SetCaption( localization.GetByLabel('UI/Inflight/Scanner/ScannerFilterEditor')) self.SetMinSize([300, 250]) self.SetWndIcon() self.SetTopparentHeight(0) self.sr.main = uiutil.GetChild(self, 'main') topParent = uicls.Container(name='topParent', parent=self.sr.main, height=64, align=uiconst.TOTOP) topParent.padRight = 6 topParent.padLeft = 6 uicls.EveHeaderSmall( text=localization.GetByLabel('UI/Inflight/Scanner/FilterName'), parent=topParent, state=uiconst.UI_DISABLED, idx=0, top=2) nameEdit = uicls.SinglelineEdit(name='name', parent=topParent, setvalue=None, align=uiconst.TOTOP, maxLength=64) nameEdit.top = 16 self.sr.nameEdit = nameEdit hint = uicls.EveLabelMedium(text=localization.GetByLabel( 'UI/Inflight/Scanner/SelectGroupsToFilter'), parent=topParent, align=uiconst.TOTOP) hint.top = 4 self.sr.topParent = topParent self.sr.scroll = uicls.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll.multiSelect = 0 self.DefineButtons( uiconst.OKCANCEL, okLabel=localization.GetByLabel('UI/Common/Buttons/Save'), okFunc=self.SaveChanges, cancelFunc=self.Close) self.scanGroupsNames = { const.probeScanGroupAnomalies: localization.GetByLabel('UI/Inflight/Scanner/CosmicAnomaly'), const.probeScanGroupSignatures: localization.GetByLabel('UI/Inflight/Scanner/CosmicSignature'), const.probeScanGroupShips: localization.GetByLabel('UI/Inflight/Scanner/Ship'), const.probeScanGroupStructures: localization.GetByLabel('UI/Inflight/Scanner/Structure'), const.probeScanGroupDronesAndProbes: localization.GetByLabel('UI/Inflight/Scanner/DroneAndProbe') } self.Maximize() self.OnResizeUpdate()
def PanelCreateRoute(self, typeID, amount): cont = uicls.Container(parent=self.actionCont, pos=(0, 0, 0, 130), align=uiconst.TOTOP, state=uiconst.UI_HIDDEN) cont._OnClose = self.OnPanelCreateRouteClosed w = self.width - 5 self.sourceMaxAmount = amount self.routeMaxAmount = amount self.commodityToRoute = typeID self.commoditySourceMaxAmount = amount self.currRouteCycleTime = self.pin.GetCycleTime() resourceTxt = localization.GetByLabel( 'UI/PI/Common/ItemAmount', itemName=cfg.invtypes.Get(typeID).name, amount=int(self.routeMaxAmount)) CaptionAndSubtext( parent=cont, caption=localization.GetByLabel('UI/PI/Common/CommodityToRoute'), subtext=resourceTxt, iconTypeID=typeID, top=0, width=w) CaptionAndSubtext( parent=cont, caption=localization.GetByLabel('UI/PI/Common/QtyAmount'), width=w, top=30, state=uiconst.UI_DISABLED) self.routeAmountEdit = uicls.SinglelineEdit( name='routeAmountEdit', parent=cont, setvalue=self.routeMaxAmount, height=14, width=45, align=uiconst.TOPLEFT, top=44, ints=(0, self.routeMaxAmount), OnChange=self.OnRouteAmountEditChanged) self.routeAmountText = uicls.EveLabelSmall(parent=cont, left=47, top=46, state=uiconst.UI_NORMAL) self.routeDestText = CaptionAndSubtext( parent=cont, caption=localization.GetByLabel('UI/Common/Destination'), top=70, width=w) btns = [[ localization.GetByLabel('UI/PI/Common/CreateRoute'), self.SubmitRoute, () ]] self.createRouteButton = uicls.ButtonGroup(btns=btns, parent=cont, line=False, alwaysLite=True) self.UpdatePanelCreateRoute() return cont
def PrepareNavigationBar(self): mainArea = self.GetMainArea() self.navigationBar = uicls.Container(name='navBar', parent=mainArea, align=uiconst.TOTOP, height=24, padBottom=4) buttonParent = uicls.Container(name='buttonParent', parent=self.navigationBar, align=uiconst.TORIGHT, padRight=const.defaultPadding) goBtn = uicls.Button(parent=buttonParent, label=localization.GetByLabel('UI/Browser/Go'), func=self.OnGoBtn, align=uiconst.CENTER) buttonParent.width = goBtn.width iconContainer = uicls.Container(name='sslIndicator', parent=self.navigationBar, align=uiconst.TORIGHT, width=20, padRight=const.defaultPadding) uicls.Icon(name='sslIcon', icon='res:/UI/Texture/classes/Browser/sslIcon.png', parent=iconContainer, pos=(-2, -1, 24, 24), hint=localization.GetByLabel('UI/Browser/SecureConnection'), ignoreSize=True, state=uiconst.UI_NORMAL) self.sslIconContainer = iconContainer self.urlInput = uicls.SinglelineEdit(name='urlInput', parent=self.navigationBar, padTop=1, padRight=const.defaultPadding, maxLength=1630, autoselect=True, align=uiconst.TOTOP) self.urlInput.OnReturn = self.BrowseTo self.urlInput.OnHistoryClick = self.OnHistoryClicked
def ConstructTopRightCont(self): cont = uicls.Container(parent=self.topRightCont, align=uiconst.TOTOP, height=70, padTop=12, padBottom=10) uicls.Label(parent=cont, align=uiconst.TOTOP, text='Slug Min Time:', pos=(0, 0, 0, 0)) uicls.SinglelineEdit(parent=cont, name='slugMinEdit', align=uiconst.TOTOP, ints=(0, 1000), setvalue=int(blue.os.slugTimeMinMs), OnChange=self.OnSlugMinChanged, pos=(0, 0, 100, 12)) uicls.Label(parent=cont, align=uiconst.TOTOP, text='Slug Max Time:', pos=(0, 0, 0, 0)) uicls.SinglelineEdit(parent=cont, name='slugMaxEdit', align=uiconst.TOTOP, ints=(0, 1000), setvalue=int(blue.os.slugTimeMaxMs), OnChange=self.OnSlugMaxChanged, pos=(0, 0, 100, 12)) uicls.Checkbox(parent=self.topRightCont, text='Use Simple Loop', align=uiconst.TOTOP, checked=blue.os.useSimpleCatchupLoop, callback=self.OnSimpleLoopChanged, padBottom=10) uicls.Checkbox(parent=self.topRightCont, text='Show Time Graphs', align=uiconst.TOTOP, checked=self.showTimeGraphs, callback=self.OnTimeGraphsChanged, padBottom=10)
def ConstructLayout(self, *args): topCont = uicls.Container(name='topCont', align=uiconst.TOTOP, height=14, parent=self.sr.main) left = const.defaultPadding self.sr.buttonContainer = uicls.Container(name='buttonContainer', align=uiconst.TOBOTTOM, parent=self.sr.main) self.checkAllCB = uicls.Checkbox( text=localization.GetByLabel('UI/Shared/CheckAllOn'), parent=topCont, align=uiconst.TOTOP, height=16, padLeft=left, callback=self.CheckAll, checked=True) left = const.defaultPadding self.sr.filenameLabel = uicls.EveLabelMedium( text=localization.GetByLabel('UI/Common/Files/FileName'), parent=self.sr.buttonContainer, top=const.defaultPadding, left=left, state=uiconst.UI_NORMAL) left += self.sr.filenameLabel.width + const.defaultPadding self.sr.filename = uicls.SinglelineEdit(name='filename', parent=self.sr.buttonContainer, pos=(left, const.defaultPadding, 150, 0), align=uiconst.TOPLEFT) self.sr.filename.SetMaxLength(32) left += self.sr.filename.width + const.defaultPadding self.sr.exportBtn = uicls.Button( parent=self.sr.buttonContainer, label=localization.GetByLabel('UI/Commands/Export'), func=self.Export, btn_default=1, idx=0, pos=(left, const.defaultPadding, 0, 0)) self.sr.buttonContainer.height = self.sr.filename.height + 10 self.sr.scrolllistcontainer = uicls.Container( name='scrolllistcontainer', align=uiconst.TOALL, parent=self.sr.main, pos=(0, 0, 0, 0)) self.sr.scroll = uicls.Scroll( name='scroll', parent=self.sr.scrolllistcontainer, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.ConstructScrollList()
def ApplyAttributes(self, attributes): import uicls import uiutil import uiconst import sys sys.stdout = self uicls.Window.ApplyAttributes(self, attributes) scroll = uicls.Scroll(parent=uiutil.GetChild(self, 'main'), padding=2) self.sr.scroll = scroll self.edit = uicls.SinglelineEdit(name="", readonly=False, parent=self.sr.maincontainer, align=uiconst.RELATIVE, pos=(2, 2, 150, 25), padding=(0, 0, 0, 0)) self.edit.OnReturn = self.EnterPressed
def ConstructLayout(self): cont = uicls.Container(parent=self.sr.main, align=uiconst.TOALL, pos=(const.defaultPadding, 16, const.defaultPadding, const.defaultPadding)) self.newName = uicls.SinglelineEdit( name='namePopup', parent=cont, label=self.label, setvalue=self.setvalue, align=uiconst.TOTOP, maxLength=self.maxLength, passwordCharacter=self.passwordChar, autoselect=True, OnReturn=self.Confirm) uicore.registry.SetFocus(self.newName)
def LayoutTaxInput(self, taxRate, parent, left=0, top=0): taxRateValue = taxRate.value taxRateInput = uicls.SinglelineEdit( parent=parent, name='taxRateEdit', align=uiconst.TOPLEFT, setvalue='' if taxRateValue is None else str(100 * taxRateValue), width=90, left=left, top=top, idx=0) taxRatePercent = uicls.EveLabelMedium(align=uiconst.TOPLEFT, text='%', parent=parent, left=left + 97, top=top + 2) taxRateInput.FloatMode(minfloat=0, maxfloat=100) taxRate.input = taxRateInput
def AddEdit(self): self.new = uicls.Container(name='editField', parent=self.parent, align=uiconst.TOTOP) config = 'edit_%s' % self.type['key'] self.code = uicls.SinglelineEdit( name=config, parent=self.new, setvalue=self.type.get('setvalue', ''), padding=(self.leftPush, 2, 0, 2), ints=self.type.get('intonly', None), floats=self.type.get('floatonly', None), align=uiconst.TOTOP, maxLength=self.type.get('maxlength', None) or self.type.get('maxLength', None), passwordCharacter=self.type.get('passwordChar', None), readonly=self.type.get('readonly', 0), autoselect=self.type.get('autoselect', 0), isTypeField=self.type.get('isTypeField', False), isCharacterField=self.type.get('isCharacterField', False)) self.new.height = self.code.height + self.code.padTop * 4 width = self.type.get('width', None) if width: self.code.SetAlign(uiconst.TOLEFT) self.code.width = width if self.type.has_key('OnReturn'): self.code.data = {'key': self.type['key']} self.code.OnReturn = self.type['OnReturn'] if self.type.has_key('unusedkeydowncallback'): self.code.OnUnusedKeyDown = self.type['unusedkeydowncallback'] if self.type.has_key('onanychar'): self.code.OnAnyChar = self.type['onanychar'] label = self.type.get('label', '') text = self.type.get('text', None) caption = text or label if label == '_hide': self.code.padLeft = 0 elif caption: l = uicls.EveLabelSmall(text=caption, align=uiconst.CENTERLEFT, parent=self.new, name='label', left=7, width=self.leftPush - 6)
def ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self.loadingShowcontent = 0 self.SetScope('station_inflight') self.SetMinSize([400, 250]) self.SetCaption(localization.GetByLabel('UI/Chat/ChannelWindow/Channels')) self.SetWndIcon('ui_9_64_2') self.SetTopparentHeight(70) self.sr.inpt = inpt = uicls.SinglelineEdit(name='input', parent=self.sr.topParent, maxLength=60, left=74, top=20, width=86, label=localization.GetByLabel('UI/Chat/ChannelWindow/Channels')) joinBtn = uicls.Button(parent=self.sr.topParent, label=localization.GetByLabel('UI/Chat/ChannelWindow/Join'), pos=(inpt.left, inpt.top + inpt.height + 4, 0, 0), func=self.JoinChannelFromBtn, args='self', btn_default=1) createBtn = uicls.Button(parent=self.sr.topParent, label=localization.GetByLabel('UI/Chat/ChannelWindow/Create'), pos=(joinBtn.left + joinBtn.width + 2, joinBtn.top, 0, 0), func=self.CreateChannelFromBtn, args='self') self.sr.inpt.width = max(100, joinBtn.left + joinBtn.width - inpt.left) channelsMaillist = uicls.Container(name='channelsMaillist', parent=self.sr.main, left=const.defaultPadding, top=const.defaultPadding, width=const.defaultPadding, height=const.defaultPadding) self.sr.scroll = uicls.Scroll(parent=channelsMaillist) self.sr.scroll.multiSelect = 0 self.ShowContent()
def Test(cls): uicls.Window.CloseIfOpen(windowID='LayoutGrid') wnd = uicls.Window.Open(windowID='LayoutGrid') wnd.SetTopparentHeight(0) main = wnd.GetMainArea() wnd._scrollContainer = uicls.ScrollContainer(parent=main, padding=4) wnd._scrollContainer.verticalScrollBar.align = uiconst.TORIGHT_NOPUSH wnd._scrollContainer.horizontalScrollBar.align = uiconst.TOBOTTOM_NOPUSH grid = uicls.LayoutGrid(parent=wnd._scrollContainer, align=uiconst.TOTOP, name='LayoutGrid', state=uiconst.UI_NORMAL, columns=5, cellPadding=12, cellSpacing=16, cellBgColor=(1, 1, 1, 0.1)) lorem = u'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque rutrum neque ut metus pharetra malesuada. Vivamus mollis vulputate ornare. Quisque condimentum interdum arcu, nec pellentesque tellus venenatis non. Fusce nec feugiat libero. Nulla non velit felis. Morbi accumsan interdum erat sodales egestas. In mauris lorem, cursus et posuere sit amet, aliquet sit amet turpis. Maecenas tincidunt fringilla congue. Maecenas eu nibh quis mauris placerat vulputate. Curabitur condimentum arcu ut dui aliquet quis blandit ligula consectetur. Morbi consectetur egestas tortor, ut interdum nibh viverra id. Proin mattis eleifend dignissim. In eget laoreet nisl. ' grid.SetColumnWidth(1, COLUMN_WIDTH_FILL) grid.SetColumnWidth(2, COLUMN_WIDTH_FILL) grid.AddCell(cellObject=uicls.Button(label='Bless', align=uiconst.CENTER), rowSpan=2) t = uicls.EveLabelMedium(text=lorem, align=uiconst.TOTOP) grid.AddCell(cellObject=t, colSpan=3, rowSpan=3) grid.AddCell() uicls.Button(label='Hallo', parent=grid) uicls.SinglelineEdit(align=uiconst.TOPLEFT, parent=grid) grid.AddCell() grid.AddCell(bgColor=(1, 0, 0, 0.25)) uicls.Button(label='Bless', align=uiconst.CENTER, parent=grid) t = uicls.EveLabelMedium( text='Quisque rutrum neque ut metus pharetra malesuada', align=uiconst.TOTOP) grid.AddCell(cellObject=t, bgColor=(0, 0, 1, 0.25)) grid.AddCell() uicls.EveLabelMedium(text='Vivamus mollis vulputate ornare', align=uiconst.TOTOP, parent=grid) return grid
def ApplyAttributes(self, attributes): CriteriaValueBase.ApplyAttributes(self, attributes) options = ( (localization.GetByLabel('UI/Inventory/Filters/CritLessThan'), CRIT_ISLESSTHAN), (localization.GetByLabel('UI/Inventory/Filters/CritEqualTo'), CRIT_ISEQUALTO), (localization.GetByLabel('UI/Inventory/Filters/CritGreaterThan'), CRIT_ISGREATERTHAN)) self.criteriaCombo = self.CreateCombo(options) self.criteriaCombo.SelectItemByValue(self.criteria) self.valueEdit = uicls.SinglelineEdit(name='valueEdit', parent=self, align=uiconst.TOLEFT_PROP, ints=self.ints, floats=self.floats, setvalue=self.value, padLeft=4, width=0.5, OnFocusLost=self.ApplyFilter, OnReturn=self.ApplyFilter, OnChange=self.ApplyFilter)
def ConstructLayout(self): alliance = sm.GetService('alliance').GetAlliance() cont = uicls.Container(parent=self.sr.main, align=uiconst.TOALL, padding=const.defaultPadding) self.urlEdit = uicls.SinglelineEdit( parent=cont, label=localization.GetByLabel('UI/Common/URL'), align=uiconst.TOTOP, maxLength=2048, padTop=12, setvalue=alliance.url) editLabel = uicls.EveLabelSmall( parent=cont, text=localization.GetByLabel('UI/Common/Description'), height=16, align=uiconst.TOTOP, padTop=12) self.descriptionEdit = uicls.EditPlainText( parent=cont, align=uiconst.TOTOP, maxLength=5000, height=80, setvalue=alliance.description)
def LoadSupport(self, panel, *args): if self.supportLoaded: return subpar = uicls.Container(name='subpar', parent=panel, align=uiconst.TOALL) helpchannelpar = uicls.Container(name='helpchannelpar', parent=subpar, align=uiconst.TOTOP) helpchannelpar.padTop = 4 helpbtnparent = uicls.Container(name='helpbtnparent', parent=subpar, align=uiconst.TOTOP, height=32) helpchannelbtn = uicls.Button( parent=helpbtnparent, label=localization.GetByLabel('UI/Help/JoinChannel'), func=self.JoinHelpChannel, btn_default=0, align=uiconst.TOPRIGHT) helpchannelbtn.left = 6 helptext = uicls.EveLabelMedium( name='label', text=localization.GetByLabel('UI/Help/JoinChannelHint'), parent=helpchannelpar, align=uiconst.TOPLEFT, pos=(8, 4, 280, 0), state=uiconst.UI_NORMAL) helpchannelpar.height = helptext.textheight helpbtnparent.height = helpchannelbtn.height + 4 uicls.Line(parent=subpar, align=uiconst.TOTOP) petpar = uicls.Container(name='petitionpar', parent=subpar, align=uiconst.TOTOP, height=60) petpar.padTop = 4 petbtnparent = uicls.Container(name='petbtnparent', parent=subpar, align=uiconst.TOTOP, height=32) petbtn = uicls.Button( parent=petbtnparent, label=localization.GetByLabel('UI/Help/FilePetition'), func=self.FilePetition, btn_default=0, align=uiconst.TOPRIGHT) petbtn.left = 6 pettext = uicls.EveLabelMedium( name='label', text=localization.GetByLabel('UI/Help/OpenPetitions'), parent=petpar, align=uiconst.TOPLEFT, pos=(8, 4, 280, 0), state=uiconst.UI_NORMAL) petpar.height = pettext.textheight petbtnparent.height = petbtn.height + 4 uicls.Line(parent=subpar, align=uiconst.TOTOP) kbpar = uicls.Container(name='kbpar', parent=subpar, align=uiconst.TOTOP, height=60) kbpar.padTop = 4 kbbtnparent = uicls.Container(name='kbbtnparent', parent=subpar, align=uiconst.TOTOP, width=96) kbt = localization.GetByLabel('UI/Help/EvelopediaHintText') kbtext = uicls.EveLabelMedium(name='label', text=kbt, parent=kbpar, align=uiconst.TOPLEFT, pos=(8, 4, 280, 0), state=uiconst.UI_NORMAL) kbbtn = uicls.Button( parent=kbbtnparent, label=localization.GetByLabel('UI/Help/SearchEvelopedia'), func=self.SearchKB, pos=(6, 0, 0, 0), align=uiconst.TOPRIGHT, btn_default=1) self.sr.kbsearch = uicls.SinglelineEdit(name='kbsearch', parent=kbbtnparent, pos=(kbbtn.width + 14, 0, 195, 0), align=uiconst.TOPRIGHT) kbpar.height = kbtext.textheight kbbtnparent.height = max(kbbtn.height, self.sr.kbsearch.height) + 8 uicls.Line(parent=subpar, align=uiconst.TOTOP) funnelpar = uicls.Container(name='funnelpar', parent=subpar, align=uiconst.TOTOP, height=60) funnelpar.padTop = 4 funnelbtnparent = uicls.Container(name='funnelbtnparent', parent=subpar, align=uiconst.TOTOP, width=96, height=32) funnelbt = localization.GetByLabel('UI/Help/CareerAdvancementFull') funneltext = uicls.EveLabelMedium(name='label', text=funnelbt, parent=funnelpar, align=uiconst.TOPLEFT, pos=(8, 4, 280, 0), state=uiconst.UI_NORMAL) uicls.Button(parent=funnelbtnparent, label=localization.GetByLabel('UI/Help/ShowCareerAgents'), func=self.ShowTutorialAgents, pos=(6, 0, 0, 0), align=uiconst.TOPRIGHT) helpchannelpar.height = helptext.textheight + helptext.top * 2 + 6 petpar.height = pettext.textheight + pettext.top * 2 + 6 kbpar.height = kbtext.textheight + kbtext.top * 2 + 6 funnelpar.height = funneltext.textheight + funneltext.top * 2 + 6 if int( sm.GetService('machoNet').GetGlobalConfig().get( 'bugReporting_ShowButton', 0)) > 0: uicls.Line(parent=subpar, align=uiconst.TOTOP) bugreportpar = uicls.Container(name='bugreportpar', parent=subpar, align=uiconst.TOTOP, height=60) bugreportpar.padTop = 4 bugreportbtnparent = uicls.Container(name='bugreportbtnparent', parent=subpar, align=uiconst.TOTOP, width=96, height=32) bugreportbt = localization.GetByLabel('UI/Help/ReportBugFull') bugreporttext = uicls.EveLabelMedium(name='label', text=bugreportbt, parent=bugreportpar, align=uiconst.TOPLEFT, pos=(8, 4, 280, 0), state=uiconst.UI_NORMAL) uicls.Button(parent=bugreportbtnparent, label=localization.GetByLabel('UI/Help/ReportBug'), func=self.CreateBugReport, pos=(6, -2, 0, 0), align=uiconst.TOPRIGHT) helpchannelpar.height = helptext.textheight + helptext.top * 2 + 6 petpar.height = pettext.textheight + pettext.top * 2 + 6 kbpar.height = kbtext.textheight + kbtext.top * 2 + 6 bugreportpar.height = bugreporttext.textheight + bugreporttext.top * 2 + 6 totalHeight = 0 for container in subpar.children: if container.align == uiconst.TOTOP: totalHeight += container.height need = self.sr.topParent.height + self.sr.headerParent.height + totalHeight + 40 self.SetMinSize([self.minsize[0], need]) uicls.Fill(parent=panel, color=(1.0, 1.0, 1.0, 0.1)) uicls.Frame(parent=panel, state=uiconst.UI_PICKCHILDREN) uicore.registry.SetFocus(self.sr.kbsearch) self.supportLoaded = True
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 ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self._cfgTopHeaderTmpl = None self._cfgTopDivTmpl = None self._cfgTopPushTmpl = None self._cfgCheckBoxTmpl = None self._cfgBottomHeaderTmpl = None self._cfgButtonTmpl = None self.starColorGroups = [] self.starColorByID = None self.scope = 'station_inflight' self.SetWndIcon('ui_7_64_4', mainTop=-14) self.SetMinSize([400, 200]) self.SetTopparentHeight(36) self.SetCaption(localization.GetByLabel('UI/Map/MapPallet/CaptionMapPallet')) self.MakeUnKillable() self.loadedTab = None if self.destroyed: return self.sr.scroll = uicls.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll.sr.id = 'mapspalletescroll_withsort' self.sr.scroll2 = uicls.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll2.sr.id = 'mapspalletescroll_withhoutsort' self.sr.scroll2.OnSelectionChange = self.OnSelectionChange flattened = settings.user.ui.Get('mapFlattened', 1) toggleFlatLabel = localization.GetByLabel('UI/Map/MapPallet/btnFlattenMap') if flattened: toggleFlatLabel = localization.GetByLabel('UI/Map/MapPallet/btnUnflattenMap') if sm.GetService('viewState').IsViewActive('starmap'): toggleMapLabel = localization.GetByLabel('UI/Map/MapPallet/btnSolarsystemMap') else: toggleMapLabel = localization.GetByLabel('UI/Map/MapPallet/btnStarMap') btns = uicls.ButtonGroup(btns=[['mapCloseBtn', localization.GetByLabel('UI/Map/MapPallet/btnCloseMap'), sm.GetService('viewState').CloseSecondaryView, (), 80], ['mapToggleMapBtn', toggleMapLabel, self.ToggleMapMode, (), 130], ['mapUnflattenFlattenBtn', toggleFlatLabel, self.ClickToggleFlatten, 'self', 80]], parent=self.sr.topParent, align=uiconst.CENTER, left=15, line=0, idx=0, forcedButtonNames=True, fixedWidth=True, unisize=False) self.sr.flattenBtns = btns searchpar = uicls.Container(name='searchpar', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 40), idx=0) searchpar.OnTabSelect = self.GiveInputFocus inpt = uicls.SinglelineEdit(name='', parent=searchpar, pos=(5, 22, 98, 0), maxLength=64) inpt.OnReturn = self.OnReturnSearch self.sr.searchinput = inpt uicls.EveLabelSmall(text=localization.GetByLabel('UI/Map/MapPallet/lblSearchForLocation'), parent=inpt, left=0, top=-14, state=uiconst.UI_DISABLED) uicls.Button(parent=inpt.parent, label=localization.GetByLabel('UI/Map/MapPallet/btnSearchForLocation'), func=self.Search, args=1, pos=(inpt.left + inpt.width + 4, inpt.top, 0, 0), btn_default=1) starviewstabs = uicls.TabGroup(name='tabparent', parent=self.sr.main, idx=0) starviewstabs.Startup([[localization.GetByLabel('UI/Map/MapPallet/tabStars'), self.sr.scroll2, self, 'starview_color'], [localization.GetByLabel('UI/Map/MapPallet/tabLabels'), self.sr.scroll2, self, 'mapsettings_labels'], [localization.GetByLabel('UI/Map/MapPallet/tabMapLines'), self.sr.scroll2, self, 'mapsettings_lines'], [localization.GetByLabel('UI/Map/MapPallet/tabTiles'), self.sr.scroll2, self, 'mapsettings_tiles'], [localization.GetByLabel('UI/Map/MapPallet/tabLegend'), self.sr.scroll2, self, 'mapsettings_legend'], [localization.GetByLabel('UI/Map/MapPallet/tabMapAnimation'), self.sr.scroll2, self, 'mapsettings_other']], 'starviewssub', autoselecttab=0) self.sr.starviewstabs = starviewstabs self.sr.maintabs = uicls.TabGroup(name='tabparent', parent=self.sr.main, idx=0) self.sr.maintabs.Startup([[localization.GetByLabel('UI/Map/MapPallet/tabSearch'), self.sr.scroll, self, 'mapsearchpanel', searchpar], [localization.GetByLabel('UI/Map/MapPallet/tabStarMap'), self.sr.scroll2, self, 'mapsettings', starviewstabs], [localization.GetByLabel('UI/Map/MapPallet/tabSolarSystemMap'), self.sr.scroll2, self, 'mapsettings_solarsystem', None]], 'mapspalette', autoselecttab=1)