You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Page object:
Cvo_Page
#include
<Cvo/Page.h++>
new
Cvo_Page ( )
A Cvo_Page object is a collection of lines numbered 0 through N - 1.
The Cvo_Page object cannot be directly created, it must be derived
from. Though the data in a page can be anything, there are special
hooks for making use of text based pages easier. Whenever a page is
changed, it should generate a CvoPageChangedEvent (see below).
This object defines the following member functions.
SetWindow (
Cvo_Window *win )
When a line in a Cvo_Page object is changed, the object will generate
a CvoPageChangedEvent event on win. If SetWindow() is never
called, the event will never be generated.
int NumberLines (
)
This function returns the number of lines in the page.
void *GetLine (
CARD n,
[ Cvo_CharacterBuffer *cb ] )
Return a page dependent pointer which represents line n. If cb is passed, it will be set to the textual content of the line, if any.
Draw (
CARD n,
XRectangle clip,
[ int x, int y ] )
Request that line n draw itself at (x,y) ((0,0) if x and
y are not defined). Argument clip should represent the valid
rectangle in which the line may be drawn.
CARD Width (
CARD n )
CARD Height (
CARD n )
Return the width or height required to draw line n.
CARD TotalWidth (
)
CARD TotalHeight (
)
Return the total width or height required to draw all the lines in the page.
BOOL HandlePress (
CARD n,
int x,
int y )
This function informs the Cvo_Page object that a button was pressed
on line n at (x,y). If this routine returns True then the
button press was processed by the page and further processing should
be not be done.
Cvo_TextAttribute *GetAttribute (
CARD n )
Return the Cvo_TextAttribute for this line. If there is not a single
Cvo_TextAttribute for the line, or there is no Cvo_TextAttribute for the
line, NULL is returned.
Cvo_TextAttribute **GetAttributes (
CARD n )
Return an array of Cvo_TextAttribute obects for this line, one per
character. If there is only a single Cvo_TextAttribute for the
line, or no Cvo_TextAttribute for this line, NULL is returned.
BOOL Modified (
CARD n )
This function returns True if the line n may have been modified
since the last CvoPageChangedEvent event was generated. If the
derived page does not keep track of this information this function
will always return True. This information is made available to help
objects which display pages determine which lines should be redrawn
when a change takes place.
This object defines the following Cvo Events.
CvoPageChangedEvent
struct
Cvo_PageChangedEvent
BOOL newlines:1,
BOOL changedlines:1,
BOOL removedlines:1
This event is to be generated whenever a page is modified. It will
be generated on the window which was the subject of the SetWindow()
call. The three elements mean:
newlines: At least one new line has been added.
changedlines: At least one line has changed content.
removedlines: At least one line has been removed.
See the legend for information about the conventions used in this documentation.