ConnectCmd, CopyCmd, CutCmd, DeleteCmd, DupCmd, MobilityCmd, PasteCmd, RedoCmd, ReplaceCmd, SlctAllCmd,
Contents
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 executed, it will call Connect on source with target as its argument. It will also
set the source's mobility to floating.
voidGetConnectors(Connector*&source,Connector*&target)
Return the connectors supplied in the constructor.
Copycmd Public Operations
CopyCmd(ControlInfo*,Clipboard*=nil)CopyCmd(Editor*=nil,Clipboard*=nil)
Create a CopyCmd instance, optionally specifying a clipboard in which to store copied components.
virtualvoidExecute()
Execute does nothing if no components are selected. Otherwise, Execute places a copy of the
selected components onto the CopyCmd's clipboard if is non-nil or else onto the global clipboard
(obtained from the catalog).
virtualbooleanReversible()
CopyCmd is not reversible.
Cutcmd Public Operations
CutCmd(ControlInfo*,Clipboard*=nil)CutCmd(Editor*=nil,Clipboard*=nil)
Create a CutCmd instance, optionally specifying a clipboard in which to store the components that
were cut.
virtualvoidExecute()virtualvoidUnexecute()
CutCmd redefines these operations to let the editor's component interpret it. Execute will set
the value of the _executed protected member variable to true as a side effect. 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 in which to store the components
that were deleted.
virtualvoidExecute()virtualvoidUnexecute()
DeleteCmd redefines these operations to let the editor's component interpret it. Execute will set
the value of the _executed protected member variable to true as a side effect. Similarly,
Unexecute will reset the value to false as a side effect.
Description
The Unidraw library defines several commands that offer common component editing functionality.
ConnectCmd is a non-interpretive command that connects two connectors. CopyCmd copies selected
components onto its clipboard (if it defines one) or onto the global clipboard. CutCmd, DeleteCmd,
DupCmd, and PasteCmd are purely interpretive commands that are always interpreted by their editor's
component. MobilityCmd gives 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 selected components with the
component it stores. Finally, SlctAllCmd is a non-interpretive command that selects all the components
displayed in its editor.
Dupcmd Public Operations
DupCmd(ControlInfo*,Clipboard*=nil)DupCmd(Editor*=nil,Clipboard*=nil)
Create a DupCmd instance, optionally specifying a clipboard in which to store the components that
were duplicated.
virtualvoidExecute()virtualvoidUnexecute()
DupCmd redefines these operations to let the editor's component interpret it. Execute will set the
value of the _executed protected member variable to true as a side effect. 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.
MobilityGetMobility()
Return the mobility specified in the constructor.
Name
ConnectCmd, CopyCmd, CutCmd, DeleteCmd, DupCmd, MobilityCmd, PasteCmd, RedoCmd, ReplaceCmd, SlctAllCmd,
UndoCmd - editing commands
Pastecmd Public Operations
PasteCmd(ControlInfo*,Clipboard*=nil)PasteCmd(Editor*=nil,Clipboard*=nil)
Create a PasteCmd instance, optionally specifying a clipboard in which to store the components
that will be pasted.
virtualvoidExecute()virtualvoidUnexecute()
PasteCmd redefines these operations to let the editor's component interpret it. Execute will set
the value of the _executed protected member variable to true as a side effect. Similarly,
Unexecute will reset the value to false as a side effect.
virtualbooleanReversible()
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.
virtualbooleanReversible()
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 those that are
selected.
GraphicComp*GetReplacement()
Return the replacement GraphicComp supplied in the constructor.
See Also
Catalog(3U), Clipboard(3U), Command(3U), Connector(3U), GraphicComp(3U), globals(3U) Unidraw 24 January 1991 edit(3U)
Slctallcmd Public Operations
SlctAllCmd(ControlInfo*)SlctAllCmd(Editor*=nil)
Construct a new SlctAllCmd.
virtualbooleanReversible()
SlctAllCmd is not reversible.
Synopsis
#include<Unidraw/Commands/edit.h>
Undocmd Public Operations
UndoCmd(ControlInfo*)UndoCmd(Editor*=nil)
Construct a new UndoCmd.
virtualbooleanReversible()
UndoCmd is not reversible.
