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

comboEntries.py (2448B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\carbonui\control\comboEntries.py
      2 from carbonui import uiconst, fontconst, TextColor
      3 from carbonui.control.scrollentries import SE_BaseClassCore
      4 from carbonui.primitives.line import Line
      5 from carbonui.text.color import TextColor
      6 from carbonui.util.color import Color
      7 from eve.client.script.ui.control import eveLabel
      8 from eve.client.script.ui.control.entries.generic import Generic
      9 from eve.client.script.ui.control.entries.text import Text
     10 from eve.client.script.ui.control.eveIcon import Icon
     11 
     12 class ComboEntry(Generic):
     13     sound_select = uiconst.SOUND_BUTTON_CLICK
     14     labelLeftDefault = 8
     15 
     16     def Load(self, node):
     17         super(ComboEntry, self).Load(node)
     18         iconLeft = 8
     19         if node.icon is not None:
     20             if not self.sr.icon:
     21                 self.sr.icon = Icon(parent=self, align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED, pos=(iconLeft,
     22                  0,
     23                  16,
     24                  16), ignoreSize=True)
     25             self.sr.icon.texturePath = node.icon
     26             self.sr.icon.rgba = node.iconColor
     27             self.sr.label.left = 16 + 16
     28         else:
     29             self.sr.icon = None
     30         if node.indentLevel:
     31             left = node.indentLevel * 10
     32             if self.sr.icon:
     33                 self.sr.icon.left = iconLeft + left
     34             self.sr.label.left += left
     35             self.sr.label.SetRGBA(*Color.GRAY7)
     36 
     37     def GetHeight(self, *args):
     38         return 32
     39 
     40     def LoadTooltipPanel(self, tooltipPanel, *args):
     41         if self.sr.node.loadTooltipFunc:
     42             self.sr.node.loadTooltipFunc(tooltipPanel, *args)
     43 
     44 
     45 class ComboCaptionEntry(Text):
     46 
     47     def ApplyAttributes(self, attributes):
     48         super(ComboCaptionEntry, self).ApplyAttributes(attributes)
     49         if self.GetOrder() > 0:
     50             Line(parent=self, align=uiconst.TOTOP)
     51 
     52     def _ConstructLabel(self):
     53         return eveLabel.EveLabelSmall(parent=self, left=8, top=4, color=TextColor.SECONDARY, maxLines=1, align=uiconst.CENTERLEFT)
     54 
     55     def GetHeight(self, *args):
     56         return 32
     57 
     58 
     59 class ComboSeparatorEntry(SE_BaseClassCore):
     60     default_showHilite = False
     61 
     62     def ApplyAttributes(self, attributes):
     63         super(ComboSeparatorEntry, self).ApplyAttributes(attributes)
     64         Line(parent=self, align=uiconst.TOTOP, top=4, height=1)
     65 
     66     def Load(self, data):
     67         pass
     68 
     69     def GetHeight(self, *args):
     70         return 9