Menu

#1098 Copying group copies a single item and attaches it to mousetip

Bentham
closed
Wynand
None
4normal
2020-01-09
2019-12-21
No

When lassoing a group of items on the canvas in Minsky, and selecting "Copy" from the right-click menu, this copies the particular item the mouse pointer was hovering over and attaches it to the mousetip. The user then has to left-click to paste the copied item before they can right-click "Paste" the group as intended. The user would need to delete the unnecessary copied item.

It might be more convenient to not have the feature, where instead the user can select "Copy" and then "Paste" without producing the unnecessary extra item.

Related

Bugs: #1098

Discussion

  • Wynand

    Wynand - 2019-12-26

    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.

     
  • High Performance Coder

    • assigned_to: Wynand
     
  • Wynand

    Wynand - 2019-12-29
    • status: open --> fixed
     
  • Wynand

    Wynand - 2020-01-04
    • status: fixed --> open
     
  • Wynand

    Wynand - 2020-01-04

    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.

     
  • Wynand

    Wynand - 2020-01-04
    • status: open --> fixed
     
    • Steve Keen

      Steve Keen - 2020-01-04

      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:

      • status: open --> fixed

      Status: fixed
      Milestone: Bentham
      Created: Sat Dec 21, 2019 12:02 PM UTC by Hal Crichton-Standish
      Last Updated: Sat Jan 04, 2020 08:50 PM UTC
      Owner: Wynand

      When lassoing a group of items on the canvas in Minsky, and selecting
      "Copy" from the right-click menu, this copies the particular item the mouse
      pointer was hovering over and attaches it to the mousetip. The user then
      has to left-click to paste the copied item before they can right-click
      "Paste" the group as intended. The user would need to delete the
      unnecessary copied item.

      It might be more convenient to not have the feature, where instead the
      user can select "Copy" and then "Paste" without producing the unnecessary
      extra item.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/minsky/tickets/1098/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1098

      • Wynand

        Wynand - 2020-01-05

        Hi 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.

         
  • High Performance Coder

    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.

     
    • Wynand

      Wynand - 2020-01-06

      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.

       
      • High Performance Coder

        On Mon, Jan 06, 2020 at 11:38:40PM -0000, Wynand wrote:

        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.

        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


         
        • Wynand

          Wynand - 2020-01-07

          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.

           
        • Wynand

          Wynand - 2020-01-07

          Attaching demo of final proposed solution.

           
          • Steve Keen

            Steve Keen - 2020-01-07

            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:

            Attaching demo of final proposed solution.

            Attachments:


            Status: fixed
            Milestone: Bentham
            Created: Sat Dec 21, 2019 12:02 PM UTC by Hal Crichton-Standish
            Last Updated: Tue Jan 07, 2020 11:57 AM UTC
            Owner: Wynand

            When lassoing a group of items on the canvas in Minsky, and selecting
            "Copy" from the right-click menu, this copies the particular item the mouse
            pointer was hovering over and attaches it to the mousetip. The user then
            has to left-click to paste the copied item before they can right-click
            "Paste" the group as intended. The user would need to delete the
            unnecessary copied item.

            It might be more convenient to not have the feature, where instead the
            user can select "Copy" and then "Paste" without producing the unnecessary
            extra item.


            Sent from sourceforge.net because you indicated interest in
            https://sourceforge.net/p/minsky/tickets/1098/

            To unsubscribe from further messages, please visit
            https://sourceforge.net/auth/subscriptions/

             

            Related

            Bugs: #1098

  • High Performance Coder

    • status: fixed --> closed
     

Anonymous
Anonymous

Add attachments
Cancel