Return to repo list

opet

Oblivion Proton .esp Tool
Return to HMagellan.com

commit a5718f13448a11603957dcf4e3a65104a2d3ae73
parent c178b6eb3bec876a7d065127c91e4a85567f48a0
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed,  6 Jan 2021 23:25:40 -0600

closer to what is needed

Diffstat:
Msrc/opet.py | 25+++++++++++++------------
Msrc/wxcustom.py | 3++-
2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/opet.py b/src/opet.py @@ -54,7 +54,8 @@ class OPETFrame(wx.Frame): # Frame geometry self.main_panel = wx.Panel(self) - self.main_panel.SetSizer(wx.BoxSizer(wx.VERTICAL)) + self.sizer = wx.BoxSizer(wx.VERTICAL) + self.main_panel.SetSizer(self.sizer) def load(self): @@ -93,18 +94,18 @@ class OPETFrame(wx.Frame): # Construct esp list espjson = self.manager.filer.read_json(os.path.join("default", "DefaultPlugins.json")) - self.scrolled_panel = scrolledpanel.ScrolledPanel(self) - self.scrolled_panel_sizer = wx.BoxSizer(wx.VERTICAL) + self.drag_list_ctrl = wxcustom.EditableListCtrl(self) + self.drag_list_ctrl.InsertColumn(0, "Enabled") + self.drag_list_ctrl.InsertColumn(1, "Order") + self.drag_list_ctrl.InsertColumn(2, "File") + self.drag_list_ctrl.InsertColumn(3, "Comment") + + index = 0 for e in espjson["discovered"]: - linesizer = wx.BoxSizer(wx.HORIZONTAL) - espname = wx.StaticText(self, label = e) - cbox = wx.CheckBox(self) - linesizer.Add(cbox, 0, wx.ADJUST_MINSIZE, 0) - linesizer.Add(espname, 1, flag = wx.EXPAND) - self.scrolled_panel_sizer.Add(linesizer) - self.scrolled_panel.SetSizer(self.scrolled_panel_sizer) - self.scrolled_panel_sizer.Fit(self.scrolled_panel) - self.scrolled_panel.SetupScrolling(scroll_y = True) + self.drag_list_ctrl.InsertItem(0, "") + self.drag_list_ctrl.SetItem(0, 1, str(index)) + self.drag_list_ctrl.SetItem(0, 2, e) + index += 1 def on_new_profile(self, event): pass diff --git a/src/wxcustom.py b/src/wxcustom.py @@ -12,12 +12,13 @@ from wx.lib.mixins import listctrl # Section 1 - Custom wx classes # ################################# -class EditableListCtrl(wx.ListCtrl, listctrl.TextEditMixin): +class EditableListCtrl(wx.ListCtrl, listctrl.CheckListCtrlMixin, listctrl.TextEditMixin): def __init__(self, manager): # Parent initialization wx.ListCtrl.__init__(self, manager, style = wx.LC_REPORT) + listctrl.CheckListCtrlMixin.__init__(self) listctrl.TextEditMixin.__init__(self) # Set values