Implementation of a Document View Class

A document view class is derived from the IlvDvDocViewInterface class. It shows the contents of its associated document and allows the end user to edit it. Here is the inheritance tree of the IlvDvDocViewInterface class:

When deriving from this class, only the initializeView method needs to be overridden.

virtual void initializeView();

This method is called to initialize the document view object according to the document data. For example, a list view can be filled according to a data set stored in the document. A sample of the body of this method is shown here:

void

ListView::initializeView()

{

IlvDvListView::initializeView();

ListDocument* document = getListDocument();

IlvUInt count;

Element* const* elements = document->getElements(count);

for(IlvUInt iElement = 0; iElement < count; iElement++)

addString(elements[iElement]->getName());

}