Page iterators

Page iterators provide access to the pages in a folio and establish page order. Page iterators differ from regular collection iterators because they return TPage objects and can accept ranges. A TPrintPageIterator is a printable page iterator with the same properties as TPageIterator but also has automatic printing.

The page iterator owns the objects returned by TPageIterator and those objects are valid only as long as the iterator stays in one position. You must discard or copy the TPage objects when you move the iterator to a new page. When the end of a page iterator is reached, the iterator returns a NIL pointer to indicate there are no more pages to be accessed or drawn. Further attempts to access the next or previous page will cause an exception to be thrown. To reuse a page iterator, you must reset it to the first or last page, or to some specific page within the set.

A page iterator can parse all of the pages of the folio that created it, but you cannot use it with any other folios. It can parse pages in random or sequential order, both forward and backward. One page folio can create several page iterators that operate independently. As long as the folio contents are not altered, a folio and any of its iterators can be printed simultaneously, provided they are multi-thread safe. Once a folio is deleted, its iterators are no longer valid.

When you create a page iterator, the page set it parses can be modified by providing a TPageRange object to its creator (MPageFolios are one type of TPageIterator creator). The page iterator thus created iterates only through the pages that are in the page range, skipping those that aren't included.


[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