| Class TAspect (unit Aspect) |
TComponent
| Constructors |
constructor Create (AOwner : TComponent);| Functions |
destructor Destroy;
procedure EstablishAspectRatio (Side : word; var Rect : TRect);
procedure Loaded;
procedure NewDefWndProc (var Msg : TMessage);the Side contains a value indicating what is to be adjusted actually uses the WMSZ_XXXX values which is the side being pulled or the corner being pulled (eight choices).
| Properties |
property Active : boolean
property AspectX : integer
property AspectY : integer
property Client : boolean| Events |
event OnBeforeResizing : TBeforeResizingEvent
event OnModifyClient : TModClientEvent| Variables |
FActive : boolean;
FAspectX : integer;
FAspectY : integer;
FClient : boolean;
FNewDefWndProc : pointer;
FOldDefWndProc : pointer;
FOnBeforeResizing : TBeforeResizingEvent;
FOnModifyClient : TModClientEvent;
FParent : THandle;| Constructors |
constructor Create (AOwner : TComponent);| Functions |
destructor Destroy;default conditions
procedure EstablishAspectRatio (Side : word; var Rect : TRect);Take a rect and force an aspect ratio on it, the pulled by value effects which side is adjusted to make the aspect ratio work. saXXXX constants are used.
procedure Loaded;chuck the object instance
procedure NewDefWndProc (var Msg : TMessage);are we controlling the client or whole ratio
the Side contains a value indicating what is to be adjusted actually uses the WMSZ_XXXX values which is the side being pulled or the corner being pulled (eight choices). So calculate Right, Top, Bottom or Left values. The combinations set here are based on what feels "right" for me, some experimentation for your feel may be necessary. If you change this behaviour, you may need to change the saXXXX constants as well.
| Properties |
property Active : booleanactivate the aspect ratio control
property AspectX : integerset the X part of the aspect ratio
property AspectY : integerset the Y part of the aspect ratio
property Client : booleandoes the ratio apply to the client area (T) or to the whole form area (F)?
| Events |
event OnBeforeResizing : TBeforeResizingEvent
event OnModifyClient : TModClientEvent| Variables |
FActive : boolean;it is the ratio that matters.
FAspectX : integer;
FAspectY : integer;X aspect and YAspect are relatively unimportant
FClient : boolean;is the component effect on or off
FNewDefWndProc : pointer;
FOldDefWndProc : pointer;these are used to subclass the form
FOnBeforeResizing : TBeforeResizingEvent;
FOnModifyClient : TModClientEvent;
FParent : THandle;