Return to repo list

opet

Oblivion Proton .esp Tool
Return to HMagellan.com

commit 56eb4d38d82e97f67e20f79ac730a9950151b70b
parent 9509e7eb0615ca7a7a3f8812cd7120905254039a
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue,  5 Jan 2021 18:14:58 -0600

Added in custom listctrl

Diffstat:
Msrc/opet.py | 11+++++++++--
Asrc/wxcustom.py | 24++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/opet.py b/src/opet.py @@ -1,5 +1,5 @@ import wx -from . import filer, tools +from . import filer, tools, wxcustom ########### # opet.py # @@ -28,7 +28,7 @@ class OPET(object): # Load up app and frame components self.app = wx.App() - self.app_frame = OPETFrame(None, title = "OPET").Show() + self.app_frame = OPETFrame(None, title = "OPET", size = (800, 600)).Show() self.app.MainLoop() ################################ @@ -83,6 +83,13 @@ class OPETFrame(wx.Frame): self.menu_bar.Append(self.help_menu, "&Help") self.SetMenuBar(self.menu_bar) + # Construct esp list + self.esp_list = wxcustom.EditableListCtrl(self) + self.esp_list.InsertColumn(0, "Enabled") + self.esp_list.InsertColumn(1, "Order") + self.esp_list.InsertColumn(2, "Filename") + self.esp_list.InsertColumn(3, "Comment") + def on_new_profile(self, event): pass def on_open_profile(self, event): diff --git a/src/wxcustom.py b/src/wxcustom.py @@ -0,0 +1,24 @@ +import wx +from wx.lib.mixins import listctrl + +############### +# wxcustom.py # +############### + +# This file contains: +# 1. Various custom classes derived from wx elements + +################################# +# Section 1 - Custom wx classes # +################################# + +class EditableListCtrl(wx.ListCtrl, listctrl.TextEditMixin): + + def __init__(self, manager): + + # Parent initialization + super(wx.ListCtrl, self).__init__(manager, style = wx.LC_REPORT|wx.BORDER_SUNKEN) + super(listctrl.TextEditMixin, self).__init__() + + # Set values + self.manager = manager