| 38 | |
| 39 | |
| 40 | class GraphControlPanel(wx.Panel): |
| 41 | |
| 42 | def __init__(self, graphFrame, parent): |
| 43 | super().__init__(parent) |
| 44 | self.graphFrame = graphFrame |
| 45 | self._mainInputBox = None |
| 46 | self._miscInputBoxes = [] |
| 47 | self._inputCheckboxes = [] |
| 48 | self._storedRanges = {} |
| 49 | self._storedConsts = {} |
| 50 | |
| 51 | mainSizer = wx.BoxSizer(wx.VERTICAL) |
| 52 | optsSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 53 | |
| 54 | commonOptsSizer = wx.BoxSizer(wx.VERTICAL) |
| 55 | ySubSelectionSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 56 | yText = wx.StaticText(self, wx.ID_ANY, _t('Axis Y:')) |
| 57 | ySubSelectionSizer.Add(yText, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) |
| 58 | self.ySubSelection = wx.Choice(self, wx.ID_ANY) |
| 59 | self.ySubSelection.Bind(wx.EVT_CHOICE, self.OnYTypeUpdate) |
| 60 | ySubSelectionSizer.Add(self.ySubSelection, 1, wx.EXPAND | wx.ALL, 0) |
| 61 | commonOptsSizer.Add(ySubSelectionSizer, 0, wx.EXPAND | wx.ALL, 0) |
| 62 | |
| 63 | xSubSelectionSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 64 | xText = wx.StaticText(self, wx.ID_ANY, _t('Axis X:')) |
| 65 | xSubSelectionSizer.Add(xText, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) |
| 66 | self.xSubSelection = wx.Choice(self, wx.ID_ANY) |
| 67 | self.xSubSelection.Bind(wx.EVT_CHOICE, self.OnXTypeUpdate) |
| 68 | xSubSelectionSizer.Add(self.xSubSelection, 1, wx.EXPAND | wx.ALL, 0) |
| 69 | commonOptsSizer.Add(xSubSelectionSizer, 0, wx.EXPAND | wx.TOP, 5) |
| 70 | |
| 71 | self.showLegendCb = wx.CheckBox(self, wx.ID_ANY, _t('Show legend'), wx.DefaultPosition, wx.DefaultSize, 0) |
| 72 | self.showLegendCb.SetValue(True) |
| 73 | self.showLegendCb.Bind(wx.EVT_CHECKBOX, self.OnShowLegendChange) |
| 74 | commonOptsSizer.Add(self.showLegendCb, 0, wx.EXPAND | wx.TOP, 5) |
| 75 | self.showY0Cb = wx.CheckBox(self, wx.ID_ANY, _t('Always show Y = 0'), wx.DefaultPosition, wx.DefaultSize, 0) |
| 76 | self.showY0Cb.SetValue(True) |
| 77 | self.showY0Cb.Bind(wx.EVT_CHECKBOX, self.OnShowY0Change) |
| 78 | commonOptsSizer.Add(self.showY0Cb, 0, wx.EXPAND | wx.TOP, 5) |
| 79 | optsSizer.Add(commonOptsSizer, 0, wx.EXPAND | wx.RIGHT, 10) |
| 80 | |
| 81 | graphOptsSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 82 | self.inputsSizer = wx.BoxSizer(wx.VERTICAL) |
| 83 | graphOptsSizer.Add(self.inputsSizer, 1, wx.EXPAND | wx.ALL, 0) |
| 84 | |
| 85 | vectorSize = 90 if 'wxGTK' in wx.PlatformInfo else 75 |
| 86 | self.srcVectorSizer = wx.BoxSizer(wx.VERTICAL) |
| 87 | self.srcVectorLabel = wx.StaticText(self, wx.ID_ANY, '') |
| 88 | self.srcVectorSizer.Add(self.srcVectorLabel, 0, wx.ALIGN_CENTER_HORIZONTAL| wx.BOTTOM, 5) |
| 89 | self.srcVector = VectorPicker(self, style=wx.NO_BORDER, size=vectorSize, offset=0) |
| 90 | self.srcVector.Bind(VectorPicker.EVT_VECTOR_CHANGED, self.OnNonMainInputChanged) |
| 91 | self.srcVectorSizer.Add(self.srcVector, 0, wx.SHAPED | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 0) |
| 92 | graphOptsSizer.Add(self.srcVectorSizer, 0, wx.EXPAND | wx.LEFT, 15) |
| 93 | |
| 94 | self.tgtVectorSizer = wx.BoxSizer(wx.VERTICAL) |
| 95 | self.tgtVectorLabel = wx.StaticText(self, wx.ID_ANY, '') |
| 96 | self.tgtVectorSizer.Add(self.tgtVectorLabel, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 5) |
| 97 | self.tgtVector = VectorPicker(self, style=wx.NO_BORDER, size=vectorSize, offset=0) |