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'sGravityVar, 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 reportsReversible()asfalse. 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 πβ¨π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms