Copying group copies a single item and attaches it to mousetip
System dynamics program with additional features for economics
Brought to you by:
hpcoder,
profstevekeen
Thanks, I've removed the setFocusItem feature which attaches the copied item(s) to the mouse tip after lassoing and pasting. This works especially well when one copies and pastes between different canvasses, which is related to ticket 1080.
I attach a demo of the definitive fix for this one. Certain items (constants, variables, parameters, integral operators) still remained attached to the mouse cursor upon copy and paste via right-click.
So the second outcome you showed there, that the selected widgets are
pasted where the mouse is, is now the default behaviour? That's what I want
it to be, both for usability and consistency with other programs.
Best, Steve
Professor Steve Keen
Head, School of Economics, Politics & History,
Kingston University London
www.debtdeflation.com/blogs
www.ideaeconomics.org
@ProfSteveKeen
Ph (W) +44 (0)20 8417-2306
On Sat, Jan 4, 2020 at 9:51 PM Wynand wdednam@users.sourceforge.net wrote:
Related
Bugs:
#1098Hi Steve,
That is what I had in mind, but the pasting does not quite yet occur where the mouse is. However. I've modified the code again to take this into account and have committed new code just now.
It does not paste the items exactly where the mouse is, but at least not on top of the exisitng items if one copies and pastes (instead of cutting/pasting) in the same model. I hope Russell will have a suggestion for making it more precise when he's had a chance to take a look at it.
Comment I left on the PR, but worthy of promoting to this discussion:
The problem I see with this approach is that it pastes the clipboard where the mouse pointer currently is - which will be wherever the menu cascade leaves it. My approach has been to "attach" the pasted items to the mouse, requiring a further click to indicate where the items should be positioned. This is a consistent protocol with the copy item operation and the insert item operation.
The alternative is to introduce a concept of "the cursor", which you'd have to move around with the mouse, and where copyitem, paste and insert (and incidentally text items) would place their payloads. This is the wordprocessor model.
I just checked what a drawing program might do, eg LibreOffice. It appears to paste over the top of the previously selected item. Ouch! I like my way better than that.
I've reverted to your protocol after trying to pass the x y coordinates to menubar.edit in minsky.tcl without much success. The best I could achieve always pasted the item at the right corner of the menu cascade of the canvas and sometimes even further away.
However, another subtlety has come up. When I copy and paste a selection in the same canvas, both the original and copied items remain in selection and move together with the mouse pointer.
I guess we don't really need to copy a selection of items in the same model? Individual items and groups are still copied via their own separate copy routines, but I can try to make sure that only a single copy of a selection of items exist in the same canvas. What I've done is to make sure that a counter does not exceed the number of items in the temporary copied group.
An further problem has unfortunately cropped up: it only works the first time in a given model. The second time I copy a selection in an open model, the second copy is pasted over the original selection once more.
I don't know why this happens. If you don't mind, I'll commit the code for you to review in case you have a suggestion that could help me make shorter work of this ticket.
On Mon, Jan 06, 2020 at 11:38:40PM -0000, Wynand wrote:
When pasting, one should clear the selection before adding the new
pasted items to the selection, I would think.
Cheers
--
Dr Russell Standish Phone 0425 253119 (mobile)
Principal, High Performance Coders hpcoder@hpcoders.com.au
http://www.hpcoders.com.au
Thanks, I unfortunately missed that and started overcomplicating things too much. See attached demo where I've again tried to paste at a arbitrary position in the canvas. I will revert it to your previous protocol.
Attaching demo of final proposed solution.
Looks good, but one problem: the right click menu item when you paste
should be Paste Selection. It looks like it's currently Copy Selection (45
second mark in video).
Best, Steve
Professor Steve Keen
Head, School of Economics, Politics & History,
Kingston University London
www.debtdeflation.com/blogs
www.ideaeconomics.org
@ProfSteveKeen
Ph (W) +44 (0)20 8417-2306
On Tue, Jan 7, 2020 at 1:54 PM Wynand wdednam@users.sourceforge.net wrote:
Related
Bugs:
#1098