DND fits to GraphFrame

This commit is contained in:
HomeWorld
2010-11-11 18:25:43 +02:00
parent 031708d9e6
commit 496e91a697
2 changed files with 15 additions and 0 deletions

View File

@@ -145,6 +145,8 @@ class GraphFrame(wx.Frame):
self.draw()
except:
self.SetStatusText("Invalid values")
def AppendFitToList(self, fitID):
print "Append fit %d" % fitID
class FitList(wx.Panel):
def __init__(self, parent):

View File

@@ -1549,6 +1549,15 @@ class FitItem(wx.Window):
self.btnsStatus = ""
self.Refresh()
def checkForGraphFrame(self, wnd, gfwnd ):
while wnd is not None:
if wnd == gfwnd:
return True
else:
wnd = wnd.Parent
return False
def checkPosition(self, event):
if self.dragging and self.dragged:
self.dragging = False
@@ -1563,6 +1572,7 @@ class FitItem(wx.Window):
pjWnd = self.mainFrame.additionsPane.projectedPage
msWnd = self.mainFrame.fitMultiSwitch
cfitWnd = self.mainFrame.fitMultiSwitch.GetCurrentPage()
gfWnd = self.mainFrame.graphFrame
if not targetWnd:
return
@@ -1587,6 +1597,9 @@ class FitItem(wx.Window):
fitInst.project(activeFit,draggedFit)
wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=activeFit))
if self.checkForGraphFrame(targetWnd, gfWnd):
self.mainFrame.graphFrame.AppendFitToList(self.fitID)
event.Skip()
return