Page 2 of 2

Re: copy & paste a panel setting

PostPosted: Sat Feb 10, 2018 10:02 am
by tulamide
KG_is_back wrote:http://dsprobotics.com/support/viewtopic.php?f=3&t=2954&hilit=clipboard

Here... apparently, it pastes text form clipboard.

tulamide wrote:That's not quite true. The code doesn't differentiate between instances.
Imagine two instances with two elements each. The user wants to copy-paste from element 1 of instance 1 to element 2 of instance 1, and the same for instance 2.
From instance 1, element 1, he selects copy. The data is stored.
Now he switches to the second instance and from element 1 again selects copy. The data from the copy process of instance 1 is now overwritten with the data of instance two. If he now switches back to instance 1 and selects paste on element 2, he expects the data from element 1. Instead he gets the data from instance 2.
This would work with a standard clipboard (one clipboard is connected to one window).

Interesting... That is not how I'd imagined clipboard to work. I always thought the point was to have a way to transfer data even between windows...

Not with private data. You are talking of text, bitmap, etc., but you won't be able to paste in Flowstone a vector graphic that you copied in Affinity Designer. But I see what you mean. No checking of actual data, just copy-paste wherever that function is put in the schematic. Works. I still would use another method, but yes, you made the right module for your intention.

I just discovered Trog's jewel. There I could see that OpenClipboard is called with 0 as window handle, which Windows interprets as the current active process. You can also see the special type (data that can only be exchanged with one another and not all over the place, which I had in mind) there. It is 100% pure Windows clipboard, including all declared data types. Hell of a lot of work has been put in that one! I'm not sure about the red NB, but I'll test it.
http://dsprobotics.com/support/viewtopic.php?f=3&t=2181&p=10026#p10026

Re: copy & paste a panel setting

PostPosted: Sat Feb 10, 2018 1:32 pm
by HughBanton
A million thanks, KG & tulamide, just perfect.

The FS forum rocks!! Where else can you get your questions answered, AND get an education in a just couple of hours?

8-)

H

Re: copy & paste a panel setting

PostPosted: Sat Feb 10, 2018 1:41 pm
by HughBanton
Spogg wrote:
This isn't exactly what you asked for but it might inspire you. It simply sends the array from the lower graph to the upper one. Food for thought or useless?



Marvellous! (.. and code-free, for us mere mortals :lol: ) Here's a 'copy & paste' version.

I can imagine expanding this to copy a set of 6 of my graphs from one of my windows to another. Definitely food for thought.

Only trouble is (gee wizz), I'll NEVER finish it!

H