def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetCaption('UI Sprite Test') if hasattr(self, 'SetTopparentHeight'): self.SetTopparentHeight(0) self.textureSetFunc = None self.bottomCont = uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOBOTTOM_PROP, padding=(5, 0, 5, 0), height=0.6) self.topCont = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOALL, padding=(3, 3, 3, 3)) self.topLeftCont = uiprimitives.Container(name='topLeftCont', parent=self.topCont, align=uiconst.TOLEFT, width=90) self.topRightCont = uiprimitives.Container(name='topRightCont', parent=self.topCont, align=uiconst.TOALL) primaryCont = uiprimitives.Container(parent=self.topLeftCont, align=uiconst.TOTOP, height=self.topLeftCont.width) uicontrols.Button(name='closePrimaryBtn', parent=primaryCont, label='<color=red>X', align=uiconst.TOPRIGHT, func=self.OnClosePrimaryBtnClick, fixedwidth=20, alwaysLite=True, top=-3, left=-3) self.primaryTextureSprite = uiprimitives.Sprite(name='primaryTextureSprite', parent=primaryCont, align=uiconst.TOALL) uicontrols.Button(name='loadPrimaryTextureBtn', parent=self.topLeftCont, label='Load primary', align=uiconst.TOTOP, func=self.OnLoadPrimaryTextureBtnClicked) uicontrols.Button(name='switchBtn', parent=self.topLeftCont, label='Switch', align=uiconst.TOTOP, func=self.OnSwitchBtnClick, padding=(0, 8, 0, 5), alwaysLite=True) secondaryCont = uiprimitives.Container(parent=self.topLeftCont, align=uiconst.TOTOP, height=self.topLeftCont.width, padTop=10) uicontrols.Button(name='closeSecondaryBtn', parent=secondaryCont, label='<color=red>X', align=uiconst.TOPRIGHT, func=self.OnCloseSecondaryBtnClick, fixedwidth=20, alwaysLite=True, top=-3, left=-3) self.secondaryTextureSprite = uiprimitives.Sprite(name='secondaryTextureSprite', parent=secondaryCont, align=uiconst.TOALL) uicontrols.Button(name='loadSecondaryTextureBtn', parent=self.topLeftCont, label='Load secondary', align=uiconst.TOTOP, func=self.OnLoadSecondaryTextureBtnClicked) self.mainSprite = uiprimitives.Sprite(name='mainSprite', parent=self.topRightCont, align=uiconst.CENTER, width=128, height=128) sizeCont = uiprimitives.Container(parent=self.topRightCont, align=uiconst.TOPRIGHT, pos=(5, 5, 60, 50)) self.mainSpriteWidthEdit = uicontrols.SinglelineEdit(parent=sizeCont, name='mainSpriteWidthEdit', align=uiconst.TOTOP, label='width', ints=(1, 1024), setvalue=self.mainSprite.width, padTop=10, OnChange=self.OnMainSpriteWidthHeightChange) self.mainSpriteHeightEdit = uicontrols.SinglelineEdit(parent=sizeCont, name='mainSpriteHeightEdit', align=uiconst.TOTOP, label='height', ints=(1, 1024), setvalue=self.mainSprite.height, padTop=15, OnChange=self.OnMainSpriteWidthHeightChange) uicontrols.Button(parent=self.topRightCont, align=uiconst.BOTTOMRIGHT, label='Animate', func=self.OpenAnimationWindow, top=20) uicontrols.Button(parent=self.topRightCont, align=uiconst.BOTTOMRIGHT, label='Copy to clipboard', func=self.CopyCodeToClipboard, top=0) uiprimitives.Line(parent=self.bottomCont, align=uiconst.TOTOP) self.ConstructColorColumn() self.ConstructBlendModeColumn() self.ConstructSpriteEffectColumn() self.ConstructGlowColumn() self.ConstructShadowColumn() self.SetPrimaryPath(settings.user.ui.Get('UISpriteTestPrimaryTexturePath', None)) self.SetSecondaryPath(settings.user.ui.Get('UISpriteTestSecondaryTexturePath', None))
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetWndIcon(None) self.SetCaption('Window manager') self.SetTopparentHeight(10) self.SetMinSize([360, 220]) options = [] windowList = list(form.__dict__) windowList.sort() for i, f in enumerate(windowList): cp = form.__getattribute__(f) if inspect.isclass(cp) and issubclass(cp, uicontrols.Window): options.append((f, i)) topCont = uiprimitives.Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pad=(5, 5, 5, 5), pos=(0, 10, 0, 30)) self.mainCont = uiprimitives.Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 50), padding=(5, 15, 5, 5)) self.extrasCont = uiprimitives.Container(name='params', parent=self.sr.main, align=uiconst.TOALL, padding=(5, 15, 5, 5)) self.combo = uicontrols.Combo(parent=topCont, label='Select window', options=options, name='', select=settings.user.ui.Get('windowManagerOpenWindow'), callback=self.OnComboChanged, pos=(5, 0, 0, 0), width=150, align=uiconst.TOPLEFT) self.startupArgs = uicontrols.SinglelineEdit(name='', label='attributes', parent=topCont, setvalue='', align=uiconst.TOPLEFT, left=165, width=100) uicontrols.Button(parent=topCont, label='Load', align=uiconst.RELATIVE, func=self.OpenWindow, pos=(300, 0, 0, 0)) self.filenameEdit = uicontrols.SinglelineEdit(name='', label='Location', parent=self.mainCont, setvalue='', align=uiconst.TOTOP, top=15, readonly=True) uicontrols.Label(text='RELOAD', parent=self.extrasCont, top=10, state=uiconst.UI_NORMAL) uiprimitives.Line(parent=self.extrasCont, align=uiconst.TOTOP) buttonCont = uiprimitives.Container(name='buttonCont', parent=self.extrasCont, align=uiconst.TOTOP, pos=(0, 30, 0, 30)) uicontrols.Button(parent=buttonCont, label='ShipUI', align=uiconst.TOLEFT, func=self.ReloadShipUI) uicontrols.Button(parent=buttonCont, label='NEOCOM', align=uiconst.TOLEFT, func=self.ReloadNeocom, padLeft=1) uicontrols.Button(parent=buttonCont, label='Info Panels', align=uiconst.TOLEFT, func=self.ReloadInfoPanels, padLeft=1) uicontrols.Button(parent=buttonCont, label='Lobby', align=uiconst.TOLEFT, func=self.ReloadLobby, padLeft=1) uicontrols.Button(parent=buttonCont, label='Overview', align=uiconst.TOLEFT, func=self.ReloadOverview, padLeft=1) uicontrols.Button(parent=buttonCont, label='Mapbrowser', align=uiconst.TOLEFT, func=self.ReloadMapBrowser, padLeft=1) self.UpdateInfo(self.combo.GetKey(), self.combo.GetValue())
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetCaption('Fuel Starbase') self.SetMinSize([256, 256], 1) self.SetWndIcon(None) self.SetTopparentHeight(0) self.MakeUnResizeable() y = const.defaultPadding + 10 self.cycles_online = uicontrols.SinglelineEdit(name='cycles_online', parent=self.sr.main, setvalue=0, ints=(0, 99999), left=90, width=100, top=y) self.cycles_cpupow = uicontrols.SinglelineEdit(name='cycles_cpupow', parent=self.sr.main, setvalue=0, ints=(0, 99999), left=90, width=100, top=y + 20) self.cycles_reinf = uicontrols.SinglelineEdit(name='cycles_reinf', parent=self.sr.main, setvalue=0, ints=(0, 99999), left=90, width=100, top=y + 40) uicontrols.Label(text='Add number of cycles fuel for...', parent=self.sr.main, width=400, left=const.defaultPadding, top=y - 12, fontsize=9, letterspace=2, uppercase=1, state=uiconst.UI_NORMAL) y += 4 uicontrols.Label(text='Online:', parent=self.sr.main, width=100, left=2 * const.defaultPadding, top=y, fontsize=9, letterspace=2, uppercase=1, state=uiconst.UI_NORMAL) uicontrols.Label(text='CPU/Power:', parent=self.sr.main, width=100, left=2 * const.defaultPadding, top=y + 20, fontsize=9, letterspace=2, uppercase=1, state=uiconst.UI_NORMAL) uicontrols.Label(text='Reinforced:', parent=self.sr.main, width=100, left=2 * const.defaultPadding, top=y + 40, fontsize=9, letterspace=2, uppercase=1, state=uiconst.UI_NORMAL) uicontrols.Button(parent=self.sr.main, label='Auto', pos=(204, y + 5, 0, 0), func=self.Auto) y += 4 uiprimitives.Line(parent=self.sr.main, align=uiconst.RELATIVE, color=(1.0, 1.0, 1.0, 0.5), left=194, top=y, width=4, height=1) uiprimitives.Line(parent=self.sr.main, align=uiconst.RELATIVE, color=(1.0, 1.0, 1.0, 0.5), left=194, top=y + 20, width=4, height=1) uiprimitives.Line(parent=self.sr.main, align=uiconst.RELATIVE, color=(1.0, 1.0, 1.0, 0.5), left=198, top=y, width=1, height=21) uiprimitives.Line(parent=self.sr.main, align=uiconst.RELATIVE, color=(1.0, 1.0, 1.0, 0.5), left=199, top=y + 10, width=4, height=1) buttons = [['Fuel', self.Fuel, None, 81], ['Cancel', self.Cancel, None, 81]] self.sr.main.children.insert(0, uicontrols.ButtonGroup(btns=buttons))
def ConstructLayout(self): cont = uiprimitives.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.const.LOCALE_SHORT_ENGLISH, allianceName=cfg.eveowners.Get(session.corpid).ownerName) self.nameEdit = uicontrols.SinglelineEdit(parent=cont, label=localization.GetByLabel('UI/Common/Name'), align=uiconst.TOTOP, maxLength=100, padTop=12, setvalue=nameValue) shortNameCont = uiprimitives.Container(parent=cont, align=uiconst.TOTOP, height=30, padTop=20) suggestBtn = uicontrols.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 = uicontrols.SinglelineEdit(parent=shortNameCont, label=localization.GetByLabel('UI/Corporations/CorporationWindow/Alliances/Home/ShortName'), align=uiconst.TOPLEFT, maxLength=5, width=editWidth) self.urlEdit = uicontrols.SinglelineEdit(parent=cont, label=localization.GetByLabel('UI/Common/URL'), align=uiconst.TOTOP, maxLenght=2048, padTop=12) editLabel = uicontrols.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 = uiprimitives.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 categoryID in evetypes.IterateCategories(): if categoryID > 0: categories.append([evetypes.GetCategoryNameByCategory(categoryID), categoryID, evetypes.IsCategoryPublishedByCategory(categoryID)]) categories.sort() for c in categories: if c[2]: catOptions.append((c[0], c[1])) typeOptions = [(localization.GetByLabel('UI/Corporations/Common/StationOffices'), FLAGNAME_OFFICES), (localization.GetByLabel('UI/Corporations/Assets/Impounded'), FLAGNAME_JUNK), (localization.GetByLabel('UI/Corporations/Assets/InSpace'), FLAGNAME_PROPERTY), (localization.GetByLabel('UI/Corporations/Assets/StationDeliveries'), FLAGNAME_DELIVERIES)] left = 5 top = 17 self.sr.fltType = c = uicontrols.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 = uicontrols.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 = uicontrols.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 = uicontrols.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 self.sr.fltQuantity = c = uicontrols.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 = uicontrols.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')) self.Search()
def DrawLeftSide(self): self.sr.leftside = uiprimitives.Container(name='leftside', parent=self.sr.main, align=uiconst.TOLEFT, width=256) uiprimitives.Container(name='push', parent=self.sr.leftside, align=uiconst.TOTOP, height=6) self.sr.leftMainPanel = uiprimitives.Container(name='leftMainPanel', parent=self.sr.leftside, align=uiconst.TOALL, pos=(const.defaultPadding, 0, const.defaultPadding, 0)) dummyParent = uiprimitives.Container(name='dummy', parent=self.sr.leftMainPanel, align=uiconst.TOALL, pos=(0, 0, 0, 0)) ownerParent = uiprimitives.Container(name='ownerParent', parent=dummyParent, align=uiconst.TOTOP, height=20) uiprimitives.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 = uicontrols.Combo(label=None, parent=ownerParent, options=options, name='savedFittingsCombo', select=selected, callback=self.ChangeOwnerFilter, pos=(1, 1, 0, 0), align=uiconst.TOALL) searchContainer = uiprimitives.Container(name='searchContainer', parent=dummyParent, align=uiconst.TOTOP, top=const.defaultPadding, height=20) self.sr.searchTextField = uicontrols.SinglelineEdit(name='searchTextField', parent=searchContainer, align=uiconst.TOLEFT, width=160, maxLength=40, left=1) self.sr.searchTextField.OnReturn = self.Search self.sr.searchButton = uicontrols.Button(parent=searchContainer, label=localization.GetByLabel('UI/Common/Buttons/Search'), align=uiconst.CENTERRIGHT, func=self.Search) self.sr.scroll = uicontrols.Scroll(parent=dummyParent, align=uiconst.TOALL, padding=(0, const.defaultPadding, 0, const.defaultPadding)) self.sr.scroll.multiSelect = 0 fitButtons = FlowContainer(name='buttonParent', parent=self.sr.leftside, align=uiconst.TOBOTTOM, padding=6, autoHeight=True, centerContent=True, contentSpacing=uiconst.BUTTONGROUPMARGIN, idx=0) self.exportButton = Button(parent=fitButtons, label=localization.GetByLabel('UI/Commands/Export'), func=self.ExportFittings, align=uiconst.NOALIGN) self.importButton = Button(parent=fitButtons, label=localization.GetByLabel('UI/Commands/Import'), func=self.ImportFittings, align=uiconst.NOALIGN) if boot.region != 'optic': self.importFromClipboardButton = Button(parent=fitButtons, label=localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/ImportFromClipboard'), func=sm.GetService('fittingSvc').ImportFittingFromClipboard, align=uiconst.NOALIGN) self.importFromClipboardButton.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/ImportFromClipboardHint') self.DrawFittings()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.searchStr = '' self.scope = 'all' self.SetMinSize([320, 300]) self.SetWndIcon(self.iconNum) self.scroll = uicontrols.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.scroll.Startup() self.scroll.multiSelect = 0 self.standardBtns = uicontrols.ButtonGroup(btns=[[localization.GetByLabel('UI/Ship/ShipConfig/Invite'), self.InviteToCorp, (), 81], [localization.GetByLabel('UI/Common/Buttons/Cancel'), self.OnCancel, (), 81]]) self.inviteButton = self.standardBtns.GetBtnByIdx(0) self.inviteButton.Disable() self.sr.main.children.insert(0, self.standardBtns) self.SetCaption(localization.GetByLabel('UI/Messages/SelectCharacterTitle')) self.label = uicontrols.EveLabelSmall(text=localization.GetByLabel('UI/Shared/TypeSearchString'), parent=self.sr.topParent, left=70, top=16, state=uiconst.UI_NORMAL) self.nameInput = uicontrols.SinglelineEdit(name='edit', parent=self.sr.topParent, pos=(70, self.label.top + self.label.height + 2, 86, 0), align=uiconst.TOPLEFT, maxLength=32) self.nameInput.OnReturn = self.Search btn = uicontrols.Button(parent=self.sr.topParent, label=localization.GetByLabel('UI/Wallet/WalletWindow/WalletSearch'), pos=(self.nameInput.left + self.nameInput.width + 2, self.nameInput.top, 0, 0), func=self.Search, btn_default=1) self.SetHint(localization.GetByLabel('UI/Common/TypeInSearch'))
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.folder = attributes.get('folder', None) self.ownerID = None if self.folder is None: self.SetCaption(localization.GetByLabel('UI/PeopleAndPlaces/NewFolder')) self.isNew = True else: self.SetCaption(localization.GetByLabel('UI/PeopleAndPlaces/EditFolder')) self.isNew = False self.SetMinSize([280, 110]) main = uiprimitives.Container(name='main', parent=self.sr.main, align=uiconst.TOALL, left=4, width=4) labelContainer = uiprimitives.Container(name='labelContainer', parent=main, align=uiconst.TOTOP, top=8, height=20, padding=(2, 2, 2, 2)) uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/PeopleAndPlaces/Name'), parent=labelContainer, align=uiconst.TOLEFT, width=60) self.nameEdit = uicontrols.SinglelineEdit(name='nameEdit', setvalue=self.folder.folderName if self.folder else '', parent=labelContainer, align=uiconst.TOALL, width=0) self.nameEdit.OnReturn = self.Confirm sectionContainer = uiprimitives.Container(name='sectionContainer', parent=main, align=uiconst.TOTOP, top=8, height=20, padding=(2, 2, 2, 2)) uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/PeopleAndPlaces/LocationSection'), parent=sectionContainer, align=uiconst.TOLEFT, width=60) if not self.isNew or util.IsNPCCorporation(session.corpid): if not self.isNew and self.folder.ownerID == session.corpid: sectionName = localization.GetByLabel('UI/PeopleAndPlaces/CorporationLocations') self.ownerID = session.corpid else: sectionName = localization.GetByLabel('UI/PeopleAndPlaces/PersonalLocations') self.ownerID = session.charid uicontrols.EveLabelMedium(text=sectionName, parent=sectionContainer, align=uiconst.TOALL, width=60) else: ownerID = settings.char.ui.Get('bookmarkFolderDefaultOwner', session.charid) self.sectionCombo = uicontrols.Combo(name='sectionCombo', parent=sectionContainer, align=uiconst.TOALL, width=0, select=ownerID, options=[(localization.GetByLabel('UI/PeopleAndPlaces/PersonalLocations'), session.charid), (localization.GetByLabel('UI/PeopleAndPlaces/CorporationLocations'), session.corpid)]) buttons = self.GetButtons() buttonGroup = uicontrols.ButtonGroup(name='buttonGroup', parent=main, btns=buttons) submitButton = buttonGroup.GetBtnByIdx(0) submitButton.OnSetFocus()
def AddEntry(self, rowPos, colPos, variableName, humanName, associatedObject): if not hasattr(associatedObject, variableName): uicontrols.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) uicontrols.EveLabelMedium(text=humanName + ':', parent=self.sr.main, align=uiconst.RELATIVE, left=colPos, top=rowPos) edit = uicontrols.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 = uicontrols.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 ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.specialGroups = util.GetNPCGroups() self.filterID = None 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 = uiprimitives.Container(name='topParent', parent=self.sr.main, height=64, align=uiconst.TOTOP) topParent.padRight = 6 topParent.padLeft = 6 uicontrols.EveHeaderSmall(text=localization.GetByLabel('UI/Inflight/Scanner/FilterName'), parent=topParent, state=uiconst.UI_DISABLED, idx=0, top=2) nameEdit = uicontrols.SinglelineEdit(name='name', parent=topParent, setvalue=None, align=uiconst.TOTOP, maxLength=64) nameEdit.top = 16 self.sr.nameEdit = nameEdit hint = uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Inflight/Scanner/SelectGroupsToFilter'), parent=topParent, align=uiconst.TOTOP) hint.top = 4 self.sr.topParent = topParent self.sr.scroll = uicontrols.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.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: evetypes.GetCategoryNameByCategory(const.categoryDrone)} self.Maximize() self.OnResizeUpdate()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetWndIcon(None) self.SetCaption('Ballpark exporter') self.SetTopparentHeight(10) self.SetMinSize([360, 150]) self.MakeUnResizeable() self.mainCont = uiprimitives.Container(parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 110), padding=(5, 5, 5, 5)) self.exportUrlEdit = uicontrols.SinglelineEdit( parent=self.mainCont, align=uiconst.TOTOP, top=15, label='Export URL:', setvalue=settings.user.ui.Get('ballparkExporterUrl'), readonly=True) buttonCont = uiprimitives.Container(parent=self.mainCont, align=uiconst.TOTOP, pos=(0, 10, 0, 30), name='buttonCont') uicontrols.Button(parent=buttonCont, align=uiconst.TOLEFT, label='Start', func=self.StartExport) uicontrols.Button(parent=buttonCont, align=uiconst.TOLEFT, label='Stop', func=self.StopExport) self.statusLabel = uicontrols.Label(parent=self.mainCont, align=uiconst.TOTOP, top=10, text='', state=uiconst.UI_NORMAL)
def ConstructTopLeftCont(self): uiprimitives.Line(parent=self.topLeftCont, align=uiconst.TORIGHT) uicontrols.Label(parent=self.topLeftCont, text='Select clock:', align=uiconst.TOTOP) uicontrols.Checkbox(parent=self.topLeftCont, text='Actual', groupname='clockGroup', align=uiconst.TOTOP, checked=not blue.os.useSmoothedDeltaT, callback=self.OnClockRadioButtonsChanged, retval=False) uicontrols.Checkbox(parent=self.topLeftCont, text='Smoothed', groupname='clockGroup', align=uiconst.TOTOP, checked=blue.os.useSmoothedDeltaT, callback=self.OnClockRadioButtonsChanged, retval=True) uicontrols.Label(parent=self.topLeftCont, align=uiconst.TOTOP, text='Time Scaler:', pos=(0, 0, 0, 0)) uicontrols.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 GenerateInputLine(parent, name, title, defaultValue): container = uiprimitives.Container(parent=parent, align=uiconst.TOTOP, height=16, top=const.defaultPadding) container.padLeft = 5 container.padRight = 5 label = uicontrols.Label(text=title, name='txt%s' % name, parent=container, align=uiconst.TOLEFT, height=12, top=5, left=8, fontsize=10, letterspace=1, linespace=9, uppercase=1, state=uiconst.UI_NORMAL) label.rectTop = -2 inputField = uicontrols.SinglelineEdit(name=name, parent=container, setvalue=str(defaultValue), left=5, width=200, height=20, align=uiconst.TORIGHT) return inputField
def Show(self): self.wnd = wnd = uicontrols.Window.GetIfOpen(windowID='typedb') if wnd: self.wnd.Maximize() return self.wnd = wnd = uicontrols.Window.Open(windowID='typedb') wnd.SetWndIcon(None) wnd.SetMinSize([350, 270]) wnd.SetTopparentHeight(0) wnd.SetCaption('Type Browser') mainpar = uiutil.GetChild(wnd, 'main') wnd.sr.tabs = uicontrols.TabGroup(name='tabsparent', parent=mainpar) main = uiprimitives.Container( name='main', parent=mainpar, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) body = uiprimitives.Container(name='body', parent=main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) wnd.sr.browser = uicontrols.Scroll(name='scroll', parent=body, pos=(0, 0, 0, 0)) wnd.sr.browser.multiSelect = False wnd.sr.browser.Startup() searchParent = uiprimitives.Container(name='search', parent=body, align=uiconst.TOALL, pos=(0, 0, 0, 0)) searchTop = uiprimitives.Container(name='search', parent=searchParent, height=25, align=uiconst.TOTOP) btn = uicontrols.Button(parent=searchTop, label='Search', func=self.Search, align=uiconst.TORIGHT) wnd.sr.input = uicontrols.SinglelineEdit(name='Search', parent=searchTop, width=-1, left=1, align=uiconst.TOALL) uiprimitives.Container(name='div', parent=searchParent, height=5, align=uiconst.TOTOP) wnd.sr.input.OnReturn = self.Search wnd.sr.scroll = uicontrols.Scroll(parent=searchParent) wnd.sr.scroll.multiSelect = False wnd.sr.tabs.Startup([['Browse', wnd.sr.browser, self, 0], ['Search', searchParent, self, 1]], 'typebrowsertabs') self.Search() stuff = self.GetContent(None, False) wnd.sr.browser.Load(contentList=stuff, headers=['Name', 'typeID']) wnd.sr.browser.Sort('Name')
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.invCont = attributes.invCont self.inputThread = None self.quickFilterInputBox = uicontrols.SinglelineEdit(name='quickFilterInputBox', parent=self, align=uiconst.CENTER, width=self.width, top=0, OnChange=self.SetQuickFilterInput, hinttext=localization.GetByLabel('UI/Inventory/Filter')) self.quickFilterInputBox.ShowClearButton(hint=localization.GetByLabel('UI/Inventory/Clear')) self.quickFilterInputBox.SetHistoryVisibility(0) if self.invCont: self.SetInvCont(self.invCont)
def StartupWelcomePanel(self, *args): welcomePanel = self.sr.welcomePanel cbCont = uiprimitives.Container(name='cbCont', parent=welcomePanel, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 20)) self.sr.wekcomeToAllCB = uicontrols.Checkbox( text=localization.GetByLabel( 'UI/EVEMail/MailingLists/SendWelcomeMailToAllCheckbox'), parent=cbCont, configName='welcomeToAllCB', retval=self.mailingListID, checked=settings.user.ui.Get( 'welcomeToAllCB_%s' % self.mailingListID, 0), align=uiconst.TOPLEFT, pos=(0, 0, 330, 0), callback=self.OnCheckboxChange) subjectCont = uiprimitives.Container(name='subjectCont', parent=welcomePanel, align=uiconst.TOTOP, pos=(0, 0, 0, 30), padding=(0, 0, 1, 0)) subjectTextCont = uiprimitives.Container(name='subjectCont', parent=subjectCont, align=uiconst.TOLEFT, pos=(0, 0, 40, 0)) subjectLabel = uicontrols.EveHeaderSmall(text=localization.GetByLabel( 'UI/EVEMail/MailingLists/WelcomeMailSubject'), parent=subjectTextCont, align=uiconst.TOPLEFT, top=2, left=0, state=uiconst.UI_NORMAL) subjectTextCont.width = subjectLabel.textwidth + 5 self.sr.subjecField = uicontrols.SinglelineEdit( name='subjecField', parent=subjectCont, maxLength=const.mailMaxSubjectSize, pos=(0, 0, 0, 0), label='', align=uiconst.TOTOP) self.sr.welcomeScrollCont = scrollCont = uiprimitives.Container( name='scrollCont', parent=welcomePanel, align=uiconst.TOALL) self.sr.welcomeEdit = uicls.EditPlainText( setvalue='', parent=self.sr.welcomeScrollCont, align=uiconst.TOALL, showattributepanel=1) uicontrols.ButtonGroup(btns=[[ localization.GetByLabel('UI/Common/Buttons/Save'), self.SaveWelcomeMail, None, None ]], parent=welcomePanel, idx=0, line=False)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.selected = None self.SetTopparentHeight(0) self.SetCaption('Depletion Manager') self.SetMinSize([280, 500]) headerContainer = uiprimitives.Container(name='headerParent', parent=self.sr.main, align=uiconst.TOTOP, height=100, padding=(2, 2, 2, 2)) text = "This gives you a list of depletion\npoints that you've placed on the planet.\nYou can edit some aspects of these points\n * amount - is the base extraction amount\n * duration - is the in minutes and tells how many times the program will be resubmitted\n * headRadius - tells the size of the head\n " uicontrols.EveLabelMedium(parent=headerContainer, text=text, align=uiconst.TOALL) timeContainer = uiprimitives.Container(name='timeParent', parent=self.sr.main, align=uiconst.TOBOTTOM, height=40) editContainer = uiprimitives.Container(name='editParent', parent=self.sr.main, align=uiconst.TOBOTTOM, top=20, height=50, padTop=12) scrollContainer = uiprimitives.Container(name='scrollParent', parent=self.sr.main, align=uiconst.TOALL) self.depletionPointScroll = uicontrols.Scroll(parent=scrollContainer, align=uiconst.TOALL, padding=(0, const.defaultPadding, 0, const.defaultPadding)) self.depletionPointScroll.multiSelect = 0 self.pinManager = attributes.get('pinManager', None) amountContainer = uiprimitives.Container(name='amountParent', parent=editContainer, align=uiconst.TOLEFT, width=90) durationContainer = uiprimitives.Container(name='durationParent', parent=editContainer, align=uiconst.TOLEFT, width=90) headRadiusContainer = uiprimitives.Container(name='headRadiusParent', parent=editContainer, align=uiconst.TOLEFT, width=90) self.amountEdit = uicontrols.SinglelineEdit(name='amount', parent=amountContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 1, 80, 0), maxLength=40, label='amount', OnReturn=self.OnAmountSubmit) self.amountEdit.OnFocusLost = self.OnAmountSubmit self.durationEdit = uicontrols.SinglelineEdit(name='duration', parent=durationContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 1, 80, 0), maxLength=40, label='duration', OnReturn=self.OnDurationSubmit) self.durationEdit.OnFocusLost = self.OnDurationSubmit self.headRadiusEdit = uicontrols.SinglelineEdit(name='headRadius', parent=headRadiusContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 1, 80, 0), maxLength=40, label='headRadius', OnReturn=self.OnHeadRadiusSubmit) self.headRadiusEdit.OnFocusLost = self.OnHeadRadiusSubmit self.timeEdit = uicontrols.SinglelineEdit(name='timeEdit', parent=timeContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 1, 80, 0), maxLength=40, label='Time in days', setvalue='14') self.LoadDepletionPointScroll() self.sr.saveDeleteButtons = uicontrols.ButtonGroup(btns=[['Submit', self.Submit, ()]], parent=self.sr.main, idx=0)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetWndIcon(None) self.SetCaption('UI Scaling') self.SetTopparentHeight(0) self.SetMinSize([150, 100]) mainCont = uiprimitives.Container(name='params', parent=self.sr.main, align=uiconst.TOALL, padding=const.defaultPadding) floats = (0.5, 2.0, 2) uicontrols.Label(text='use values from 0.5 to 2.0', parent=mainCont, align=uiconst.TOPLEFT) self.scaleEdit = uicontrols.SinglelineEdit(parent=mainCont, name='scaleEdit', align=uiconst.TOPLEFT, floats=floats, setvalue=uicore.desktop.dpiScaling, width=50, top=18) applyBtn = uicontrols.Button(parent=mainCont, name='apply', align=uiconst.TOPLEFT, label='Apply', left=54, top=18, func=self.ScaleUI) resetBtn = uicontrols.Button(parent=mainCont, name='reset', align=uiconst.TOPLEFT, label='Reset', left=0, top=40, func=self.ResetUI)
def ConstructTopRightCont(self): cont = uiprimitives.Container(parent=self.topRightCont, align=uiconst.TOTOP, height=70, padTop=12, padBottom=10) uicontrols.Label(parent=cont, align=uiconst.TOTOP, text='Slug Min Time:', pos=(0, 0, 0, 0)) uicontrols.SinglelineEdit(parent=cont, name='slugMinEdit', align=uiconst.TOTOP, ints=(0, 1000), setvalue=int(blue.os.slugTimeMinMs), OnChange=self.OnSlugMinChanged, pos=(0, 0, 100, 12)) uicontrols.Label(parent=cont, align=uiconst.TOTOP, text='Slug Max Time:', pos=(0, 0, 0, 0)) uicontrols.SinglelineEdit(parent=cont, name='slugMaxEdit', align=uiconst.TOTOP, ints=(0, 1000), setvalue=int(blue.os.slugTimeMaxMs), OnChange=self.OnSlugMaxChanged, pos=(0, 0, 100, 12)) uicontrols.Checkbox(parent=self.topRightCont, text='Use Simple Loop', align=uiconst.TOTOP, checked=blue.os.useSimpleCatchupLoop, callback=self.OnSimpleLoopChanged, padBottom=10) uicontrols.Checkbox(parent=self.topRightCont, text='Show Time Graphs', align=uiconst.TOTOP, checked=self.showTimeGraphs, callback=self.OnTimeGraphsChanged, padBottom=10)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) warableEntitysOnly = attributes.warableEntitysOnly self.ownerID = None self.searchStr = '' self.searchAttr = attributes.Get('searchStr', '') self.warableEntitysOnly = warableEntitysOnly self.SetScope('all') self.Confirm = self.ValidateOK strTitle = localization.GetByLabel('UI/Corporations/CorporationWindow/Standings/SelectCorpOrAlliance') if self.warableEntitysOnly: strTitle = localization.GetByLabel('UI/Corporations/CorporationWindow/Standings/SelectWarableCorpOrAlliance') self.SetCaption(strTitle) self.SetMinSize([320, 300]) if self.searchAttr: self.SetTopparentHeight(0) self.SetWndIcon(self.iconNum) self.sr.standardBtns = uicontrols.ButtonGroup(btns=[[localization.GetByLabel('UI/Generic/OK'), self.OnOK, (), 81], [localization.GetByLabel('UI/Generic/Cancel'), self.OnCancel, (), 81]]) self.sr.main.children.insert(0, self.sr.standardBtns) self.sr.txtWarning = uicontrols.EveLabelMedium(parent=self.sr.main, align=uiconst.TOBOTTOM, top=0, color=[1, 0, 0, 1], state=uiconst.UI_HIDDEN) self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=const.defaultPadding) self.sr.scroll.multiSelect = False self.sr.scroll.OnSelectionChange = self.OnScrollSelectionChange self.label = uicontrols.EveLabelSmall(text=localization.GetByLabel('UI/Shared/TypeSearchString'), parent=self.sr.topParent, left=70, top=5, state=uiconst.UI_NORMAL) inpt = self.sr.inpt = uicontrols.SinglelineEdit(name='edit', parent=self.sr.topParent, left=70, top=self.label.top + self.label.height + 2, width=86, align=uiconst.TOPLEFT, maxLength=32, setvalue=self.searchAttr) inpt.OnReturn = self.Search btn = uicontrols.Button(parent=self.sr.topParent, label=localization.GetByLabel('UI/Corporations/CorporationWindow/Standings/Search'), pos=(inpt.left + inpt.width + 2, inpt.top, 0, 0), func=self.Search, btn_default=1) self.sr.exactChkBox = uicontrols.Checkbox(text=localization.GetByLabel('UI/Corporations/CorporationWindow/Standings/SearchExact'), parent=self.sr.topParent, configName='SearchExactChk', retval=1, align=uiconst.TOPLEFT, pos=(inpt.left, inpt.top + inpt.height, 200, 0)) self.SetTopparentHeight(max(52, self.sr.exactChkBox.top + self.sr.exactChkBox.height)) if self.searchAttr: self.Search() return self
def GenerateInputLine(parent, name, title, defaultValue): """ Method wrapping toggether actions needed to create a Label-TextField combo. Params: parent -- The parent UI element. name -- Unique name of the UI element. title -- The title to be used in the label. defaultValue -- The default input value. """ container = uiprimitives.Container(parent=parent, align=uiconst.TOTOP, height=16, top=const.defaultPadding) container.padLeft = 5 container.padRight = 5 label = uicontrols.Label(text=title, name='txt%s' % name, parent=container, align=uiconst.TOLEFT, height=12, top=5, left=8, fontsize=10, letterspace=1, linespace=9, uppercase=1, state=uiconst.UI_NORMAL) label.rectTop = -2 inputField = uicontrols.SinglelineEdit(name=name, parent=container, setvalue=str(defaultValue), left=5, width=200, height=20, align=uiconst.TORIGHT) return inputField
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.itemID = attributes.Get('itemID') lpPool = sm.GetService('facwar').GetSolarSystemLPs() topCont = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, height=40, padding=(self.PADSIDE, self.PADTOP, self.PADSIDE, self.PADSIDE)) mainCont = uicontrols.ContainerAutoSize(name='mainCont', parent=self.sr.main, align=uiconst.TOTOP) bottomCont = uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOBOTTOM, height=100, padTop=self.PADTOP) uicontrols.EveLabelLarge(parent=topCont, text=localization.GetByLabel('UI/FactionWarfare/IHub/SystemUpgradePanel', systemName=cfg.evelocations.Get(session.solarsystemid2).name), align=uiconst.TOPLEFT, top=5) uicontrols.EveLabelLarge(parent=topCont, text=localization.GetByLabel('UI/FactionWarfare/IHub/TotalLP'), align=uiconst.TOPRIGHT, top=5) self.lpPoolLabel = uicontrols.EveCaptionSmall(parent=topCont, align=uiconst.TOPRIGHT, top=25) limits = [0] + const.facwarSolarSystemUpgradeThresholds + [const.facwarSolarSystemMaxLPPool] self.upgradeBars = [] for i in xrange(1, 7): bar = uicls.FWUpgradeLevelCont(parent=mainCont, align=uiconst.TOTOP, padding=(self.PADSIDE, 0, 10, 10), lowerLimit=limits[i - 1], upperLimit=limits[i], lpAmount=lpPool, level=i, idx=0) self.upgradeBars.append(bar) self.bottomGradient = uicontrols.GradientSprite(bgParent=bottomCont, rotation=-pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.3), (0.9, 0.0)]) self.bottomFlashEffect = uicontrols.GradientSprite(bgParent=bottomCont, rotation=-pi / 2, rgbData=[(0, (0.6, 0.6, 0.6))], alphaData=[(0, 0.3), (0.9, 0.0)], opacity=0.0) uiprimitives.Line(parent=bottomCont, align=uiconst.TOTOP, color=(0.3, 0.3, 0.3, 0.3)) bottomMainCont = uiprimitives.Container(name='bottomMainCont', parent=bottomCont, align=uiconst.CENTER, width=450, height=100) self.myLPLabel = uicontrols.Label(parent=bottomMainCont, text=self.GetLPOwnedLabel(), align=uiconst.TOPLEFT, left=self.PADSIDE, top=self.PADTOP) self.bottomBottomCont = uiprimitives.Container(name='bottomBottom', align=uiconst.TOPLEFT, pos=(self.PADSIDE, 40, 450, 25), parent=bottomMainCont) self.donateAmountEdit = uicontrols.SinglelineEdit(parent=self.bottomBottomCont, name='donateAmountEdit', align=uiconst.TOLEFT, setvalue=0, width=155, OnReturn=self.OnDonateLPBtn, OnChange=self.OnDonateValueChanged) self.donateBtn = uicontrols.Button(parent=self.bottomBottomCont, align=uiconst.TOLEFT, func=self.OnDonateLPBtn, label=localization.GetByLabel('UI/FactionWarfare/IHub/DonateLPs'), padLeft=4) self.donationReceivedLabel = uicontrols.EveCaptionMedium(name='donationReceivedLabel', parent=bottomMainCont, align=uiconst.TOPLEFT, text=localization.GetByLabel('UI/FactionWarfare/IHub/DonationReceived'), left=self.PADSIDE, top=50, opacity=0.0) self.bottomTaxCont = uiprimitives.Container(name='bottomTax', align=uiconst.TOPLEFT, pos=(self.PADSIDE, 73, 400, 25), parent=bottomMainCont) self.myLPToIhubLabel = None factionID = sm.GetService('facwar').GetSystemOccupier(session.solarsystemid) self.myLPTaxLabel = uicontrols.Label(name='myLPTaxLabel', parent=self.bottomTaxCont, text=localization.GetByLabel('UI/FactionWarfare/IHub/maintenanceTax', tax=int(facwarCommon.GetDonationTax(factionID) * 100)), align=uiconst.TOLEFT, state=uiconst.UI_NORMAL, left=5) self.SetLPPoolAmount(lpPool) self.UpdateMyLPAmount() self.UpdateMyLPToIHubLabel() uthread.new(self.CheckOpenThread)
def LayoutTaxInput(self, taxRate, parent, left=0, top=0): taxRateValue = taxRate.value taxRateInput = uicontrols.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 = uicontrols.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 = uiprimitives.Container(name='editField', parent=self.parent, align=uiconst.TOTOP) config = 'edit_%s' % self.type['key'] self.code = uicontrols.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 = uicontrols.EveLabelSmall(text=caption, align=uiconst.CENTERLEFT, parent=self.new, name='label', left=7, width=self.leftPush - 6)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) itemID = attributes.itemID typeID = attributes.typeID self.itemID = itemID self.typeID = typeID self.stateManager = sm.GetService('godma').GetStateManager() self.SetCaption('Attribute Inspector') self.SetWndIcon(None) self.SetTopparentHeight(0) main = uiprimitives.Container( name='main', parent=uiutil.GetChild(self, 'main'), pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) top = uiprimitives.Container(name='top', parent=main, height=20, align=uiconst.TOTOP) btn = uicontrols.Button(parent=top, label='Refresh', align=uiconst.TORIGHT, func=self.Refresh) def _OnChange(text): ntext = filter('0123456789'.__contains__, text) if ntext != text: self.input.SetValue(ntext) self.input = uicontrols.SinglelineEdit(name='itemID', parent=top, width=-1, height=-1, align=uiconst.TOALL) self.input.readonly = not eve.session.role & ROLE_GMH self.input.OnReturn = self.Refresh self.input.OnChange = _OnChange self.input.SetValue(str(self.itemID)) uiprimitives.Container(name='div', parent=main, height=5, align=uiconst.TOTOP) self.scroll = uicontrols.Scroll(parent=main) self.Refresh()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.loadingShowcontent = 0 self.SetScope('station_inflight') self.SetMinSize([400, 250]) self.SetWndIcon('res:/ui/Texture/WindowIcons/chatchannels.png') self.SetTopparentHeight(70) self.sr.inpt = inpt = uicontrols.SinglelineEdit(name='input', parent=self.sr.topParent, maxLength=60, left=74, top=20, width=86, label=localization.GetByLabel('UI/Chat/ChannelWindow/Channels')) joinBtn = uicontrols.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 = uicontrols.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 = uiprimitives.Container(name='channelsMaillist', parent=self.sr.main, left=const.defaultPadding, top=const.defaultPadding, width=const.defaultPadding, height=const.defaultPadding) self.sr.scroll = uicontrols.Scroll(parent=channelsMaillist) self.sr.scroll.multiSelect = 0 self.ShowContent()
def Show(self): if self.wnd: self.wnd.Maximize() return self.wnd = wnd = uicontrols.Window.Open(windowID='Super Search') wnd._OnClose = self.Hide wnd.SetWndIcon(None) wnd.SetTopparentHeight(0) wnd.SetCaption('Super Search') wnd.SetMinSize([256, 256]) main = uiprimitives.Container(name='main', parent=uiutil.GetChild(wnd, 'main'), pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) top = uiprimitives.Container(name='top', parent=main, height=25, align=uiconst.TOTOP) btn = uicontrols.Button(parent=top, label='Search', align=uiconst.TORIGHT, func=self.Search) self.input = uicontrols.SinglelineEdit(name='system', parent=top, width=-1, height=-1, align=uiconst.TOALL, left=1) self.input.OnReturn = self.Search uiprimitives.Container(name='div', parent=main, height=5, align=uiconst.TOTOP) self.scroll = uicontrols.Scroll(parent=main) self.scroll.Load(contentList=[], headers=['Type', 'itemID', 'Name'], fixedEntryHeight=18)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) itemID = attributes.itemID self.scope = 'all' self.sr.container = sm.GetService('invCache').GetInventoryFromId(itemID) self.sr.itemID = itemID self.sr.logIDmax = None self.sr.logIDmin = None self.SetMinSize([400, 400]) self.SetWndIcon() self.SetTopparentHeight(0) self.SetCaption(localization.GetByLabel('UI/AuditContainerLogViewer/AuditLogTitle')) self.sr.logOptions = uiprimitives.Container(name='logOptions', parent=self.sr.main, align=uiconst.TOTOP, height=36, idx=1) sidepar = uiprimitives.Container(name='sidepar', parent=self.sr.logOptions, align=uiconst.TORIGHT, width=54) btn = uix.GetBigButton(24, sidepar, 0, 12) btn.OnClick = (self.BrowseLog, 0) btn.hint = localization.GetByLabel('UI/Common/Previous') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_1') self.sr.wndBackBtn = btn btn = uix.GetBigButton(24, sidepar, 24, 12) btn.OnClick = (self.BrowseLog, 1) btn.hint = localization.GetByLabel('UI/Common/More') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_2') self.sr.wndFwdBtn = btn self.sr.fromDate = self.GetNow() inpt = uicontrols.SinglelineEdit(name='fromdate', parent=self.sr.logOptions, setvalue=self.sr.fromDate, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 16, 72, 0), maxLength=16) dateLabel = localization.GetByLabel('UI/Common/Date') uicontrols.EveHeaderSmall(text=dateLabel, parent=inpt, width=200, top=-12, state=uiconst.UI_NORMAL) self.sr.wndFromDate = inpt self.sr.wndFromDate.OnReturn = self.GetDate self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.ViewLogForContainer()
def Show(self): if self.wnd and 0: self.wnd.Maximize() return self.wnd = wnd = InsiderCameraToolsWindow.Open() self.wnd.SetWndIcon('41_13') self.wnd.SetTopparentHeight(0) self.wnd.SetCaption('Camera Tools') self.wnd.SetMinSize([180, 110]) self.width = 180 self.height = 110 maincont = uiprimitives.Container( name='maincont', parent=wnd.sr.main, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.saveBtn = uicontrols.Button(parent=maincont, name=u'SaveCamera', label=u'Save Camera orientation', pos=(45, 15, 0, 0), func=self.SaveCamera, align=uiconst.TOPLEFT) self.loadBtn = uicontrols.Button(parent=maincont, name=u'LoadCamera', label=u'Load Camera orientation', pos=(45, 45, 0, 0), func=self.LoadCamera, align=uiconst.TOPLEFT) self.edit = uicontrols.SinglelineEdit(name='edit', parent=maincont, pos=(45, 75, 140, 20), align=uiconst.TOPLEFT) try: f = open(CAMERA_FILENAME, 'r') f.close() except: self.loadBtn.state = uiconst.UI_DISABLED uthread.new(self.UpdateCameraInfo)