SelectTool(3U)

πŸ’– SelectTool(3U) πŸ’–

okay bestie, welcome to the InterViews Reference Manual β€” this is the whole entire scoop on SelectTool, and honestly? she's the main character of your selection game ✨


🌸 NAME 🌸

SelectTool β€” the tool that changes up your editor's current selection, no cap πŸ’…


✨ SYNOPSIS ✨

#include <Unidraw/Tools/select.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So SelectTool is the girl who lets a user change the current selection by direct manipulation, which means she's out here affecting the enclosing editor's selection object. Periodt.

Here's the tea on how she works:

  • A single click directly on a component view selects that view and unselects all the others. One and done, iconic.
  • Clicking while holding the Shift key down adds the target component to the selection if it wasn't already selected, and removes it if it was. She's fluid like that 🫢
  • Wanna grab a whole group? The user can select all components within a rectangular area in the viewer by clicking somewhere outside the nearest component and dragging to specify the rectangular area. All components completely within the area will be selected. iykyk.

πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • SelectTool(ControlInfo* = nil) β€” bestie, this creates a brand new SelectTool. Fresh out the box. πŸŽ€
  • virtual Manipulator* CreateManipulator(Viewer*, Event&, Transformer*)
  • virtual void InterpretManipulator(Manipulator*) β€” here's the lore: if the user did not click on a component, then CreateManipulator creates a DragManip with a RubberRect for dragging out a rectangular area. Otherwise, CreateManipulator clears the editor's selection and selects the hit component. And if the user holds the Shift key down in either case, the components that would have otherwise been selected will be unselected, and vice versa πŸ”„. InterpretManipulator only gets called if CreateManipulator returned a non-nil manipulator; in that case, InterpretManipulator will examine the DragManipulator's RubberRect and select the component views falling completely within it. slay.

πŸ’œ PROTECTED OPERATIONS πŸ’œ

  • virtual void Localize(Selection*, Viewer*) β€” Localize makes sure that the given selection object contains only those views displayed in the given viewer. CreateManipulator calls this function to avoid possibly shift-selecting views from different components. protective queen fr fr 🧚

🌈 SEE ALSO 🌈

Editor(3U), Rubband(3I), Selection(3U), Tool(3U), Viewer(3U), manips(3U)


mwah πŸ’‹ that's the whole page, bestie β€” and it's brought to you by Unidraw, dated 24 January 1991 (yes she's vintage, and vintage is iconic, we don't make the rules πŸ’…πŸ‘‘βœ¨).