NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

singleLineEditIntegerExtended.py (1666B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\carbonui\control\singlelineedits\singleLineEditIntegerExtended.py
      2 from carbonui.control.singlelineedits.singleLineEditInteger import SingleLineEditInteger
      3 from eve.client.script.ui.tooltips.tooltipUtil import RefreshTooltipForOwner
      4 from carbonui.control.buttonIcon import ButtonIcon
      5 from uthread2 import start_tasklet
      6 
      7 class SingleLineEditIntegerExtended(SingleLineEditInteger):
      8     defaultIncrease = 1
      9     typeID = None
     10 
     11     def OnTextChange(self, docallback = True):
     12         self.CheckHintText()
     13         self.RefreshCaretPosition()
     14         self.RefreshTextClipper()
     15         if docallback and self.OnChange:
     16             self.OnChange(self.GetText(), self.typeID)
     17         RefreshTooltipForOwner(self)
     18 
     19     def ApplyAttributes(self, attributes):
     20         super(SingleLineEditIntegerExtended, self).ApplyAttributes(attributes)
     21         self.defaultIncrease = attributes.get('increaseAmount')
     22         self.typeID = attributes.get('typeID')
     23 
     24     def OnMouseWheel(self, *args):
     25         indicator = args[0]
     26         if indicator > 0:
     27             self.ChangeNumericValue(self.defaultIncrease)
     28         else:
     29             self.ChangeNumericValue(-self.defaultIncrease)
     30 
     31     def OnNumericUpButtonMouseDown(self, *args):
     32         ButtonIcon.OnMouseDown(self.upButton, *args)
     33         self.updateNumericInputThread = start_tasklet(self.UpdateNumericInputThread, self.defaultIncrease)
     34 
     35     def OnNumericDownButtonMouseDown(self, *args):
     36         ButtonIcon.OnMouseDown(self.downButton, *args)
     37         self.updateNumericInputThread = start_tasklet(self.UpdateNumericInputThread, -self.defaultIncrease)