windowDropDownMenu.py (1434B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\carbonui\control\windowDropDownMenu.py 2 import carbonui.const as uiconst 3 from carbonui.primitives.container import Container 4 from carbonui.primitives.fill import Fill 5 from carbonui.primitives.line import Line 6 from carbonui.control.label import LabelOverride as Label 7 8 class WindowDropDownMenuCore(Container): 9 default_height = 10 10 default_align = uiconst.TOLEFT 11 default_state = uiconst.UI_NORMAL 12 13 def Setup(self, name, GetMenu): 14 self.name = name 15 self.expandOnLeft = 1 16 self.PrepareLayout() 17 self.GetMenu = GetMenu 18 19 def PrepareLayout(self): 20 Line(parent=self, align=uiconst.TORIGHT) 21 self.label = Label(text=self.name, parent=self, align=uiconst.CENTER, fontsize=9, letterspace=1, top=1, state=uiconst.UI_DISABLED, uppercase=1) 22 self.hilite = Fill(parent=self, state=uiconst.UI_HIDDEN, padding=1) 23 self.width = self.label.width + 10 24 self.cursor = uiconst.UICURSOR_SELECT 25 26 def OnMouseEnter(self): 27 self.hilite.state = uiconst.UI_DISABLED 28 29 def OnMouseExit(self): 30 self.hilite.state = uiconst.UI_HIDDEN 31 32 def GetMenuPosition(self, *args): 33 return (self.absoluteLeft, self.absoluteBottom + 2) 34 35 36 class WindowDropDownMenuCoreOverride(WindowDropDownMenuCore): 37 38 @classmethod 39 def __reload_update__(cls, old_cls): 40 return old_cls