Guidelines
- Derive your view class from TDocumentComponentView. Using TDocumentComponentView allows the user to embed instances of your component into other components.
- Override DrawContents so that it renders graphics in the view. For example, you can simply fill the view with a solid color. If you have already implemented a data storage model, you can override DrawContents so that it displays the data stored in the model.
- Implement DrawContents so that it can draw regardless of whether the view has access to a TGUIBundle. Use GetGUIBundle to determine whether the view's GUI bundle is NIL (it will be if Taligent UI Builder creates an instance of your view class). If it is NIL, draw something that doesn't require information from the TGUIBundle. For example, you can simply fill the view with a solid color.
- Implement DrawContents so that it can draw regardless of whether the view is in a view hierarchy. The easiest way to do this is to initialize the visible aspects of the view, such as its size, the first time the system calls DrawContents. The system may call on the view to render off-screen, for example to a printer, immediately after you create the view.
- You can override HandleAfterAdoption so that it initialize values and objects that the view uses for purposes other than rendering. The CommonPoint application system calls HandleAfterAdoption just after adding the view to a parent view in a view hierarchy and before rendering the view on the screen.
- In Taligent UI Builder, create a view. Open the view's inspector and expand the Information panel. In the Information panel, enter the name of your view class and the name of its shared library. When you close the inspector, Taligent UI Builder replaces the view with an instance of your view class. Save the Taligent UI Builder archive for later use.
[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