def SetColorWidgets(self, rowControl):
## ????
def CheckVectorColor():
self.shSpectr.useVectorColor = useVectorColor.get()
self.shSpectr.ShowSp()
def ChangeColorMap(val=0):
cmap = SD.mColorMap()[int(float(val))]
self.shSpectr.cmap = cmap
self.lblCmap.configure(text='Map: ' + cmap)
self.shSpectr.ShowSp()
def SetVColor(val=0, ini=False):
iColor = int(float(val))
if not ini:
self.shSpectr.SetColor(iColor)
self.shSpectr.ShowSp()
self.SetLabelVectorColor()
def InverseColor():
self.shSpectr.inverseColor = inverseColor.get()
self.shSpectr.ShowSp()
def SetAlpha(val=0, ini=False):
normAlpha = Geo.Val2Val(float(val), [0, 100], [0, 1])
if not ini:
self.shSpectr.SetAlpha(normAlpha)
self.lblAlpha.configure(text="Alpha: " + str(round(normAlpha, 2)))
rowControl = self.AddLabel(rowControl, "Color", colsp=1)
inverseColor = tk.BooleanVar()
inverseColor.set(False)
self.chkInverseColor = ttk.Checkbutton(self.frControl, text="Reverse", variable=inverseColor, onvalue=True, offvalue=False, command=InverseColor)
rowControl = PlaceWidget(self.chkInverseColor, rowControl, col=1, stick='w')
cmap = self.shSpectr.cmap
self.lblCmap = ttk.Label(self.frControl, text='Map: ' + cmap)
PlaceWidget(self.lblCmap, rowControl)
vColorMap = SD.mColorMap()
indCMap = vColorMap.index(cmap)
self.scColorMap = ttk.Scale(self.frControl, orient='horizontal', length=self.colWidth2, from_=0, to=len(vColorMap)-1, value=indCMap, command=ChangeColorMap)
rowControl = PlaceWidget(self.scColorMap, rowControl, col=1, stick='ne')
useVectorColor = tk.IntVar()
useVectorColor.set(self.shSpectr.useVectorColor)
self.chkVectorColor = ttk.Checkbutton(self.frControl, variable=useVectorColor, onvalue=True, offvalue=False, command=CheckVectorColor)
rowControl = PlaceWidget(self.chkVectorColor, rowControl, col=0, stick='ew')
self.scColor = ttk.Scale(self.frControl, orient='horizontal', length=self.colWidth2, from_=0, to=self.shSpectr.numZ-1, value=self.shSpectr.iColor, command=SetVColor)
rowControl = PlaceWidget(self.scColor, rowControl, col=1, stick='ne')
SetVColor(val=self.shSpectr.iColor, ini=True)
iniAlpha = Geo.Val2Val(self.shSpectr.alpha, [0, 1], [0, 100])
self.lblAlpha = ttk.Label(self.frControl)
PlaceWidget(self.lblAlpha, rowControl)
self.scAlpha = ttk.Scale(self.frControl, orient='horizontal', length=self.colWidth2, from_=0, to=100, value=iniAlpha, command=SetAlpha)
rowControl = PlaceWidget(self.scAlpha, rowControl, col=1, stick='ne')
SetAlpha(self.scAlpha.get(), True)
return self.AddLabel(rowControl)
评论列表
文章目录