Implement auto proportion scaling weights
This commit is contained in:
@@ -270,8 +270,15 @@ class GraphControlPanel(wx.Panel):
|
||||
self.targetList.refreshExtraColumns(view.tgtExtraCols)
|
||||
self.srcTgtSizer.Detach(self.sourceList)
|
||||
self.srcTgtSizer.Detach(self.targetList)
|
||||
self.srcTgtSizer.Add(self.sourceList, self.sourceList.ColumnCount, wx.EXPAND | wx.ALL, 0)
|
||||
self.srcTgtSizer.Add(self.targetList, self.targetList.ColumnCount, wx.EXPAND | wx.LEFT, 10)
|
||||
|
||||
def getProportion(wrapperList):
|
||||
propWidth = 0
|
||||
for column in wrapperList.activeColumns:
|
||||
propWidth += column.proportionWidth
|
||||
return propWidth
|
||||
|
||||
self.srcTgtSizer.Add(self.sourceList, getProportion(self.sourceList), wx.EXPAND | wx.ALL, 0)
|
||||
self.srcTgtSizer.Add(self.targetList, getProportion(self.targetList), wx.EXPAND | wx.LEFT, 10)
|
||||
self.Layout()
|
||||
|
||||
def OnShowLegendChange(self, event):
|
||||
|
||||
@@ -34,6 +34,7 @@ from gui.viewColumn import ViewColumn
|
||||
|
||||
class GraphColumn(ViewColumn, metaclass=ABCMeta):
|
||||
|
||||
proportionWidth = 2
|
||||
stickPrefixToValue = False
|
||||
|
||||
def __init__(self, fittingView, iconID, formatSpec=(3, 0, 3)):
|
||||
|
||||
@@ -42,7 +42,9 @@ pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class BaseName(ViewColumn):
|
||||
|
||||
name = "Base Name"
|
||||
proportionWidth = 7
|
||||
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
@@ -30,6 +30,7 @@ from service.const import TargetResistMode
|
||||
class TargetResists(ViewColumn):
|
||||
|
||||
name = 'Target Resists'
|
||||
proportionWidth = 5
|
||||
|
||||
def __init__(self, fittingView, params):
|
||||
super().__init__(fittingView)
|
||||
|
||||
@@ -28,6 +28,7 @@ class ViewColumn:
|
||||
they can be used as columns in a view.
|
||||
"""
|
||||
columns = {}
|
||||
proportionWidth = 1
|
||||
|
||||
def __init__(self, fittingView):
|
||||
self.fittingView = fittingView
|
||||
|
||||
Reference in New Issue
Block a user