Start working on some undo / redo functionality. this is just the start, only module state changes and fit rename is implemented, and probably not very well x_x

This commit is contained in:
blitzmann
2018-07-21 00:12:28 -04:00
parent e9cb7696dd
commit 926e0a9035
7 changed files with 75 additions and 7 deletions

View File

@@ -170,6 +170,8 @@ class MainFrame(wx.Frame):
i = wx.Icon(BitmapLoader.getBitmap("pyfa", "gui"))
self.SetIcon(i)
self.command = wx.CommandProcessor()
# Create the layout and windows
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -514,6 +516,10 @@ class MainFrame(wx.Frame):
self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id=wx.ID_PREFERENCES)
# User guide
self.Bind(wx.EVT_MENU, self.goWiki, id=menuBar.wikiId)
self.Bind(wx.EVT_MENU, lambda evt: MainFrame.getInstance().command.Undo(), id=wx.ID_UNDO)
self.Bind(wx.EVT_MENU, lambda evt: MainFrame.getInstance().command.Redo(), id=wx.ID_REDO)
# EVE Forums
self.Bind(wx.EVT_MENU, self.goForums, id=menuBar.forumId)
# Save current character