715 size=wx.Size(16, 16), style=wx.NO_BORDER) |
715 size=wx.Size(16, 16), style=wx.NO_BORDER) |
716 addbutton.SetToolTipString("Add a sub plugin") |
716 addbutton.SetToolTipString("Add a sub plugin") |
717 addbutton.Bind(wx.EVT_BUTTON, self.Gen_AddPluginMenu(plugin), id=addbutton_id) |
717 addbutton.Bind(wx.EVT_BUTTON, self.Gen_AddPluginMenu(plugin), id=addbutton_id) |
718 adddeletesizer.AddWindow(addbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER) |
718 adddeletesizer.AddWindow(addbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER) |
719 |
719 |
|
720 expandbutton_id = wx.NewId() |
|
721 expandbutton = wx.lib.buttons.GenBitmapToggleButton(id=expandbutton_id, bitmap=wx.Bitmap(os.path.join(CWD, 'images', 'plus.png')), |
|
722 name='ExpandButton', parent=leftwindow, pos=wx.Point(0, 0), |
|
723 size=wx.Size(13, 13), style=wx.NO_BORDER) |
|
724 expandbutton.labelDelta = 0 |
|
725 expandbutton.SetBezelWidth(0) |
|
726 expandbutton.SetUseFocusIndicator(False) |
|
727 expandbutton.SetBitmapSelected(wx.Bitmap(os.path.join(CWD, 'images', 'minus.png'))) |
|
728 expandbutton.SetToggle(self.PluginInfos[plugin]["expanded"]) |
|
729 |
720 if len(self.PluginInfos[plugin]["children"]) > 0: |
730 if len(self.PluginInfos[plugin]["children"]) > 0: |
721 expandbutton_id = wx.NewId() |
|
722 expandbutton = wx.lib.buttons.GenBitmapToggleButton(id=expandbutton_id, bitmap=wx.Bitmap(os.path.join(CWD, 'images', 'plus.png')), |
|
723 name='ExpandButton', parent=leftwindow, pos=wx.Point(0, 0), |
|
724 size=wx.Size(13, 13), style=wx.NO_BORDER) |
|
725 expandbutton.labelDelta = 0 |
|
726 expandbutton.SetBezelWidth(0) |
|
727 expandbutton.SetUseFocusIndicator(False) |
|
728 expandbutton.SetBitmapSelected(wx.Bitmap(os.path.join(CWD, 'images', 'minus.png'))) |
|
729 expandbutton.SetToggle(self.PluginInfos[plugin]["expanded"]) |
|
730 |
|
731 def togglebutton(event): |
731 def togglebutton(event): |
732 if expandbutton.GetToggle(): |
732 if expandbutton.GetToggle(): |
733 self.ExpandPlugin(plugin) |
733 self.ExpandPlugin(plugin) |
734 else: |
734 else: |
735 self.CollapsePlugin(plugin) |
735 self.CollapsePlugin(plugin) |
736 self.PluginInfos[plugin]["expanded"] = expandbutton.GetToggle() |
736 self.PluginInfos[plugin]["expanded"] = expandbutton.GetToggle() |
737 self.PLCConfigMainSizer.Layout() |
737 self.PLCConfigMainSizer.Layout() |
738 self.RefreshScrollBars() |
738 self.RefreshScrollBars() |
739 event.Skip() |
739 event.Skip() |
740 expandbutton.Bind(wx.EVT_BUTTON, togglebutton, id=expandbutton_id) |
740 expandbutton.Bind(wx.EVT_BUTTON, togglebutton, id=expandbutton_id) |
741 leftbuttonsizer.AddWindow(expandbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER_VERTICAL) |
741 else: |
|
742 expandbutton.Enable(False) |
|
743 iecsizer.AddWindow(expandbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER_VERTICAL) |
742 |
744 |
743 tc_id = wx.NewId() |
745 tc_id = wx.NewId() |
744 tc = wx.TextCtrl(leftwindow, tc_id, size=wx.Size(150, 35), style=wx.NO_BORDER) |
746 tc = wx.TextCtrl(leftwindow, tc_id, size=wx.Size(150, 25), style=wx.NO_BORDER) |
745 tc.SetFont(wx.Font(faces["size"] * 0.75, wx.DEFAULT, wx.NORMAL, wx.BOLD, faceName = faces["helv"])) |
747 tc.SetFont(wx.Font(faces["size"] * 0.75, wx.DEFAULT, wx.NORMAL, wx.BOLD, faceName = faces["helv"])) |
746 tc.SetValue(plugin.MandatoryParams[1].getName()) |
748 tc.SetValue(plugin.MandatoryParams[1].getName()) |
747 tc.Bind(wx.EVT_KILL_FOCUS, self.GetTextCtrlCallBackFunction(tc, plugin, "BaseParams.Name"), id=tc_id) |
749 tc.Bind(wx.EVT_KILL_FOCUS, self.GetTextCtrlCallBackFunction(tc, plugin, "BaseParams.Name"), id=tc_id) |
748 leftbuttonsizer.AddWindow(tc, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER_VERTICAL) |
750 iecsizer.AddWindow(tc, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER_VERTICAL) |
749 |
751 |
750 |
752 |
751 leftminimizebutton_id = wx.NewId() |
753 leftminimizebutton_id = wx.NewId() |
752 leftminimizebutton = wx.lib.buttons.GenBitmapToggleButton(id=leftminimizebutton_id, bitmap=wx.Bitmap(os.path.join(CWD, 'images', 'ShowVars.png')), |
754 leftminimizebutton = wx.lib.buttons.GenBitmapToggleButton(id=leftminimizebutton_id, bitmap=wx.Bitmap(os.path.join(CWD, 'images', 'ShowVars.png')), |
753 name='MinimizeButton', parent=leftwindow, pos=wx.Point(0, 0), |
755 name='MinimizeButton', parent=leftwindow, pos=wx.Point(0, 0), |