MoveTool(3U)

✨ MoveTool(3U) ✨

okay so bestie, we're deep in the InterViews Reference Manual right now, specifically the Unidraw corner of it, and today's main character is MoveTool πŸ’…


🌸 NAME 🌸

MoveTool β€” the tool for translating components, fr fr. That's it, that's the whole vibe. Moving stuff around. πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <Unidraw/Tools/move.h>

literally just one include and you're in, no cap ✨


πŸ’– DESCRIPTION πŸ’–

MoveTool lets the user translate components to new positions by direct manipulation. like, you grab it, you drag it, it moves. that's the whole thing. it's giving "just drag it bestie" energy 🫢


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • MoveTool(ControlInfo* = nil) β€” Create a new MoveTool. fresh out the box, nil by default, iconic behavior honestly πŸŽ€
  • virtual Manipulator* CreateManipulator( Viewer*, Event&, Transformer* ) β€” ok so this is the one, this is the moment 🫢
  • virtual void InterpretManipulator(Manipulator*) β€” and this one goes hand in hand with it, iykyk πŸ’…

so here's the tea on CreateManipulator β˜• it detects whether the user clicked on a component. and then it branches, and every branch matters, so stay with me:

  • if you did not click on a component, it clears the editor's selection and returns a nil manipulator. nothing hit, nothing happens, moving on πŸ’€
  • if a component was hit, and it was not previously selected, then CreateManipulator clears the editor's selection, selects the component the user hit, and delegates manipulator creation and interpretation to it. so like, the component takes over from here, periodt ✨
  • if the component was the only selected component, it again delegates manipulator creation and interpretation to the component, but the selection is unaltered. same delegation, but we're not touching the selection this time, okay? πŸŽ€
  • if the user clicks on one of many selected components, then CreateManipulator will delegate manipulator creation and interpretation without altering the selection by calling GraphicView::CreateManipulator and GraphicView::InterpretManipulator on the component. like literally calling those two exact things. no selection drama. 🌈
heads up bestie: CreateManipulator and InterpretManipulator are a matched set here β€” CreateManipulator does the detecting and the delegating, and InterpretManipulator is the other half of the delegation. both virtual. both doing their thing. 🫢

🌟 SEE ALSO 🌟

  • GraphicView(3U)
  • Tool(3U)

and that's the page!! πŸ’– this whole thing comes to you from Unidraw, dated 24 January 1991, and the manual page itself is named MoveTool(3U) β€” so like, technically this is MoveTool(3U) inside Unidraw, 24 January 1991, and yes she's been serving direct manipulation since the early nineties and she's still iconic for it πŸ‘‘πŸ’…πŸ¦‹