eveLabelVertical.py (1064B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\control\eveLabelVertical.py 2 from carbonui.primitives.transform import Transform 3 from eve.client.script.ui.control.eveLabel import EveLabelSmall 4 from math import pi 5 6 class VerticalLabel(Transform): 7 default_rotation = pi * 0.5 8 default_wrapWidth = 100 9 default_rotationCenter = (0.0, 0.0) 10 11 def ApplyAttributes(self, attributes): 12 Transform.ApplyAttributes(self, attributes) 13 labelText = attributes.text 14 wrapWidth = attributes.get('wrapWidth', self.default_wrapWidth) 15 labelClass = attributes.get('labelClass', EveLabelSmall) 16 self.label = labelClass(text=labelText, parent=self, maxLines=2, wrapWidth=wrapWidth) 17 self.width = self.label.width 18 self.height = self.label.height 19 self.rotation = attributes.get('rotation', self.default_rotation) 20 self.rotationCenter = attributes.get('rotationCenter', self.default_rotationCenter) 21 22 def SetText(self, text): 23 self.label.SetText(text)