commit 93a3f6504c86a994daa1edb9cfc60f68ec7cd531
parent d6ff7a17a25a07569f88a7c5e35d349dc21dfa63
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Fri, 8 Jan 2021 00:01:23 -0600
added apply button custom class
Diffstat:
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/opet.py b/src/opet.py
@@ -122,7 +122,7 @@ class OPETFrame(wx.Frame):
self.esp_buttons_panel = wx.Panel(self.sub_panel)
self.esp_buttons_panel_sizer = wx.BoxSizer(wx.HORIZONTAL)
self.esp_buttons_panel.SetSizer(self.esp_buttons_panel_sizer)
- self.esp_apply_button = wx.Button(self.esp_buttons_panel, label = "Apply")
+ self.esp_apply_button = wxcustom.ESPApplyButton(self.esp_buttons_panel)
self.sub_panel.SetSize(4, 4, 860, 800)
self.esp_list_panel.SetSize(4, 4, 550, 450)
self.esp_buttons_panel.SetSize(4, 430, 550, 200)
diff --git a/src/wxcustom.py b/src/wxcustom.py
@@ -19,14 +19,13 @@ class ESPListCtrl(wx.ListCtrl, listctrl.TextEditMixin):
enabled and also their load order.
"""
- def __init__(self, manager, size = (400, 300)):
+ def __init__(self, parent, size = (400, 300)):
# Parent initialization
- wx.ListCtrl.__init__(self, manager, size = size, style = wx.LC_REPORT)
+ wx.ListCtrl.__init__(self, parent, size = size, style = wx.LC_REPORT)
listctrl.TextEditMixin.__init__(self)
# Set values
- self.manager = manager
self.EnableCheckBoxes(True)
# Columns
@@ -35,7 +34,7 @@ class ESPListCtrl(wx.ListCtrl, listctrl.TextEditMixin):
self.InsertColumn(2, "File")
self.InsertColumn(3, "Comment")
- # Bind
+ # Binds
self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
def OnBeginLabelEdit(self, event):
@@ -46,3 +45,21 @@ class ESPListCtrl(wx.ListCtrl, listctrl.TextEditMixin):
self.CheckItem(fi, not self.IsItemChecked(fi))
else:
event.Skip()
+
+class ESPApplyButton(wx.Button):
+ """
+ The ESPApplyButton is used to apply
+ any changes made to the esp list
+ to the actual file system.
+ """
+
+ def __init__(self, parent, label = "Apply"):
+
+ # Parent initialization
+ wx.Button.__init__(self, parent, label = label)
+
+ # Binds
+ self.Bind(wx.EVT_BUTTON, self.OnApplyChanges)
+
+ def OnApplyChanges(self, event):
+ pass