Unit AlPanel

== Version information ======================================================== Designed by : © Krzysztof Bacalski Created : 27.03.97 Modified : 01.05.98 Current Version : 3.02 === Description ================================================================ I wasn't satisfied with smart components(that care for aligning of their children controls) so I decided to write my own. This aligning panel takes care for all its children-controls what means that during self resizing aligning panel moves (\resizes) its children. Its biggest advantage is that it calculates their coordinates and stores these data in dynamic array as records of previous positions that are of the real type. In this way you avoid error caused by rounding calculated position ratio -> after each resizing of the AligningPanel your controls will be placed in right positions. In components, I met, this problem was unsolved and in this way after a few resizings you received you controls dropped at strange locations!!! === Tech info ================================================================== - New Properties : --AligningActive - if true during resizing panel takes care for all its children; automatically disabled when properties: - MoveHorizontaly/Verticaly - SizePanelsBevels - GlueLabels change their values --MinHeight - minimal height of the panel down to which it moves its children --MinWidth - minimal width of the panel down to which it moves its children --MoveHorizontaly - true -> horizontal children movement enabled --MoveVerticaly - true -> vertical children movement enabled --SizePanelsBevels - true -> all children panels and bevels are sized when being moved --GlueLabels - true -> causes the labels with assigned FocusControls to moved like the Focuscontrols themselves -------------------------------------------------------------------------------- WARNING : I don't check if during AligningActive you move one of the children yourself. So if you want to do something like this I recomend to set AligningActive to false first! -------------------------------------------------------------------------------- === Usage ====================================================================== Set AligningActive property to true to align components proportionaly according to theirs previous positions and panel shapes' change. By manipulating with MoveHorizontaly and MoveVerticaly properties you can handle different alignings' kinds. Set MinHeight/width to specify the minimal height/width down to which panel should move ist children(zero-means no height/widht restrictions) Set SizePanelsBevels to true if you want to see all children panels and bevels being resized during their move. Set GlueLabels to true if you want your labels to keep the same distance to their FocusControls. ================================================================================ All suggestions are welcome. You are free to use this component. If you appretiate it let me know . E-mail: kbac@inet.com.pl (TAlPanel) -------------------------------------------------------------------------------- Revisions & fixes: 1. Loaded method supported - dynamic creation error eliminated 2. Designing question assign mimimum props added ==================================================================== ChriB'98 =

Classes

TAligningPanel -

Functions

Register - ControlCount <> 0

Types

ArrayType
ElementType

Constants

MaxArraySize

Variables


Functions


procedure Register;

ControlCount <> 0

Types


ArrayType      = array[1..MaxArraySize] of ElementType;

ElementType = record
PrevLeft : Real;
PrevTop : Real;
PrevWidth : Real;
PrevHeight : Real;
end;

Constants

MaxArraySize = (65520 div SizeOf(ElementType))


Variables