panelBase.py (3665B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\info\shipInfoPanels\panelBase.py 2 import eveicon 3 from carbonui import Align 4 from carbonui.control.scrollContainer import ScrollContainer 5 from carbonui.primitives.container import Container 6 from eve.client.script.ui.shared.info.shipInfoConst import DOWN_FRONT_LEFT 7 from carbonui.primitives.gradientSprite import GradientSprite 8 9 class PanelBase(Container): 10 RIGHT_CONT_WIDTH = 420 11 COMPACT_TOP_PADDING = 40 12 __notifyevents__ = [] 13 14 def ApplyAttributes(self, attributes): 15 super(PanelBase, self).ApplyAttributes(attributes) 16 self._controller = attributes.controller 17 self._params = attributes.params 18 self._construct_layout() 19 self._gather_data() 20 self._construct_content() 21 self._construct_content_minimized() 22 sm.RegisterNotify(self) 23 24 @property 25 def typeID(self): 26 return self._controller.type_id 27 28 @property 29 def itemID(self): 30 return self._controller.item_id 31 32 @property 33 def groupID(self): 34 return self._controller.group_id 35 36 @property 37 def ownerID(self): 38 return self._controller.owner_id 39 40 @property 41 def item(self): 42 return self._controller.item 43 44 @item.setter 45 def item(self, value): 46 self._controller.item = value 47 48 def Close(self): 49 super(PanelBase, self).Close() 50 sm.UnregisterNotify(self) 51 52 def _gather_data(self): 53 pass 54 55 def _construct_layout(self): 56 self.expandedCont = Container(parent=self, name='expandedCont', align=Align.TOALL) 57 self.leftCont = Container(parent=self.expandedCont, name='leftCont', align=Align.TOLEFT, padRight=10) 58 self.rightCont = Container(parent=self.expandedCont, name='rightCont', align=Align.TOALL) 59 GradientSprite(bgParent=self.rightCont, padding=-130, rgbData=((0, (0, 0, 0)),), alphaData=((0.0, 0.0), (0.25, 0.6))) 60 self.minimizedCont = Container(parent=self, name='minimizedCont', align=Align.TOALL) 61 self.minimized_footer = Container(name='minimized_footer', parent=self.minimizedCont, display=False, align=Align.TOBOTTOM, padTop=10) 62 self._construct_minimized_content_scroll() 63 64 def _construct_minimized_content_scroll(self): 65 self.content_scroll_minimized = ScrollContainer(parent=self.minimizedCont, align=Align.TOALL) 66 67 def _construct_content(self): 68 pass 69 70 def _construct_content_minimized(self): 71 pass 72 73 def show_expanded_view(self): 74 self.minimizedCont.Hide() 75 self._enable_expanded_view() 76 self.expandedCont.Show() 77 78 def _enable_expanded_view(self): 79 pass 80 81 def show_minimized_view(self, is_compact): 82 self.expandedCont.Hide() 83 self._enable_minimized_view() 84 self.minimizedCont.padTop = self._get_compact_top_padding() if is_compact else 0 85 self.minimizedCont.Show() 86 87 def _enable_minimized_view(self): 88 pass 89 90 def on_reset(self, initialize): 91 pass 92 93 def _OnSizeChange_NoBlock(self, width, height): 94 self.leftCont.width = width - min(width / 2, self.RIGHT_CONT_WIDTH) - self.leftCont.padRight 95 96 @classmethod 97 def get_name(cls): 98 return '' 99 100 @classmethod 101 def get_icon(cls): 102 return eveicon.info 103 104 @classmethod 105 def is_visible(cls, typeID, itemID = None, rec = None): 106 return True 107 108 def get_camera_position(self): 109 return DOWN_FRONT_LEFT 110 111 def get_zoom(self): 112 return 0.6 113 114 def get_tab_type(self): 115 return 0 116 117 def _get_compact_top_padding(self): 118 return self.COMPACT_TOP_PADDING