uctrls(3U)

πŸ’… uctrls β€” the InterViews Reference Manual glow-up ✨

okay bestie, so this is uctrls(3U) from the InterViews Reference Manual, and it's literally the home of all the predefined UControl and UControlInteractor subclasses for the controls you keep seeing everywhere. come sit, we're doing this 🫢


πŸŽ€ NAME πŸŽ€

CommandControl, PanelControl, HPanelControl, VPanelControl, CommandInteractor, PanelInteractor β€” the predefined UControl and UControlInteractor subclasses for common controls. like, the whole friend group, no cap.


✨ SYNOPSIS ✨

#include <Unidraw/uctrls.h>

that's it. one include. iconic behavior πŸ’–


🌸 DESCRIPTION 🌸

so CommandControl is a UControl subclass that executes a Command. and where do you see them? mostly in menus, bestie, that's their whole moment. CommandInteractor is a UControlInteractor subclass that CommandControls create to define their appearance. it's giving "I made my own outfit".

then we have PanelControl, a subclass of UControl that gives you a radiobutton-like interface for selecting from a set of mutually-exclusive choices. you hand it an interactor when you create it, and that interactor defines its appearance. PanelControls are often used to create ``palettes'' of interactors that engage the current Tool instance. yes, mutual exclusivity, we love a "you can only pick one" rule πŸ”₯

PanelInteractor is a UControlInteractor subclass that defines an appearance that is often appropriate for PanelControls. and HPanelControl and VPanelControl are subclasses of PanelControl that use PanelInteractor instances by default. convenient? extremely. πŸ’…


πŸ‘‘ COMMANDCONTROL PUBLIC OPERATIONS πŸ‘‘

  • CommandControl(ControlInfo*)
  • CommandControl(const char*, ControlInfo*)

Create a CommandControl, optionally supplying an instance name. The constructors automatically create and insert a ControlInteractor to define the CommandControl's appearance. no extra work from you, queen, it just handles it ✨

  • virtual void Do()

okay so here's the tea πŸ“ β€” if the ControlInfo's owner is a reversible command, then Do will create a copy of the command, execute it, and log it (if it remains reversible following execution). if the owner is an irreversible command, then Do will execute it without copying or logging it. two very different vibes, so know which one you're dealing with fr fr.


πŸ¦‹ COMMANDINTERACTOR PUBLIC OPERATIONS πŸ¦‹

  • CommandInteractor(ControlInfo*)

Create a CommandInteractor with the given ControlInfo object. The CommandInteractor displays the ControlInfo's label and keylabel side-by-side as would befit a menu entry. side-by-side, like besties walking into the function πŸ’œ


🌈 PANELCONTROL PUBLIC OPERATIONS 🌈

  • PanelControl(Interactor*, ControlInfo*, ControlState* = nil)
  • PanelControl( const char*, Interactor*, ControlInfo*, ControlState* = nil )

Create a PanelControl, supplying an interactor that defines its appearance, a ControlInfo object, and optionally an instance name and a ControlState, which all PanelControls in a palette should share to ensure mutual exclusion. share the state, keep the exclusivity, that's the whole point bestie 😌

  • virtual void Do()

Do simply calls Down. so when the KeyMap executes the keyboard equivalent specified in the ControlInfo, it has the same effect as clicking on the PanelControl instance. keyboard click = mouse click, same energy, no difference 🌸


🧚 PANELCONTROL SUBCLASS PUBLIC OPERATIONS 🧚

  • HPanelControl(ControlInfo*, ControlState* = nil)
  • HPanelControl(const char*, ControlInfo*, ControlState* = nil)
  • VPanelControl(ControlInfo*, ControlState* = nil)
  • VPanelControl(const char*, ControlInfo*, ControlState* = nil)

HPanelControls and VPanelControls simply create an instance of PanelInteractor and pass it to the PanelControl constructor. and listen β€” HPanelControls should be used in row-oriented palettes, and VPanelControls should be used in column-oriented palettes. h for horizontal, v for vertical, pick the right one or your layout is gonna be a mess πŸ’€


⭐ PANELINTERACTOR PUBLIC OPERATIONS ⭐

  • PanelInteractor(ControlInfo*, Orientation)

Create a PanelInteractor with the given orientation and ControlInfo object. The PanelInteractor will draw the ControlInfo's label in the center of its canvas and the keylabel in the lower right. Horizontal orientation is appropriate for row-oriented instances, while Vertical orientation is appropriate for column-oriented instances. center label, corner keylabel, that's the layout, periodt πŸ’…


πŸ’– SEE ALSO πŸ’–

Command(3U), ControlInfo(3U), KeyMap(3U), Tool(3U), UControl(3U), globals(3U)

go read those too, iykyk πŸ“š


and that's the whole page, bestie!! this was brought to you by Unidraw, dated 20 November 1990 β€” yes she's vintage, yes she still slays. mwah πŸ’‹βœ¨