Topic: Graph.OnNewElem doesn't register on pasted elements?

Greetings,

My topic title says it all. But I like to overexplain stuff wink Here:

I verify that a script action meets the conditions to be Enabled when FunctionList elements are added, or removed.

It works for creation (OnNewElem), deletion (OnDelete) and cutting to clipboard (I guess it registers in OnDelete), but it doesn't work for pasting a new element in the grf file.

Is it possible that Graph.OnNewElem isn't executed when a new element is pasted from the clipboard?

Thanks for the help!

Action = Graph.CreateAction(Caption="Y-Offset Unit PtSeries", OnExecute=Execute, Hint="")
Graph.AddActionToMainMenu(Action)
Graph.OnNew.append(VerifActiverYOffset)
Graph.OnNewElem.append(VerifActiverYOffset)
Graph.OnDelete.append(VerifActiverYOffsetOnDelete)

Re: Graph.OnNewElem doesn't register on pasted elements?

I think that you are correct, that OnNewElem is not called when pasting elements. I will fix that in the next version.

Re: Graph.OnNewElem doesn't register on pasted elements?

Thanks for the confirmation.

Re: Graph.OnNewElem doesn't register on pasted elements?

I have fixed the problem where OnNewElem is not called when pasting and for undo/redo in the beta version of Graph 4.5. You can find it at http://padowan.dk/graph/DownloadBeta.php

Re: Graph.OnNewElem doesn't register on pasted elements?

great! thanks, I'll test this soon enough (and get back to you about dealing with lots of points and 0 undo-steps)

Re: Graph.OnNewElem doesn't register on pasted elements?

It works! 10 points for you good sir!

Re: Graph.OnNewElem doesn't register on pasted elements?

Here's a new issue : I think that "Import >> Point series" doesn't register in the "OnNewElem" event.

I believe it'd be logical if it was registered.

Re: Graph.OnNewElem doesn't register on pasted elements?

You are right. I must have missed that. I can see that Import Graph file has the same problem. I will fix it for both of them in the next beta version.

Re: Graph.OnNewElem doesn't register on pasted elements?

thanks!