Added keyboard shortcut to toggle search box in market and ship browser

This commit is contained in:
blitzmann
2014-07-24 22:37:20 -04:00
parent 4f64ae9f85
commit f406d7da09
2 changed files with 15 additions and 0 deletions

View File

@@ -88,6 +88,9 @@ class PFSearchBox(wx.Window):
self.EditBox.Clear()
# self.EditBox.ChangeValue(self.descriptiveText)
def Focus(self):
self.EditBox.SetFocus()
def SetValue(self, value):
self.EditBox.SetValue(value)

View File

@@ -419,6 +419,7 @@ class MainFrame(wx.Frame):
#Graphs
self.Bind(wx.EVT_MENU, self.openGraphFrame, id=menuBar.graphFrameId)
toggleSearchBoxId = wx.NewId()
toggleShipMarketId = wx.NewId()
ctabnext = wx.NewId()
ctabprev = wx.NewId()
@@ -432,6 +433,7 @@ class MainFrame(wx.Frame):
# Close Page
self.Bind(wx.EVT_MENU, self.CloseCurrentPage, id=self.closePageId)
self.Bind(wx.EVT_MENU, self.HAddPage, id = self.addPageId)
self.Bind(wx.EVT_MENU, self.toggleSearchBox, id = toggleSearchBoxId)
self.Bind(wx.EVT_MENU, self.toggleShipMarket, id = toggleShipMarketId)
self.Bind(wx.EVT_MENU, self.CTabNext, id = ctabnext)
self.Bind(wx.EVT_MENU, self.CTabPrev, id = ctabprev)
@@ -445,6 +447,9 @@ class MainFrame(wx.Frame):
actb = [(wx.ACCEL_CTRL, ord('T'), self.addPageId),
(wx.ACCEL_CMD, ord('T'), self.addPageId),
(wx.ACCEL_CTRL, ord('F'), toggleSearchBoxId),
(wx.ACCEL_CMD, ord('F'), toggleSearchBoxId),
(wx.ACCEL_CTRL, ord("W"), self.closePageId),
(wx.ACCEL_CTRL, wx.WXK_F4, self.closePageId),
(wx.ACCEL_CMD, ord("W"), self.closePageId),
@@ -499,6 +504,13 @@ class MainFrame(wx.Frame):
sel = self.notebookBrowsers.GetSelection()
self.notebookBrowsers.SetSelection(0 if sel == 1 else 1)
def toggleSearchBox(self, event):
sel = self.notebookBrowsers.GetSelection()
if sel == 1:
self.shipBrowser.navpanel.ToggleSearchBox()
else:
self.marketBrowser.search.Focus()
def clipboardEft(self):
sFit = service.Fit.getInstance()
toClipboard(sFit.exportFit(self.getActiveFit()))