The Frame unit contains the objects:
TAFrame
TFrameList

TAFrame

TAFrame is a truly transparent windowed control, valuable for applications needing the user to graphically define some coordinates, move and size other controls or graphical objects at runtime, or simply add an additional designelement.

TAFrame is a descendent of TWincontrol introducing following additional properties, methods and events:

Published

property OnFrameChanged : TNotifyEvent
OnFrameChanged occurs when the user changed to another frame. Use the OnFrameChanged event handler to write code that responds to active Frame changes.

property OnBoundsChanged : TNotifyEvent
OnBoundsChanged occurs when the Size or Position of the active frame changed. Use the OnBoundsChanged event handler to write code that responds to active Frame changes.

property Color : TColor
The active color of the frame.

property ColorInActive : TColor
The color displayed when the frame is inactive (the color is internally grayed down).

property UseColorInActive : Bool
If false, the frame always shows the Color value, whether active or inactive.

property FrameStyle : TFrameStyle
TFrameStyle = (fsWindow, fsFlat, fsRunning);
specifies the style of a frame's border. This can be:
fsWindow : specifies a 3-D Windowlike frame. Values for BorderWidth with this style are limited to 2..5.
fsRunning : draws a running border. BorderWidth values are limited to the range 0..3.
fsFlat : draws a simple flat border. No BorderWidth limits.

property BorderStyle : TBorderStyle
TBorderStyle = (bsSizeable, bsFixed);
bsFixed : Frame is moveable but not sizeable.
bsSizeable : Frame is moveable and sizeable.

property Moveable : Boolean
if False, the Frame is not moveable (might be still sizable).

property RectStyle : TRectStyle
TRectStyle = (rsInnerFrame, rsOuterFrame);
rsInnerFrame : Boundaries Left,Top,Width,Height refer to the inner frame's values, i.e. without the border. Similar to clientwidth, clientheight.. With this style activated, the frame might leave the parent's clientarea up to its borderwidth.
rsOuterFrame : Boundaries as usual. The Frame is confined to the parent's clientarea.

property BorderWidth : Integer
For Limitations of the frame's border width, see property FrameStyle.

property ClientControl : TWinControl
assigns another Control as client to a frame. The frame automatically surrounds the client, adding new properties like moving and sizing the client at runtime. (At Designtime press ALT when you want to mouse-activate the client). Set BorderStyle to bsFixed and Moveable to False if the client is supposed to receive MouseMessages. Limited to Controls having a handle.


New with Version 1.1

BoundsRect : TRect
Define a bounding rectangle for the frame.

property LeftMouseDown : Bool
True, if the left mousebutton is down.


Public

Function GetBounds : TRect
if rsOuterFrame is set: returns the usual bounds of the frame.
if rsInnerFrame is set: returns the frame's inner area bounds.


property Buttons : TShiftState;
Returns the current Mouse Button states.

property Active : Bool
Sets this Frame active or inactive.

SetInnerBounds(x,y,w,h : Integer)
sets the inner area bounds of the Frame.

New with Version 1.1

procedure SetFloatBounds(ALeft, ATop, AWidth, AHeight: single);
procedure GetFloatBounds(var ALeft, ATop, AWidth, AHeight: single);

Set and get a floating point bounding rectangle.

 

TFrameList

Declared in the Frame unit is the global object 'mFrames' of type TFrameList which is automatically instantiated for all projects that include the Frame unit in their uses clause.
mFrame : TFrameList = class (TList);

The 'mFrames' object is used to organize the TFrames and offers following additional public properties and methods with respect to TList:

Function GetFrameByName(aName : string) : TFrame;
returns the frame having its name being equal to aName.

property ActiveFrame : TFrame
gives or sets the currently active frame.

© PeakStars 2000