edit(3U)

πŸ’– edit(3U) β€” the editing commands πŸ’–

okay so bestie, welcome to edit(3U) from the InterViews Reference Manual ✨ this is the Unidraw page about the little command squad that handles all your component editing βœ‚οΈπŸ“‹ slay, let's get into it 🫢


🌸 NAME 🌸

the whole girl group, one page πŸ’…:

  • ConnectCmd
  • CopyCmd
  • CutCmd
  • DeleteCmd
  • DupCmd
  • MobilityCmd
  • PasteCmd
  • RedoCmd
  • ReplaceCmd
  • SlctAllCmd
  • UndoCmd

…and collectively they're known as the editing commands πŸ‘‘


✨ SYNOPSIS ✨

#include <Unidraw/Commands/edit.h>

that's it, that's the whole vibe, go off πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so the Unidraw library ships a bunch of commands that give you all the common component editing functionality you'd expect. here's the tea on each one β˜•:

  • ConnectCmd is a non-interpretive command that connects two connectors πŸ”—
  • CopyCmd copies the selected components onto its clipboard β€” but only if it defines one β€” otherwise it goes onto the global clipboard πŸ“‹
  • CutCmd, DeleteCmd, DupCmd and PasteCmd are purely interpretive commands, which means they are always interpreted by their editor's component 🧠
  • MobilityCmd gives the selected components the opportunity to set their mobility based on the value it provides πŸšΆβ™€οΈ
  • UndoCmd and RedoCmd are non-interpretive commands that simply undo and redo the last command that affected their editor's component ↩️β†ͺ️
  • ReplaceCmd replaces the selected components with the component it stores πŸ”
  • and finally SlctAllCmd is a non-interpretive command that selects all the components displayed in its editor ✨ everything, all at once, iconic

πŸ”— CONNECTCMD PUBLIC OPERATIONS πŸ”—

ConnectCmd(
    ControlInfo*,
    Connector* source = nil, Connector* target = nil
)

ConnectCmd(Editor* = nil, Connector* = nil, Connector* = nil)

the ConnectCmd constructor optionally takes two connectors as parameters β€” the source and the target. when it gets executed, it will call Connect on source with target as its argument. it will also set the source's mobility to floating 🎈

  • void GetConnectors(Connector*& source, Connector*& target) β€” hands you back the connectors that were supplied in the constructor 🫴

πŸ“‹ COPYCMD PUBLIC OPERATIONS πŸ“‹

CopyCmd(ControlInfo*, Clipboard* = nil)
CopyCmd(Editor* = nil, Clipboard* = nil)

create a CopyCmd instance, optionally specifying a clipboard to store the copied components in πŸ’Ύ

  • virtual void Execute() β€” does literally nothing if no components are selected 😴 otherwise, Execute places a copy of the selected components onto the CopyCmd's clipboard if it's non-nil, or else onto the global clipboard (which it gets from the catalog) 🌍
  • virtual boolean Reversible() β€” CopyCmd is not reversible, periodt πŸ™…β™€οΈ

βœ‚οΈ CUTCMD PUBLIC OPERATIONS βœ‚οΈ

CutCmd(ControlInfo*, Clipboard* = nil)
CutCmd(Editor* = nil, Clipboard* = nil)

create a CutCmd instance, optionally specifying a clipboard to store the components that were cut in πŸ—ƒοΈ

  • virtual void Execute()
  • virtual void Unexecute()

CutCmd redefines these operations so the editor's component can interpret it 🧠 Execute will set the value of the _executed protected member variable to true as a side effect, and similarly, Unexecute will reset the value to false as a side effect πŸ”„


πŸ—‘οΈ DELETECMD PUBLIC OPERATIONS πŸ—‘οΈ

DeleteCmd(ControlInfo*, Clipboard* = nil)
DeleteCmd(Editor* = nil, Clipboard* = nil)

create a DeleteCmd instance, optionally specifying a clipboard to store the components that were deleted in πŸ—ƒοΈ

  • virtual void Execute()
  • virtual void Unexecute()

