Creating a simple GrafEdit program

You can create a very simple GrafEdit program with very little code. This program lets you draw, select, and transform curve graphics. The program uses a default GrafEdit curve creation tool (for drawing curves) and a default arrow tool (for selecting and transforming curves). The curve creation tool and the canvas view use other default classes that include the curve graphic, commands to change curve graphics, and interactors to invoke commands.

You can create this application so simply because of the presenter class. The TDeimosPresenter class inherits from the TGUIPresenter class, which provides much of the basic functionality to the application. All you need to implement is a member function that creates a main view, a member function that creates an application-specific submain menu, and a member function that deactivates the submenu.

This uses a TStandardCanvasModel (a canvas representation) to store graphics and a TStandardCanvasView (a canvas view) to display them. It runs in a compound document and is ready to support undoable commands.

The following sections show the code for a simple GrafEdit application presenter.

NOTE The DeimosPresenter.h file, make file, and includes are not shown with this example.


[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