The TSetCanvasGraphicFillColorCmd class is a good example of a command in GrafEdit. This command changes the fill color of a canvas graphic, while enabling the user to undo and redo this change. As it inherits from TChangeCanvasGraphicCmd, the BeginChange, ContinueChange, and UndoChange classes do most of the work. To write your own commands that effect a change on a canvas graphic, your main task is to implement these functions as appropriate.
Another consideration in writing commands is how your end user works with the command. In the case of the TSetCanvasGraphicFillColorCmd command, you select menu items to kick off the execution of the command. Specifically, the TStandardCanvasFillColorSelectionState class is passed to the constructor of a TMomentaryMenuItem (in MarsPresenter.C). During the instantiation of the TStandardCanvasFillColorSelectionState object (in its constructor), you set the text associated with the menu item and instantiate the command to use (TSetCanvasGraphicFillColorCmd). You can easily modify this constructor to instantiate any command you want to effect your current canvas selection (MCanvasSelection).