Unit Gradpan

Classes

TGradPan -

Functions

Register - -------------------Draw text ---------------------------

Types

TDirection
TGrArray
TOneWayType
TTextEffect
TTextRotation
TTwoWayDir
TTwoWayType
TVertAlign

Constants

mxcolors

Variables


Functions


procedure Register;

-------------------Draw text ---------------------------

Types


TDirection = (bdFlat,bdStretchImage,bdTileImage,bdUp, bdDown, bdLeft, bdRight, bdHorzIn, bdHorzOut, bdVertIn, bdVertOut);

TGrArray=array[1..mxcolors] of tcolor;

TOneWayType = (Up, Down, DLeft, DRight);

TTextEffect = (tenone, teShadow, teRaised,teLowered,teEmbossed);

TTextRotation = (trNone, TrUp, TrDown);

TTwoWayDir = (Horz, Vert);

TTwoWayType = (DIn, DOut);

TVertAlign = (vlTop,vlCenter,VlBottom);

Constants

mxcolors = 100

--------------TGRADPAN V 1.0 -----------------------------------------------------------} {- TPanel with gradient fill, bitmap background and text effects, moveable and sizeable -} {-------------(C) Santiago Portela 1.998 ------------------------------------------------} {-------------- sportela@cece.es ------------------------------------------------------} {-------------- http://www.geocities.com/SiliconValley/Lakes/6217/index.htm -----------} {------ Free , free, free Free , free, free Free , free, free Free , free, free ---------} This is just as any other TPanel, whith some improvements on background paint, MOVEABLE AND SIZEABLE property Canvas: tcanvas Not published, but public so you can draw on it! property ColorStart: tcolor First color for gradients, or fill color if flat property ColorEnd: tcolor Last color for gradients property ColorShadow:tcolor Color for the shadow of the text property Bitmap: tbitmap A bitmap to use as background Note: when you do GradPan1.Bitmap:=MyBitmap, it is ASSIGNED (copied), so you could free MyBitmap property BackGroundEffect: Background effect: bdFlat Flat color (ColorStart) bdStretchImage Use bitmap stretched to panel dimension bdTileImage Use bitmap tiled bdUp Vertical gradient from ColorStart to ColorEnd bdDown Vertical gradient from ColorEnd to ColorStart bdLeft Horizontal gradient from ColorStart to ColorEnd bdRight Horizontal gradient from ColorEnd to ColorStart bdHorzIn Horizontal gradient from ColorStart to ColorEnd and back bdHorzOut Horizontal gradient from ColorEnd to ColorStart and back bdVertIn Vertical gradient from ColorStart to ColorEnd and back bdVertOut Vertical gradient from ColorEnd to ColorStart property Ctl3D:boolean If true (beware of ParentCtl3d), the border is drawn in the Color property color. If false, the background effect covers the whole extend of the panel property TextEffect: Text effect for the caption tenone The text is simply drawn in the Font property font teShadow A shadow is drawn below the text in the ColorShadow property color teRaised A shadow is drawn below the text in black; the borders are highlighted in Colorshadow teLowered A highlight is drawn below the text in black; the borders are shadowed in black teEmbossed A highlight is drawn around the text in ColorShadow property TextRotation: Direction for drawing the text trNone Horizontal, left to right TrUp Vertical, down to up TrDown Vertical, up to down property VertAlign: Where to put the text vlTop close (aligned if vertical) to the up border vlCenter centered vertically VlBottom close (aligned if vertical) to the udown border property Alignment: Alignment of the text taCenter centered horizontally taLeftJustify close (aligned y horizontal) to the left border taRightJustify close (aligned y horizontal) to the right border Property Moveable:boolean Whether the panel is user-moveable ot not property Marge: Marge -in pixels- for detecting the mouse in the sizeable borders. If 0, not sizeable property OnPanelMove: An event if you want to do something when it moves

Variables