Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Views User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

12.6 Using or Not Using Command Objects

Commands are ideal for performing actions initiated by the end-user. When you manipulate the canvas programmatically, you can avoid contending with the overhead of creating command objects and then recording them in the transaction model for undo/redo.

Commands are the ideal approach for performing common actions. If you want to use commands without logging them in the transaction model, turn off logging in the model before you execute the command.

If you want to avoid using commands completely, call the methods in the model directly. Remember that even though a command recalls what action it is performing, it always calls methods in the model to complete the action. Find the appropriate method for what you want to do in the model. The viewport displaying your canvas does not update automatically when you use commands. To update the viewport programmatically, call CODModel::UpdateComponents() to notify all of the model's observers that a portion of the screen needs updating.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.