DeleteCmd redefines these operations so the editor's component can interpret it 🧠 Execute will set the value of the _executed protected member variable to true as a side effect, and similarly, Unexecute will reset the value to false as a side effect πŸ”„


πŸ‘― DUPCMD PUBLIC OPERATIONS πŸ‘―

DupCmd(ControlInfo*, Clipboard* = nil)
DupCmd(Editor* = nil, Clipboard* = nil)

create a DupCmd instance, optionally specifying a clipboard to store the components that were duplicated in πŸ—ƒοΈ

  • virtual void Execute()
  • virtual void Unexecute()

DupCmd redefines these operations so the editor's component can interpret it 🧠 Execute will set the value of the _executed protected member variable to true as a side effect, and similarly, Unexecute will reset the value to false as a side effect πŸ”„


πŸšΆβ™€οΈ MOBILITYCMD PUBLIC OPERATIONS πŸšΆβ™€οΈ

MobilityCmd(ControlInfo*, Mobility = Fixed)
MobilityCmd(Editor* = nil, Mobility = Fixed)

create a MobilityCmd instance, optionally specifying the mobility that interpreting components may use πŸ›Ό

  • Mobility GetMobility() β€” returns the mobility that was specified in the constructor πŸ“€

πŸ“₯ PASTECMD PUBLIC OPERATIONS πŸ“₯

PasteCmd(ControlInfo*, Clipboard* = nil)
PasteCmd(Editor* = nil, Clipboard* = nil)

create a PasteCmd instance, optionally specifying a clipboard to store the components that will be pasted in πŸ—ƒοΈ

  • virtual void Execute()
  • virtual void Unexecute()

PasteCmd redefines these operations so the editor's component can interpret it 🧠 Execute will set the value of the _executed protected member variable to true as a side effect, and similarly, Unexecute will reset the value to false as a side effect πŸ”„

  • virtual boolean Reversible() β€” PasteCmd is reversible if either its clipboard or the global clipboard is non-empty πŸ‘€

↩️ REDOCMD PUBLIC OPERATIONS ↩️

RedoCmd(ControlInfo*)
RedoCmd(Editor* = nil)

construct a new RedoCmd πŸ› οΈ

  • virtual boolean Reversible() β€” RedoCmd is not reversible πŸ™…β™€οΈ

πŸ” REPLACECMD PUBLIC OPERATIONS πŸ”

ReplaceCmd(ControlInfo*, GraphicComp* replacement = nil)
ReplaceCmd(Editor* = nil, GraphicComp* replacement = nil)

create a new ReplaceCmd, optionally supplying the GraphicComp that will replace the ones that are selected 🫳

  • GraphicComp* GetReplacement() β€” returns the replacement GraphicComp that was supplied in the constructor πŸ“¦

βœ… SLCTALLCMD PUBLIC OPERATIONS βœ…

SlctAllCmd(ControlInfo*)
SlctAllCmd(Editor* = nil)

construct a new SlctAllCmd πŸ› οΈ

  • virtual boolean Reversible() β€” SlctAllCmd is not reversible πŸ™…β™€οΈ

↩️ UNDOCMD PUBLIC OPERATIONS ↩️

UndoCmd(ControlInfo*)
UndoCmd(Editor* = nil)

construct a new UndoCmd πŸ› οΈ

  • virtual boolean Reversible() β€” UndoCmd is not reversible πŸ™…β™€οΈ

πŸ‘€ SEE ALSO πŸ‘€

the besties you should also go read, fr fr πŸ’–:

  • Catalog(3U)
  • Clipboard(3U)
  • Command(3U)
  • Connector(3U)
  • GraphicComp(3U)
  • globals(3U)

okay that's the whole page bestie, you ate that 🍽️✨ this one's from Unidraw, dated 24 January 1991 β€” yeah she's vintage, she's classic, she's older than the internet you're reading this on πŸ’€πŸ‘‘ go forth and edit, mwah πŸ’…πŸ’–