Added Close item to File menu to close current fit
We should remove the silly MMB support now that File->Close is in place (also, that gives us Ctrl/Cmd-W support "for free")
This commit is contained in:
@@ -115,6 +115,12 @@ class MainFrame(wx.Frame):
|
|||||||
if tab != -1:
|
if tab != -1:
|
||||||
self.notebookBrowsers.SetSelection(tab)
|
self.notebookBrowsers.SetSelection(tab)
|
||||||
|
|
||||||
|
def CloseCurrentFit(self, evt):
|
||||||
|
self.fitMultiSwitch.removeTab(self.fitMultiSwitch.GetSelection())
|
||||||
|
#Deleting a tab might have put us on the "+" tab, make sure we don't stay there
|
||||||
|
if self.fitMultiSwitch.GetSelection() == self.fitMultiSwitch.GetPageCount() - 1:
|
||||||
|
self.fitMultiSwitch.SetSelection(self.fitMultiSwitch.GetPageCount() - 2)
|
||||||
|
|
||||||
def ExitApp(self, evt):
|
def ExitApp(self, evt):
|
||||||
try:
|
try:
|
||||||
service.SettingsProvider.getInstance().saveAll()
|
service.SettingsProvider.getInstance().saveAll()
|
||||||
@@ -163,6 +169,8 @@ class MainFrame(wx.Frame):
|
|||||||
menuBar = self.GetMenuBar()
|
menuBar = self.GetMenuBar()
|
||||||
# Quit
|
# Quit
|
||||||
self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT)
|
self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT)
|
||||||
|
# Close Tab
|
||||||
|
self.Bind(wx.EVT_MENU, self.CloseCurrentFit, id=wx.ID_CLOSE)
|
||||||
# Widgets Inspector
|
# Widgets Inspector
|
||||||
self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911)
|
self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911)
|
||||||
# About
|
# About
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class MainMenuBar(wx.MenuBar):
|
|||||||
# File menu
|
# File menu
|
||||||
fileMenu = wx.Menu()
|
fileMenu = wx.Menu()
|
||||||
self.Append(fileMenu, "&File")
|
self.Append(fileMenu, "&File")
|
||||||
|
fileMenu.Append(wx.ID_CLOSE)
|
||||||
fileMenu.Append(wx.ID_EXIT)
|
fileMenu.Append(wx.ID_EXIT)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user