Creating your own document component
If you want to begin creating your own document component, you can use the Tiles program as a starting point. You need to make the following design decisions:
- Decide what data you want in your model. Decide how you want to organize that data and what type of access you want to provide. Remember that your model is where data persists between opening and closing of you document.
- Decide how you want to present your data to the user. Start with the initial view. Decide how you will map the data in your model to the view. Remember that the view is just one part of the entire presentation of your model.
- Decide how you want to select your data. Do you want to select individual elements, ranges of elements, or all of the data? How do you want to highlight the current selection to provide feedback to the user? Make your selection as flexible as you need to but remember that it must support at least an empty selection and a whole model selection.
- Decide how you want to manipulate data selected from your model and create appropriate commands. Decide how you would make those commands undoable and redoable. Try to think of as many types of commands as you might need. Don't make command classes too specific. Notice that in the Tiles example there isn't a Red command class, a Blue command class and Green command class, just one TChangeColorCommand class from which Red, Green and Blue commands are instantiated.
- Decide what additional presentation elements you need, such as menus, control panels, and dialog boxes. Decide how you want to tie those elements to the commands that modify the data in the model.
[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