focus.py (1134B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\comtool\focus.py 2 import weakref 3 from carbon.common.script.sys.service import Service 4 from carbonui import uiconst 5 6 class Focus(Service): 7 __guid__ = 'svc.focus' 8 __servicename__ = 'focus' 9 __displayname__ = 'Focus Tool' 10 __dependencies__ = [] 11 12 def Run(self, memStream = None): 13 self.focusChannelWindow = None 14 15 def SetChannelFocus(self, char = None): 16 channel = self.GetFocusChannel() 17 if channel is not None: 18 channel.Maximize() 19 stack = getattr(channel.sr, 'stack', None) 20 if stack and stack.state == uiconst.UI_HIDDEN: 21 return 22 channel.SetCharFocus(char) 23 24 def SetFocusChannel(self, channel = None): 25 if channel is not None: 26 self.focusChannelWindow = weakref.ref(channel) 27 else: 28 self.focusChannelWindow = None 29 30 def GetFocusChannel(self): 31 if self.focusChannelWindow: 32 ch = self.focusChannelWindow() 33 if ch and not ch.destroyed: 34 return ch