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

mapViewSettingButtons.py (1408B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\mapView\controls\mapViewSettingButtons.py
      2 from carbonui.primitives.layoutGrid import LayoutGrid
      3 from eve.client.script.ui.shared.mapView.controls.mapViewMarkersSettingButton import MapViewMarkersSettingButton
      4 
      5 class MapViewSettingButtons(LayoutGrid):
      6     onSettingsChangedCallback = None
      7 
      8     def ApplyAttributes(self, attributes):
      9         LayoutGrid.ApplyAttributes(self, attributes)
     10         self.columns = 4
     11         self.buttonIconByGroupKey = {}
     12         self.onSettingsChangedCallback = attributes.onSettingsChangedCallback
     13         self.mapViewID = attributes.mapViewID
     14         MapViewMarkersSettingButton(parent=self, callback=self.OnSettingsChanged, mapViewID=self.mapViewID)
     15 
     16     def Close(self, *args):
     17         LayoutGrid.Close(self, *args)
     18         self.buttonIconByGroupKey = None
     19         self.onSettingsChangedCallback = None
     20 
     21     def OnSettingsChanged(self, settingGroupKey, settingValue, mapViewID = None):
     22         button = self.buttonIconByGroupKey.get(settingGroupKey, None)
     23         if button:
     24             button.ReloadSettingValue()
     25         if self.onSettingsChangedCallback:
     26             self.onSettingsChangedCallback(settingGroupKey, settingValue)
     27 
     28     def UpdateButtons(self):
     29         for groupID, button in self.buttonIconByGroupKey.iteritems():
     30             button.ReloadSettingValue()