commit 9a2bf7d5044e62e7503beb9f64265631a92dab5f
parent 00f87f8c579222e3a002095f4285dd22fce4e148
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Sat, 9 Jan 2021 20:41:31 -0600
resize and improve scroll and focus
Diffstat:
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/opet.py b/src/opet.py
@@ -39,7 +39,7 @@ class OPET(object):
# Load up app and frame components
self.app = wx.App()
- self.app_frame = OPETFrame(self, None, title = "OPET", size = (800, 600))
+ self.app_frame = OPETFrame(self, None, title = "OPET", size = (1200, 800))
self.app_frame.Show()
self.app.MainLoop()
@@ -103,13 +103,13 @@ class OPETFrame(wx.Frame):
self.sub_panel = wx.Panel(self.main_panel)
self.sub_panel_sizer = wx.BoxSizer(wx.VERTICAL)
self.sub_panel.SetSizer(self.sub_panel_sizer)
- self.sub_panel.SetSize(4, 4, 860, 800)
+ self.sub_panel.SetSize(4, 4, 1200, 800)
# Construct esp list
self.esp_list_panel = wx.Panel(self.sub_panel)
self.esp_list_sizer = wx.BoxSizer(wx.VERTICAL)
self.esp_list_panel.SetSizer(self.esp_list_sizer)
- self.esp_list_ctrl = wxcustom.ESPListCtrl(self.esp_list_panel, size = (500, 400))
+ self.esp_list_ctrl = wxcustom.ESPListCtrl(self.esp_list_panel, size = (800, 500))
self.esp_list_ctrl.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
self.esp_list_ctrl.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.OnEndLabelEdit)
self.update_esp_list(self.manager.esp_data.get_data())
@@ -118,8 +118,8 @@ class OPETFrame(wx.Frame):
self.esp_buttons_panel.SetSizer(self.esp_buttons_panel_sizer)
self.esp_apply_button = wxcustom.ESPApplyButton(self.esp_buttons_panel)
self.esp_apply_button.Bind(wx.EVT_BUTTON, self.OnApplyChanges)
- self.esp_list_panel.SetSize(4, 4, 550, 450)
- self.esp_buttons_panel.SetSize(4, 430, 550, 200)
+ self.esp_list_panel.SetSize(8, 8, 800, 600)
+ self.esp_buttons_panel.SetSize(8, 600, 800, 100)
def update_esp_list(self, data):
self.esp_list_ctrl.DeleteAllItems()
@@ -200,6 +200,11 @@ class OPETFrame(wx.Frame):
dd = { "name" : n, "order" : o, "enabled" : e, "comments" : c, "just_changed" : j }
data.append(dd)
self.update_esp_list(self.sort_esp_data_by_order(data))
+ for i in self.manager.esp_data.get_data():
+ if i["just_changed"]:
+ #self.esp_list_ctrl.EnsureVisible(int(i["order"]))
+ self.esp_list_ctrl.Focus(int(i["order"]))
+ break
event.Veto()
def on_new_profile(self, event):
diff --git a/src/wxcustom.py b/src/wxcustom.py
@@ -27,6 +27,7 @@ class ESPListCtrl(wx.ListCtrl, listctrl.TextEditMixin, listctrl.ListCtrlAutoWidt
listctrl.ListCtrlAutoWidthMixin.__init__(self)
# Set values
+ self.setResizeColumn(3)
self.EnableCheckBoxes(True)
# Dynamics