A custom view is a view which can be accessed like any other view, using row and property operations, but which is fully managed by a customized "viewer" class. The viewer will eventually handle all requests for the view, such as defining its structure and size, as well as providing the actual data values when requested.

Custom views are read-only in this version, and cannot propagate changes.

To implement a custom view, you must derive your viewer from this base class and define each of the virtual members. Then create a new object of this type on the heap and pass it to the c4_View constructor. Your viewer will automatically be destroyed when the last reference to its view goes away. See the DBF2MK sample code for an example of a viewer.

virtual bool GetItem (int row_, int col_, c4_Bytes& buf_);
  Fetch one data item, return it as a generic data value

virtual int GetSize ();
  Return the number of rows in this view

virtual c4_View GetTemplate ();
  Return the structure of this view (initialization, called once)

c4_CustomViewer ();
  Constructor, must be overriden in derived class

virtual ~c4_CustomViewer ();
  Destructor

class c4_CustomViewer