Use an alternative method to show tooltips for fittingView

This commit is contained in:
HomeWorld
2012-03-18 14:58:43 +02:00
parent de909902a2
commit e9a364f2e6
2 changed files with 18 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ except ImportError:
configforced = None
# Turns on debug mode
debug = False
debug = True
# Defines if our saveddata will be in pyfa root or not
saveInRoot = False

View File

@@ -135,22 +135,37 @@ class FittingView(d.Display):
self.itemCount = 0
self.itemRect = 0
self.tooltip = wx.ToolTip(tip = "Miscellanea")
self.tooltip.Enable(True)
self.tooltip.SetDelay(0)
self.SetToolTip(self.tooltip)
self.Bind(wx.EVT_KEY_UP, self.kbEvent)
self.Bind(wx.EVT_LEFT_DOWN, self.click)
self.Bind(wx.EVT_RIGHT_DOWN, self.click)
self.Bind(wx.EVT_SHOW, self.OnShow)
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
self.parent.Bind(gui.chromeTabs.EVT_NOTEBOOK_PAGE_CHANGED, self.pageChanged)
def OnLeaveWindow(self, event):
self.tooltip.SetTip("")
self.tooltip.Enable(True)
event.Skip()
def OnMouseMove(self, event):
row, _, col = self.HitTestSubItem(event.Position)
if row != -1 and col != -1 and col < len(self.DEFAULT_COLS):
mod = self.mods[self.GetItemData(row)]
if self.DEFAULT_COLS[col] == "Miscellanea":
tooltip = self.activeColumns[col].getToolTip(mod)
self.SetToolTipString(tooltip)
self.tooltip.SetTip(tooltip)
self.tooltip.Enable(True)
else:
self.SetToolTip(None)
self.tooltip.Enable(False)
else:
self.tooltip.Enable(False)
event.Skip()
def handleDrag(self, type, fitID):