Creating selections
and commands
Selections and commands work in combination to modify a data model--the selection specifies some portion of data within the model, and the command operates on the model through the selection. The CommonPoint programming model advocates using this technique instead of directly updating the data model, because it makes possible features such as:
- Multiple levels of undo and redo
- Saveless model
- Document recovery after crashes
- Scripting
- Collaboration
This step demonstrates how to add support for selecting tiles within a TTilesModel and issuing a command to change the color of a selected tile. You'll learn how to:
- Design and implement a selection
- Design and implement an undoable command
- Issue a command
- Selecting a tile and issuing a command
-
- Creating the selection class
-
- Creating the command class
-
- Code walkthrough
-
[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