Category : Pascal Source Code
Archive   : TVCC.ZIP
Filename : TVCC.DOC

Output of file : TVCC.DOC contained in archive : TVCC.ZIP

(c) Copyright 1992. Castle Computer Services.


TVCC is a unit for Borland's TP/BP7.0 and Turbo Vision 2.0 (TV). It has
been designed to somewhat emulate the steel-grey styles of the Borland
Window's Custom Controls (BWCC). It is only useful on colour and VGA black
and white screens. Monochrome screens are handled in the normal TV fashion
with the default controls.

Using TVCC

TVCC has been designed to be has easy to use as possible, with only
one control class inherited from the main TV class library, therefore,
allowing minimal code change within existing systems. The extensions
operate mainly from instances of TApplication (TTVCCApplication) and
TDialog (TTVCCDialog).

In order to get the full effect from using TVCC, all controls should have
the ofFramed bit set in their options field prior to being inserted into the
dialog box.


Inherited from the TApplication class, TTVCCApplication adds an extra palette
to the end of the normal application palettes defined by TV. Each Application that
uses TVCC must be instances of this class.

Getpalette Function GetPalette : PPalette; virtual;
Returns a pointer to the palette given by the index in the
appPalette variable.

TVCC defines extra palettes cTVCCappColor, cTVCCAppBlackWhite and


Inherited from TDialog, each dialog that uses custom controls should be an
instance of this class.

With the exception of TButton (See below) all controls used inside dialog
boxes remain unaltered. To work correctly each control must have the ofFramed
bit in their Options field set. (See example)

Getpalette Function GetPalette : PPalette; virtual;
Returns a pointer to the palette cTVCCDialog.

Insert Procedure Insert(P : PView);
Overrides TDialog's Insert procedure checking if the ofFramed
bit is set in P. If it is, an instance of the class TFrameLine
is created and inserted before P. The ofFramed bit of P is then
reset before being inserted by a call to TDialog.Insert.


The custom control button. This button provides the illusion of a raised
surface which moves down when pressed. It is inherited from TButton.

In normal TV applications the usual size for a TButton instance would be a
depth of 2. TTVCCButton instances are larger than their TV equivalents and
should have a depth of 3. On monochrome screens this extra length is reduced
to 2 to avoid screen corruption.

Draw Procedure Draw; virtual;
Calls the method DrawNewState with Down as FALSE to Draw the

DrawNewState Procedure DrawNewState(Down : Boolean);
Equivalent of TButton's non virtual method DrawState. See TV
documentation for further details.

HandleEvent Procedure HandleEvent(var Event : TEvent); virtual;
Overrides TButton.HandleEvent calling DrawNewState to display
the view according to its current state.


TFrameLine is an object giving the illusion of a dip in the screen around
controls. Inherited from TView it is automatically used by controls having
the ofFramed bit set in the Options field.

Draw Procedure Draw; virtual;
Draws the frame around the control.

GetPalette Function GetPalette : PPalette; virtual;
Returns a pointer to the palette cTVCCFrameLine.

TStreamRec ID's

The TVCC library reserves the object type ID values 2000, 2001 and 2002. The
procedure RegisterTVCC is provided to register the object types.

All programs and documentation (c) Copyright 1992 Castle Computer Services.
All rights reserved.
All trademarks acknowledged.