Merge branch 'issue/1434' into test-3 (#1434)

# Conflicts:
#	gui/builtinViews/fittingView.py
This commit is contained in:
blitzmann
2018-02-25 01:57:36 -05:00
2 changed files with 16 additions and 11 deletions

View File

@@ -694,28 +694,27 @@ class FittingView(d.Display):
# pyfalog.critical(e)
def OnShow(self, event):
pass
# if event.Show():
# try:
# self.MakeSnapshot()
# except Exception as e:
# pyfalog.critical("Failed to make snapshot")
# pyfalog.critical(e)
# event.Skip()
if not self.IsShown():
try:
self.MakeSnapshot()
except Exception as e:
pyfalog.critical("Failed to make snapshot")
pyfalog.critical(e)
event.Skip()
def Snapshot(self):
return self.FVsnapshot
# noinspection PyPropertyAccess
def MakeSnapshot(self, maxColumns=1337):
if self.FVsnapshot:
del self.FVsnapshot
tbmp = wx.Bitmap(16, 16)
tdc = wx.MemoryDC()
tdc.SelectObject(tbmp)
font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
tdc.SetFont(font)
columnsWidths = []
@@ -728,6 +727,7 @@ class FittingView(d.Display):
except Exception as e:
pyfalog.critical("Failed to get fit")
pyfalog.critical(e)
return
if fit is None:
return

View File

@@ -19,7 +19,7 @@ import wx.lib.newevent
from gui.bitmap_loader import BitmapLoader
from gui.utils import draw
from gui.utils import color as color_utils
from service.fit import Fit
_PageChanging, EVT_NOTEBOOK_PAGE_CHANGING = wx.lib.newevent.NewEvent()
_PageChanged, EVT_NOTEBOOK_PAGE_CHANGED = wx.lib.newevent.NewEvent()
@@ -1057,6 +1057,10 @@ class _TabsContainer(wx.Panel):
Checks to see if we have a tab preview and sets up the timer for it
to display
"""
sFit = Fit.getInstance()
if not sFit.serviceFittingOptions["showTooltip"] or False:
return
if self.preview_timer:
if self.preview_timer.IsRunning():
if self.preview_wnd:
@@ -1286,6 +1290,7 @@ class _TabsContainer(wx.Panel):
if not self.preview_tab.GetSelected():
page = self.Parent.GetPage(self.GetTabIndex(self.preview_tab))
if page.Snapshot():
self.preview_wnd = PFNotebookPagePreview(
self,
(mposx + 3, mposy + 3),