You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Output object:
Cvo_Output
Cvo_CRT
#include
<Cvo/Output.h++>
new
Cvo_Output ( char *resource_name,
{ Cvo_Object *parent | Display *display } )
The Cvo_Output object is a single line Cvo_CRT object. When entering strings into the object, the display will scroll to always display the most recently entered characters.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Flush (
)
Cause any new data to be displayed in the object.
Enter (
{ { wchar_t | char } *text | Cvo_CharacterBuffer text } )
Insert the NULL
terminated string pointed to by text at the the
current insertion point (always at the end for the standard
Cvo_Output object).
SetText (
[ { wchar_t | char } *text | Cvo_CharacterBuffer text ] )
Erase any text in the Cvo_Output object and set the text to be the
NULL
terminated string pointed to by text. If text is not
specified then the Cvo_Output box is left empty.
int NumberCharacters (
)
Return the number of wide characters in the output box.
char *GetText (
)
Return the contents of the object in a multi-byte character string.
The data may be overwritten the next time GetText()
is called on
this object, so the results of this function should be copied to a
dedicated buffer if they are required beyond a second
GetText()
call.
SetFilter (
BOOL (*filter)(Cvo_Output *, wchar_t, int, void *),
[ void *data ] )
This function is used to set a character by character filter on data being entered into the Cvo_Output object. It is actually more useful for the derived class, Cvo_Input, but is available at this level.
For each character being entered, the function filter will be
called. The four arguments passed to filter are a pointer to this
object, the character to be checked, the position of the character in
terms of wide characters, and the data argument passed to
SetFilter()
. If data is not specified then a (void *) 0
will
be passed.
The function filter should return a True
value if this character
should be accepted, False
if not.
Common types of filters are ones restricting data to be numeric only, permitting only a fixed number of characters to be entered, etc.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoOutput*Sunken
(new value:
True
)
*CvoOutput*Pad
(new value:
3
)
*CvoOutput*FontFamily
(new value:
Courier
)
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.