some more fixes

This commit is contained in:
2025-11-26 10:02:50 +01:00
parent 34ab17fbc9
commit e63d94e21c
3 changed files with 41 additions and 16 deletions

View File

@@ -15,7 +15,7 @@ class NotesDialog(wx.Frame):
parent_pos = parent.GetPosition()
pos = (parent_pos.x + 50, parent_pos.y + 50)
super().__init__(parent, title="IRC Notes", size=(900, 650), pos=pos,
super().__init__(parent, title="wxNotes", size=(900, 650), pos=pos,
style=wx.DEFAULT_FRAME_STYLE)
self.parent = parent
@@ -48,10 +48,19 @@ class NotesDialog(wx.Frame):
self.status_timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_status_update, self.status_timer)
self.status_timer.Start(3000) # 3 seconds
accel_tbl = wx.AcceleratorTable([
(wx.ACCEL_SHIFT, wx.WXK_ESCAPE, 1003),
])
self.SetAcceleratorTable(accel_tbl)
self.Bind(wx.EVT_MENU, lambda evt: self.close_parent(self.GetParent().GetId()), id=1003)
# Initialize status
self.update_status("Ready")
def close_parent(self, pId):
if self.GetParent().GetId() == pId:
self.GetParent().Close()
def create_controls(self):
# Create menu bar
self.create_menu_bar()
@@ -153,7 +162,7 @@ class NotesDialog(wx.Frame):
file_menu.AppendSeparator()
export_text_item = file_menu.Append(wx.ID_ANY, "Export Current Note as &Text...\tCtrl+T", "Export current note as plain text")
file_menu.AppendSeparator()
exit_item = file_menu.Append(wx.ID_EXIT, "&Close", "Close notes window")
exit_item = file_menu.Append(wx.ID_EXIT, "&Close\tSHIFT+ESC", "Close notes window")
menubar.Append(file_menu, "&File")