viewcmds(3U)

πŸ’– viewcmds β€” bestie edition πŸ’–

okay so this is the viewcmds page from the InterViews Reference Manual (section 3U, iykyk) and it's literally all about commands for modifying editor attributes. it's giving "Unidraw library predefines a bunch of stuff for you so you don't have to" and honestly? obsessed. πŸ’…


✨ NAME ✨

CenterCmd, CloseEditorCmd, GravityCmd, GridCmd, GridSpacingCmd, NormSizeCmd, OrientationCmd, RedToFitCmd β€” commands for modifying editor attributes. that's the whole squad, no cap 🫢


🌸 SYNOPSIS 🌸

#include <Unidraw/Commands/viewcmds.h>

one include and you're in, bestie. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the Unidraw library predefines several commands for altering the attributes of editors and their viewers. let's go down the list because each one has main character energy in its own way:

  • CenterCmd β€” centers each of the editor's viewers. perfectly balanced, as all things should be ✨
  • CloseEditorCmd β€” closes the editor, removing it from the screen. bye bestie 😭
  • GravityCmd β€” turns gravity on by activating the editor's GravityVar, if it defines one. conditional queen πŸ‘‘
  • GridCmd β€” toggles the visibility of each viewer's grid.
  • GridSpacingCmd β€” lets the user specify the grid spacing for all grids. all of them. every single one. πŸ’€
  • NormSizeCmd β€” sets each viewer's magnification to a factor of one.
  • OrientationCmd β€” toggles each viewer's orientation between landscape mode and portrait mode.
  • RedToFitCmd β€” changes each viewer's magnification so that its component view is fully visible. the "make it fit" button of your dreams fr fr

πŸŽ€ CENTERCMD PUBLIC OPERATIONS πŸŽ€

  • CenterCmd(ControlInfo*)
  • CenterCmd(Editor* = nil)

Construct a new CenterCmd. brand new, fresh out the box ✨

  • virtual void Execute()

Execute simply calls CenterOp on each of the editor's viewers. that's it, that's the whole thing, no notes.

  • virtual boolean Reversible()

CenterCmd is not reversible. nope. no undo for this one πŸ™ˆ


πŸ’œ CLOSEEDITORCMD PUBLIC OPERATIONS πŸ’œ

  • CloseEditorCmd(ControlInfo*)
  • CloseEditorCmd(Editor* = nil)

Construct a new CloseEditorCmd.

  • virtual void Execute()

Execute calls Close on the global unidraw object with the CloseEditorCmd's editor as its argument.

Execute prompts the user to save the component if it does not appear in any other open editors. so like, if this is its last chance to be saved, it WILL ask. dramatic? yes. necessary? also yes.

If no other editors are open at all, Execute creates and executes a QuitCmd. last one out, turn off the lights πŸ•―οΈ

  • virtual boolean Reversible()

CloseEditorCmd is not reversible. girl it's closing the editor, what did you expect 😭


🌈 GRAVITYCMD PUBLIC OPERATIONS 🌈

  • GravityCmd(ControlInfo*)
  • GravityCmd(Editor* = nil)

Construct a new GravityCmd.

  • virtual void Execute()

Execute calls Activate on the editor's GravityVar (if it defines one) with the inverse of the value returned by GravityVar's IsActive operation. yes, the inverse β€” it's flipping the switch, bestie πŸ”₯

  • virtual boolean Reversible()

GravityCmd is not reversible.


⭐ GRIDCMD PUBLIC OPERATIONS ⭐

  • GridCmd(ControlInfo*)
  • GridCmd(Editor* = nil)

Construct a new GridCmd.

  • virtual void Execute()

Execute calls the Visibility operation on the grid from each of the editor's viewers, supplying the inverse of the value returned by Grid's IsVisible operation. grid on, grid off, grid on, grid off β€” the eternal cycle πŸ¦‹

  • virtual boolean Reversible()

GridCmd is not reversible.


πŸ“ GRIDSPACINGCMD PUBLIC OPERATIONS πŸ“

  • GridSpacingCmd(ControlInfo*)
  • GridSpacingCmd(Editor* = nil)

Construct a new GridSpacingCmd.

  • virtual void Execute()

Execute prompts the user to specify grid spacing information through a GridDialog.

If the user does not cancel the dialog, then Execute will pass the specified grid spacing to a SetSpacing call on each viewer's grid. cancel and nothing happens β€” that's your escape hatch, use it wisely πŸ’…

  • virtual boolean Reversible()

GridSpacingCmd is not reversible.


🧚 NORMSIZECMD PUBLIC OPERATIONS 🧚

  • NormSizeCmd(ControlInfo*)
  • NormSizeCmd(Editor* = nil)

Construct a new NormSizeCmd.

  • virtual void Execute()

Execute simply calls SetMagnification with an argument of 1 on each of the editor's viewers. back to 100%, back to reality, periodt.

  • virtual boolean Reversible()

NormSizeCmd is not reversible.


πŸ’… ORIENTATIONCMD PUBLIC OPERATIONS πŸ’…

  • OrientationCmd(ControlInfo*)
  • OrientationCmd(Editor* = nil)

Construct a new OrientationCmd.

  • virtual void Execute()

Execute switches the orientation of each of the editor's viewers via their SetOrientation operation. landscape era β†’ portrait era β†’ landscape era, we love a rotation ✨

  • virtual boolean Reversible()

OrientationCmd is not reversible.


πŸ‘‘ REDTOFITCMD PUBLIC OPERATIONS πŸ‘‘

  • RedToFitCmd(ControlInfo*)
  • RedToFitCmd(Editor* = nil)

Construct a new RedToFitCmd.

  • virtual void Execute()

Execute simply calls ReduceToFit on each of the editor's viewers. everything fits, nothing is cropped, the vibe check is passed 🌸

  • virtual boolean Reversible()

RedToFitCmd is not reversible.

⚠️ okay so real talk: every single one of these commands reports Reversible() as false. none of them are undoable. don't come for me, that's just what the page says πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

BasicDialog(3U), Command(3U), Grid(3U), Unidraw(3U), Viewer(3U), catcmds(3U), globals(3U), statevars(3U)

the whole friend group, go say hi 🫢


and that's the page!! brought to you by the Unidraw era, dated 24 January 1991, filed under viewcmds(3U). mwah, love u, go center something πŸ’–βœ¨πŸŽ€