Commands

Commands provide a friendly user-interface for making changes to the data in the model. Commands support a higher degree of application extensibility than direct function calls, because commands can be executed across application and event machine boundaries, handle system failures more gracefully, and can be undone and redone.

Figure 14 shows the GrafEdit commands derived from TCommandOn<MCanvasSelection>. TCommandOn<MCanvasSelection> is a Document framework template class. At run time, derived classes of TCommandOn<MCanvasSelection> change the graphics in the representation that are defined by the selection. TChangeCanvasGraphicCmd derived classes are concrete classes for changing canvas graphics. You can derive from TChangeCanvasGraphicCmd to write your own custom command.

The commands shown in Figure 14 are the most common commands for manipulating and setting attributes of canvas graphics. These commands can be used without any modification on your part, support undo and redo, and operate on the current MCanvasSelection. Any of these commands can be used in any GrafEdit program regardless of the derived canvas representation and selection in use.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker