def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetWndIcon(self.iconNum, mainTop=-10) self.SetCaption(localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/Header')) self.SetMinSize([360, 240]) self.MakeUnResizeable() self.sr.windowCaption = uicontrols.CaptionLabel(text=localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/Header'), parent=self.sr.topParent, align=uiconst.RELATIVE, left=70, top=15, state=uiconst.UI_DISABLED, fontsize=18) self.SetScope('all') main = self.sr.main optimizeSettingsOptions = [(localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsSelect'), None), (localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsMemory'), 1), (localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsPerformance'), 2), (localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsQuality'), 3)] combo = self.combo = uicontrols.Combo(label='', parent=main, options=optimizeSettingsOptions, name='', select=None, callback=self.OnComboChange, labelleft=0, align=uiconst.TOTOP) combo.SetHint(localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsSelect')) combo.padding = (6, 0, 6, 0) self.messageArea = uicls.EditPlainText(parent=main, readonly=1, hideBackground=1, padding=6) self.messageArea.HideBackground() self.messageArea.RemoveActiveFrame() uicontrols.Frame(parent=self.messageArea, color=(0.4, 0.4, 0.4, 0.5)) self.messageArea.SetValue(localization.GetByLabel('UI/SystemMenu/DisplayAndGraphics/OptimizeSettings/OptimizeSettingsSelectInfo')) btns = uicontrols.ButtonGroup(btns=[[localization.GetByLabel('UI/Common/Buttons/Apply'), self.Apply, (), 66], [localization.GetByLabel('UI/Common/Buttons/Cancel'), self.CloseByUser, (), 66]], parent=main, idx=0) return self
def LoadLogo(self, corporationID): if self is None or self.destroyed: return loc = getattr(self, 'logoContainer', None) if loc is not None: uix.Flush(loc) uiutil.GetLogoIcon(itemID=corporationID, parent=loc, align=uiconst.RELATIVE, name='logo', state=uiconst.UI_NORMAL, left=12, top=3, idx=0, size=48, ignoreSize=True) loc = getattr(self, 'captionContainer', None) if loc is not None: uix.Flush(loc) caption = uicontrols.CaptionLabel(text=localization.GetByLabel( 'UI/Corporations/CorpUIHome/CorpNamePlaceholder', corpName=cfg.eveowners.Get(eve.session.corpid).ownerName), parent=loc, align=uiconst.RELATIVE, uppercase=False) caption.left = 0 infoicon = uicontrols.InfoIcon(typeID=const.typeCorporation, itemID=corporationID, parent=loc, size=16, left=caption.width + 4, top=3, state=uiconst.UI_NORMAL)
def Setup(self, template = None, readonly = False): self.typeID = None self.readonly = readonly self.boven = uiprimitives.Container(name='ccip_top', parent=self, height=ICONSIZE, align=uiconst.TOTOP) self.toolbar = uiprimitives.Container(name='ccip_bar', parent=self.boven, left=ICONSIZE + 2, top=ICONSIZE - TOOLSIZE, height=TOOLSIZE, align=uiconst.TOPLEFT, width=240) uiprimitives.Container(name='ccip_push', parent=self, height=3, align=uiconst.TOTOP) cont = uiprimitives.Container(name='mainicon', parent=self.boven, width=ICONSIZE, align=uiconst.TOLEFT) self.infoframe = uicontrols.Frame(parent=cont) self.infoicon = infoicon = InfoIcon(left=1, top=1, parent=cont, idx=0, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED) infoicon.OnClick = lambda *x: self.ShowInfo() self.icon = uicontrols.Icon(parent=cont) self.icon.OnClick = self.ShowInfo self.icon.LoadTexture('res:/UI/Texture/notavailable.dds') self.icon.width = self.icon.height = ICONSIZE uiprimitives.Container(name='ccip_push', parent=self.boven, width=6, align=uiconst.TOLEFT) cont = uiprimitives.Container(name='ccip_icon', parent=self.boven, align=uiconst.TOTOP, height=24) self.capt = uicontrols.CaptionLabel(text='', parent=cont) cont = uiprimitives.Container(name='ccip_textcont', parent=self.boven, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.text = uicontrols.Label(text='', parent=cont, align=uiconst.TOTOP, height=self.boven.height, state=uiconst.UI_NORMAL) self.scroll = uicontrols.Scroll(name='ccip_top', parent=self) if template: self.Load(template) else: self.typeID = None self.capt.text = 'Copycat' self.text.text = 'Select a ship setup from the list to display details in this panel' self.scroll.Load(contentList=[], headers=['qty', 'name'])
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.shipid = util.GetActiveShip() self.shipItem = self.GetShipItem() self.SetTopparentHeight(72) self.SetWndIcon() self.SetMinSize([300, 200]) self.sr.top = uiprimitives.Container(name='top', align=uiconst.TOTOP, parent=self.sr.topParent, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, 64)) icon = uicontrols.Icon(parent=self.sr.top, align=uiconst.TOLEFT, left=const.defaultPadding, size=64, state=uiconst.UI_NORMAL, typeID=self.shipItem.typeID) icon.GetMenu = self.ShipMenu uiprimitives.Container(name='push', align=uiconst.TOLEFT, pos=(5, 0, 5, 0), parent=self.sr.top) uicontrols.EveHeaderMedium(name='label', text=cfg.evelocations.Get(self.shipItem.itemID).name, parent=self.sr.top, align=uiconst.TOTOP, bold=True, state=uiconst.UI_NORMAL) uicontrols.EveLabelMedium(name='label', text=evetypes.GetName(self.shipItem.typeID), parent=self.sr.top, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.ship = moniker.GetShipAccess() self.conf = self.ship.GetShipConfiguration(self.shipid) modules = self.GetShipModules() for module in modules: self.sr.Set('%sPanel' % module.lower(), uiprimitives.Container(name=module, align=uiconst.TOALL, state=uiconst.UI_HIDDEN, parent=self.sr.main, pos=(0, 0, 0, 0))) tabs = [ [name, self.sr.Get('%sPanel' % module.lower(), None), self, module] for module, name in modules.iteritems() if self.sr.Get('%sPanel' % module.lower()) ] if tabs: self.sr.maintabs = uicontrols.TabGroup(name='tabparent', align=uiconst.TOTOP, height=18, parent=self.sr.main, idx=0, tabs=tabs, groupID='pospanel') else: uicontrols.CaptionLabel(text=localization.GetByLabel('UI/Ship/ShipConfig/ShipConfig'), parent=self.sr.main, size=18, uppercase=0, left=const.defaultPadding, width=const.defaultPadding, top=const.defaultPadding)
def GetUnderlay(self): if self.underlay is None: for each in uicore.layer.main.children[:]: if each is not None and not each.destroyed and each.name == 'services': uicore.registry.UnregisterWindow(each) each.OnClick = None each.Minimize = None each.Maximize = None each.Close() self.underlay = uiprimitives.Sprite(name='services', parent=uicore.layer.main, align=uiconst.TOTOP, state=uiconst.UI_HIDDEN) self.underlay.scope = 'station' self.underlay.minimized = 0 self.underlay.Minimize = self.MinimizeUnderlay self.underlay.Maximize = self.MaximizeUnderlay main = uiprimitives.Container(name='mainparentXX', parent=self.underlay, align=uiconst.TOALL, pos=(0, 0, 0, 0)) main.OnClick = self.ClickParent main.state = uiconst.UI_NORMAL sub = uiprimitives.Container(name='subparent', parent=main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) captionparent = uiprimitives.Container(name='captionparent', parent=main, align=uiconst.TOPLEFT, left=128, top=36, idx=0) caption = uicontrols.CaptionLabel(text='', parent=captionparent) self.closeBtn = uicontrols.ButtonGroup(btns=[[ localization.GetByLabel('UI/Commands/CmdClose'), self.CloseSvc, None, 81 ]], parent=sub) self.sr.underlay = uicontrols.WindowUnderlay(parent=main) self.sr.underlay.padding = (-1, -10, -1, 0) svcparent = uiprimitives.Container(name='serviceparent', parent=sub, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.underlay.sr.main = main self.underlay.sr.svcparent = svcparent self.underlay.sr.caption = caption uicore.registry.RegisterWindow(self.underlay) return self.underlay
def CreateIndicationTextsIfNeeded(self, *args): if self.indicationtext is None or self.indicationtext.destroyed: self.indicationtext = uicontrols.EveLabelMedium( parent=uicore.layer.shipui.sr.indicationContainer, name='indicationtext2', text='', align=uiconst.TOPLEFT, width=400, state=uiconst.UI_DISABLED) if self.caption is None or self.caption.destroyed: self.caption = uicontrols.CaptionLabel( text='', parent=uicore.layer.shipui.sr.indicationContainer, align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, top=1)
def GiveHint(self, hintstr, left=80, top=320, width=300): self.ClearHint() if self.hint is None: par = uiprimitives.Container(name='captionParent', parent=self.GetUnderlay().sr.main, align=uiconst.TOPLEFT, top=top, left=left, width=width, height=256, idx=0) self.hint = uicontrols.CaptionLabel(text='', parent=par, align=uiconst.TOALL, left=0, top=0) self.hint.parent.top = top self.hint.parent.left = left self.hint.parent.width = width self.hint.text = hintstr or ''
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.SetScope('station_inflight') self.SetWndIcon(self.default_iconNum) self.SetMinSize([300, 458], 1) self.LockWidth(300) self.SetTopparentHeight(64) self.MakeUnpinable() self.MouseDown = self.OnWndMouseDown self.supportLoaded = False self.tutorialsLoaded = False supportPar = uiprimitives.Container(name='supportPar', parent=self.sr.main, left=const.defaultPadding, top=const.defaultPadding, width=const.defaultPadding, height=const.defaultPadding) tutorialsPar = uiprimitives.Container(name='tutorialPar', parent=self.sr.main, pos=(0, 0, 0, 0)) t = [[ localization.GetByLabel('UI/Help/Support'), supportPar, self, ('support', ) ], [ localization.GetByLabel('UI/Help/Tutorials'), tutorialsPar, self, ('tutorials', ) ]] tabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=0, tabs=t, autoselecttab=0) tabs.ShowPanelByName(attributes.showPanel or localization.GetByLabel('UI/Help/Support')) self.sr.mainTabs = tabs uicontrols.CaptionLabel( text=localization.GetByLabel('UI/Help/EveHelp'), parent=self.sr.topParent, align=uiconst.CENTERLEFT, left=70)
def SetShortcutText(self, headerText, text, delayMs = 0, *args): if uicore.layer.shipui.sr.indicationContainer is None or uicore.layer.shipui.sr.indicationContainer.destroyed: self.shortcutText = None self.shortcutSubText = None return if self.shortcutText is None or self.shortcutText.destroyed: self.shortcutText = uicontrols.CaptionLabel(text='', parent=uicore.layer.shipui.sr.indicationContainer, align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, top=1) else: self.shortcutText.display = True if self.shortcutSubText is None or self.shortcutSubText.destroyed: self.shortcutSubText = uicontrols.EveLabelMedium(parent=uicore.layer.shipui.sr.indicationContainer, name='shortcutSubText', text='', align=uiconst.CENTERTOP, width=400, state=uiconst.UI_DISABLED, top=-20) else: self.shortcutSubText.display = True self.shortcutSubText.SetAlpha(1.0) self.shortcutText.text = headerText self.shortcutSubText.text = text self.shortcutSubText.left = (uicore.layer.shipui.sr.indicationContainer.width - self.shortcutSubText.width) / 2 self.shortcutSubText.top = self.shortcutText.top + self.shortcutText.height self.displayingShortcut = True if delayMs: uthread.new(self._DelayShowShortcutMsg, delayMs) else: self.ChangeHUDActionVisiblity(doDisplay=False)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) charID = attributes.charID self.charID = None self.corp = None self.standing2 = None self.charMgr = None self.memberinfo = None self.corporation = None self.roleGroupings = None self.myGrantableRoles = None self.myGrantableRolesAtHQ = None self.myGrantableRolesAtBase = None self.myGrantableRolesAtOther = None self.isCEOorEq = None self.userIsCEO = None self.member = None self.playerIsCEO = 0 self.playerIsDirector = 0 self.roles = 0 self.grantableRoles = 0 self.rolesAtHQ = 0 self.grantableRolesAtHQ = 0 self.rolesAtBase = 0 self.grantableRolesAtBase = 0 self.rolesAtOther = 0 self.grantableRolesAtOther = 0 self.baseID = None self.title = '' self.titleMask = 0 self.args = '' self.ddxFunction = None self.viewType = 0 self.viewRoleGroupingID = 1 self.bases = [('-', None)] self.LoadServices() self.LoadChar(charID) self.SetScope('all') if not self.member: self.Close() return self.SetTopparentHeight(70) self.SetCaption( localization.GetByLabel( 'UI/Corporations/EditMemberDialog/EditMemberCaption')) self.SetMinSize([310, 300]) self.sr.main = uiutil.GetChild(self, 'main') self.wndCombos = uiprimitives.Container(name='options', parent=self.sr.main, align=uiconst.TOTOP, height=34) viewOptionsList1 = [[ localization.GetByLabel('UI/Corporations/Common/Roles'), VIEW_ROLES ], [ localization.GetByLabel( 'UI/Corporations/Common/GrantableRoles'), VIEW_GRANTABLE_ROLES ]] viewOptionsList2 = [] for roleGrouping in self.roleGroupings.itervalues(): viewOptionsList2.append([ localization.GetByMessageID(roleGrouping.roleGroupNameID), roleGrouping.roleGroupID ]) i = 0 for optlist, label, config, defval in [ (viewOptionsList1, localization.GetByLabel('UI/Common/View'), 'viewtype', 1000), (viewOptionsList2, localization.GetByLabel('UI/Corporations/Common/GroupType'), 'rolegroup', None) ]: combo = uicontrols.Combo(label=label, parent=self.wndCombos, options=optlist, name=config, callback=self.OnComboChange, width=146, pos=(const.defaultPadding + i * 152 + 1, const.defaultPadding + 12, 0, 0)) i += 1 self.sr.dynamicScroll = uicontrols.BasicDynamicScroll( parent=self.sr.main, padding=const.defaultPadding) self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=const.defaultPadding) self.sr.standardBtns = uicontrols.ButtonGroup( btns=[[ localization.GetByLabel('UI/Common/Buttons/OK'), self.OnOK, ( ), 81 ], [ localization.GetByLabel('UI/Common/Buttons/Cancel'), self.OnCancel, (), 81 ], [ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/Apply'), self.OnApply, (), 81 ]]) self.sr.main.children.insert(0, self.sr.standardBtns) cap = uicontrols.CaptionLabel(text=cfg.eveowners.Get(self.charID).name, parent=self.sr.topParent, align=uiconst.RELATIVE, left=74, top=20) if self.member.title: uicontrols.EveHeaderLarge(text=self.member.title, parent=self.sr.topParent, align=uiconst.RELATIVE, left=cap.left, top=cap.top + cap.height, bold=True) if util.IsDustCharacter(charID): btns = [] else: btns = [[ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/GiveShares'), self.OnGiveShares, (), 81 ]] buttons = uicontrols.ButtonGroup(btns=btns) self.sr.main.children.insert(1, buttons) maintabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=0) maintabs.Startup( [[ localization.GetByLabel('UI/Generic/General'), self.sr.scroll, self, 'general', buttons ], [ localization.GetByLabel('UI/Corporations/Common/Roles'), self.sr.dynamicScroll, self, 'roles' ], [ localization.GetByLabel('UI/Corporations/Common/Titles'), self.sr.dynamicScroll, self, 'titles' ], [ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/RolesSummary'), self.sr.scroll, self, 'roles_summary' ]], 'editmemberdialog') self.sr.maintabs = maintabs self.DisplayPhoto()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.corpStationMgr = None self.services = None self.servicesByID = None self.station = None self.solarsystem = None self.serviceAccessRulesByServiceID = None self.modifiedServiceAccessRulesByServiceID = None self.serviceCostModifiers = None self.modifiedServiceCostModifiers = None self.rentableItems = None self.modifiedRentableItems = None self.ddxFunction = None self.ddxArguments = {} sm.GetService('loading').ProgressWnd(localization.GetByLabel('UI/Station/StationManagment/StationDetails'), localization.GetByLabel('UI/Common/GettingData'), 1, 4) self.SetScope('station') self.SetCaption(localization.GetByLabel('UI/Station/StationManagment/StationManagment')) self.SetMinSize([400, 300]) defaultPadding = (const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding) self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=defaultPadding) self.sr.scroll2 = uicontrols.Scroll(parent=self.sr.main, padding=defaultPadding) self.sr.scroll2.sr.id = 'station_management_scroll2' self.sr.standardBtns = uicontrols.ButtonGroup(btns=[[localization.GetByLabel('UI/Common/Buttons/OK'), self.OnOK, (), 81], [localization.GetByLabel('UI/Common/Buttons/Cancel'), self.OnCancel, (), 81]]) self.sr.main.children.insert(0, self.sr.standardBtns) self.sr.hint = None cap = uicontrols.CaptionLabel(text=cfg.evelocations.Get(eve.session.stationid).name, parent=self.sr.topParent, align=uiconst.CENTERLEFT, left=74, width=320) self.SetTopparentHeight(max(70, cap.height)) self.DisplayLogo() self.ShowLoad() sm.GetService('loading').ProgressWnd(localization.GetByLabel('UI/Station/StationServices'), localization.GetByLabel('UI/Common/GettingData'), 2, 4) self.LoadServices() self.LoadData() self.HideLoad() if not self or not self or self.destroyed: return def CreateTab(label, arg, useScroll2 = False): scroll = self.sr.scroll if useScroll2: scroll = self.sr.scroll2 return [localization.GetByLabel(label), scroll, self, arg, scroll] maintabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=0, groupID='stationmanagementpanel') maintabs.Startup([CreateTab('UI/Station/StationManagment/StationDetails', 'station_details'), CreateTab('UI/Station/StationManagment/ServiceAccessControl', 'station_service_access_control')], groupID='stationmanagementpanel') tabs = [CreateTab('UI/Station/StationManagment/CostModifiers', 'cost_modifiers'), CreateTab('UI/Station/StationManagment/CloneContracts', 'clone_contracts')] serviceMask = self.GetStationServiceMask() if const.stationServiceOfficeRental == const.stationServiceOfficeRental & serviceMask: tabs.append(CreateTab('UI/Corporations/Common/Offices', 'offices', useScroll2=True)) if self.ShouldDisplayImprovements(): tabs.append(CreateTab('UI/Station/StationManagment/StationImprovements', 'improvements')) subtabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=1, groupID='stationmanagementpanel') subtabs.Startup(tabs, groupID='stationmanagementpanel', autoselecttab=0) self.sr.maintabs = maintabs self.sr.subtabs = subtabs self.sr.maintabs.AddRow(subtabs) self.sr.maintabs.AutoSelect() sm.GetService('loading').ProgressWnd(localization.GetByLabel('UI/Commands/ProgressDone'), localization.GetByLabel('UI/Common/GettingData'), 4, 4)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.locationInfo = {} self.scope = 'all' self.SetCaption( localization.GetByLabel('UI/Contracts/ContractsWindow/IgnoreList')) self.SetWndIcon(GetContractIcon(const.conTypeNothing), mainTop=-10) self.SetMinSize([200, 200], 1) self.SetTopparentHeight(0) self.MakeUnMinimizable() self.ModalPosition() Container(name='push', parent=self.sr.main, align=uiconst.TOLEFT, width=const.defaultPadding) Container(name='push', parent=self.sr.main, align=uiconst.TORIGHT, width=const.defaultPadding) Container(name='push', parent=self.sr.main, align=uiconst.TOBOTTOM, height=const.defaultPadding) hp = Container(name='hintparent', parent=self.sr.main, align=uiconst.TOTOP, height=16, state=uiconst.UI_HIDDEN) t = uicontrols.EveLabelMedium(text=localization.GetByLabel( 'UI/Contracts/ContractsWindow/IgnoreHeader'), parent=hp, top=-3, width=self.minsize[0] - 32, state=uiconst.UI_DISABLED, align=uiconst.CENTER) hp.state = uiconst.UI_DISABLED hp.height = t.height + 8 sub = Container(name='subparent', parent=self.sr.main, align=uiconst.TOBOTTOM, height=26) self.sr.ignoreListParent = ignoreListParent = Container( name='ignoreList', align=uiconst.TOALL, pos=(0, 0, 0, 0), parent=self.sr.main) self.sr.ignoreList = ignoreList = uicontrols.Scroll( parent=ignoreListParent) ignoreList.sr.id = 'ignoreList' captionparent = Container(name='captionparent', parent=self.sr.main, align=uiconst.TOPLEFT, left=128, top=36, idx=0) caption = uicontrols.CaptionLabel(text='', parent=captionparent) self.closeBtn = uicontrols.ButtonGroup(btns=[[ localization.GetByLabel('UI/Generic/Close'), self.Close, None, 81 ]], parent=sub) self.PopulateIgnoreList() return self
def Setup(self, where=None): self.isCorp = None self.where = where self.limits = sm.GetService('marketQuote').GetSkillLimits() par = uiprimitives.Container(name='counter', parent=self, align=uiconst.TOBOTTOM, height=60, clipChildren=1) self.sr.counter = uicontrols.EveLabelMedium( parent=par, align=uiconst.TOLEFT, padding=const.defaultPadding, tabs=[175, 500], state=uiconst.UI_NORMAL) self.sr.counter2 = uicontrols.EveLabelMedium( parent=par, align=uiconst.TOLEFT, padding=(12, const.defaultPadding, const.defaultPadding, const.defaultPadding), state=uiconst.UI_NORMAL) buySellCont = uiprimitives.Container(name='buySellCont', parent=self) self.dividerCont = uicontrols.DragResizeCont(name='dividerCont', settingsID='marketOrders', parent=buySellCont, align=uiconst.TOTOP_PROP, minSize=0.25, maxSize=0.75, defaultSize=0.5, clipChildren=True) sellParent = uiprimitives.Container(name='sellParent', parent=self.dividerCont.mainCont) sellLeft = uiprimitives.Container(name='sellLeft', parent=sellParent, align=uiconst.TOLEFT, width=LEFTSIDEWIDTH) sellingText = uicontrols.CaptionLabel( text=localization.GetByLabel('UI/Market/Orders/Selling'), parent=sellLeft, align=uiconst.RELATIVE, fontsize=16, left=4, top=4) scroll = uicontrols.Scroll(name='sellscroll', parent=sellParent) scroll.multiSelect = 0 scroll.smartSort = 1 scroll.ignoreHeaderWidths = 1 scroll.sr.id = 'ordersSellScroll' scroll.OnColumnChanged = self.OnOrderSellColumnChanged self.sr.sellScroll = scroll self.sr.sellParent = sellParent buyParent = uiprimitives.Container(name='buyParent', parent=buySellCont) buyLeft = uiprimitives.Container(name='buyLeft', parent=buyParent, align=uiconst.TOLEFT, width=LEFTSIDEWIDTH) buyingText = uicontrols.CaptionLabel( text=localization.GetByLabel('UI/Market/Orders/Buying'), parent=buyLeft, align=uiconst.RELATIVE, fontsize=16, left=4, top=4) leftsidewidth = max(LEFTSIDEWIDTH, sellingText.width + 10, buyingText.width + 10) sellLeft.width = leftsidewidth buyLeft.width = leftsidewidth self.sr.counter.left = const.defaultPadding + leftsidewidth scroll = uicontrols.Scroll(name='buyscroll', parent=buyParent) scroll.multiSelect = 0 scroll.smartSort = 1 scroll.ignoreHeaderWidths = 1 scroll.sr.id = 'ordersBuyScroll' scroll.OnColumnChanged = self.OnOrderBuyColumnChanged self.sr.buyScroll = scroll if self.isCorp: buttonHint = localization.GetByLabel( 'Tooltips/Market/MarketCorpOrdersExport') else: buttonHint = localization.GetByLabel( 'Tooltips/Market/MarketMyOrdersExportButton') uicontrols.Button( label=localization.GetByLabel('UI/Market/Orders/Export'), align=uiconst.BOTTOMLEFT, parent=par, func=self.ExportToFile, hint=buttonHint) sm.RegisterNotify(self) w, h = self.GetAbsoluteSize() self._OnSizeChange_NoBlock(w, h) self.ordersInited = 1
def Execute(self, text, title, buttons, radioOptions, icon, suppText, customicon=None, height=None, width=None, default=None, modal=True): height = height or 230 width = width or 340 self.HideHeader() self.SetMinSize([width, height]) self.width = width self.height = height self.DefineIcons(icon, customicon) if title is None: title = localization.GetByLabel('UI/Common/Information') self.sr.main = uiutil.FindChild(self, 'main') push = uiprimitives.Container(name='push', align=uiconst.TOLEFT, parent=self.sr.topParent, width=64) caption = uicontrols.CaptionLabel(text=title, align=uiconst.CENTERLEFT, parent=self.sr.topParent, left=64, width=270) self.SetTopparentHeight(max(56, caption.textheight + 16)) self.sr.radioContainer = uiprimitives.Container( name='radioContainer', parent=self.sr.main, align=uiconst.TOBOTTOM, left=6, top=const.defaultPadding, width=const.defaultPadding, height=40) push = uiprimitives.Container(name='push', align=uiconst.TOLEFT, parent=self.sr.radioContainer, width=4) self.sr.radioContainer2 = uiprimitives.Container( name='radioContainer', parent=self.sr.radioContainer, align=uiconst.TOALL, pos=(6, const.defaultPadding, 6, const.defaultPadding)) self.sr.textContainer = uiprimitives.Container( name='textContainer', parent=self.sr.main, align=uiconst.TOALL, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) if text: edit = uicls.EditPlainText(parent=self.sr.textContainer, padding=const.defaultPadding, readonly=1) self.edit = edit uthread.new(self.SetText, text) h = 0 if radioOptions: self.radioboxID = 'radioButtonMessageBox_%s' % repr(title) radioSelection = settings.user.ui.Get(self.radioboxID, 'radioboxOption1Selected') for index, label in enumerate(radioOptions): checkBox = uicontrols.Checkbox( text=label, parent=self.sr.radioContainer, configName=self.radioboxID, retval='radioboxOption%dSelected' % (index + 1), checked='radioboxOption%dSelected' % (index + 1) == radioSelection, groupname=self.radioboxID, callback=self.OnCheckboxChange) h += checkBox.height self.sr.radioContainer.height = h if suppText: self.ShowSupp(suppText) self.DefineButtons(buttons, default=default) if modal: uicore.registry.SetFocus(self)