The Presentation framework provides a stationery class template that lets you easily construct a document component using your model and view. TGUIModelViewStationeryFor<AModel, AView> creates a document component using the specified model and a default presenter on the specified view.
To create a new document, the framework calls the TGUIModelViewStationeryFor<AModel, AView>::CreateDocument function. To construct the document, the CreateDocument function:
In this diagram, note that the only classes you have to implement are TTilesModel and TTilesView (classes you create are indicated by a dot in these diagrams). This is one of the simplest ways to create a Presentation framework program--just plugging in your own data model and content view. The Presentation framework places the view in a resizable window, and builds and displays the standard menu including Document and Edit submenus.
To use the stationery, you need to instantiate the class template into a template class for your model and view classes. This requires a single line of code somewhere within the source code for the Tiles program, declaring a static instance of TGUIModelViewStationeryFor<AModel, AView> based on the TTilesModel and TTilesView classes.
NOTE Recent additions to C++ provide syntax that doesn't require you to declare a static instance for each template instantiation. This syntax will be supported in a later version of the CommonPoint application system.