Copyright: © 1999-2001, UtilMind Solutions®


 TFormMagnet component - Overview

Properties     Methods     Events

Overview

The FormMagnet allows to magnetize your forms to an edges of screen / work area, borders of parent window and to other forms. Forms can glue each others, so when user moves the form, others, attached forms will be moved too. With acFormMagnet, your forms can looks and feels like windows of famous WinAmp player.

With FormMagnet forms obtains following abilities:

  1.	to be attracted to edges of screen or work area (considering placement of task / appbars)

  2.	to be attracted to borders of parent form (for child windows).

  3.	to attract other forms (with FormMagnet on them) to itself.

  4.	to glue other forms to itself (when user move form, others, "glued" forms will be moved too)

  5.	to move forms, dragging by client area.

Key properties

 Active	activity flag. Means that this window can be magnetized to other forms and to screen edges;

 FormDragable	allows to move forms, dragging by client area;

 Glue	enables or disables gluing feature. When Glue is True and user moves the form, others, attached forms will be moved too;

 MagnetType	type of magnetization;

 Power	maximum range (in screen pixels) to other object that attract the form;

 ScreenMagnet	list of properties that allow your form to be magnetized to the screen edges.

 events

 OnDragMove	occurs when form changes the screen position;

 OnGlue	occurs when form is about to be glued to other magnet;

 OnMagnet	occurs when form is about to be magnetized to other magnet.

How to use ?

Just drop component onto your form, compile the program and try to move form near the screen edges. See description of properties for customization.


 Installation Instructions

Package without source code

to Delphi 2

 1. Unzip files from "Delphi2" directory to your "Delphi 2\Lib" directory.

 2. Start Delphi 2 IDE.

 3. Select "Component \ Install..." menu item.

 4. Press "Add" button and select "FormMagnet.dcu" file.

 5. Rebuild library.

to Delphi 3

 1. Unzip files from "Delphi3" directory and copy them to "Delphi 3\Lib".

 2. Start Delphi 3 IDE.

 3. Open "FormMagnetD3.dpk" file.

 4. Install package to the components palette ("Install" button).

to Delphi 4

 1. Unzip files from "Delphi4" directory and copy them to "Delphi 4\Lib".

 2. Start Delphi 4 IDE.

 3. Open "FormMagnetD4.dpk" file.

 4. Install package to the components palette ("Install" button).

to Delphi 5

 1. Unzip files from "Delphi5" directory and copy them to "Delphi 5\Lib".

 2. Start Delphi 5 IDE.

 3. Open "FormMagnetD5.dpk" file.

 4. Install package to the components palette ("Install" button).

to Delphi 6

 1. Unzip files from "Delphi6" directory and copy them to "Delphi 6\Lib".

 2. Start Delphi 6 IDE.

 3. Open "FormMagnetD6.dpk" file.

 4. Install package to the components palette ("Install" button).

to Delphi 7

 1. Unzip files from "Delphi7" directory and copy them to "Delphi 7\Lib".

 2. Start Delphi 7 IDE.

 3. Open "FormMagnetD7.dpk" file.

 4. Install package to the components palette ("Install" button).

to C++ Builder 1

 1. Unzip files from "BCB1" directory to your "CBuilder\Lib" directory.

 2. Start C++ Builder IDE.

 3. Select "Component \ Install..." menu item.

 4. Press "Add" button and select "FormMagnet.dcu" file.

 5. Rebuild library.

to C++ Builder 3

 1. Unzip files from "BCB3" directory and copy them to "CBuilder3\Lib".

 2. Start C++ Builder 3 IDE.

 3. Open "FormMagnetCB3.bpk" file.

 6. Select "Project \ Make FormMagnetCB3" menu item.

 7. Select "Component \ InstallPackages" menu item.

 8. Press "Add" button and select "FormMagnetCB3.bpl" file.

to C++ Builder 4

 1. Unzip files from "BCB4" directory and copy them to "CBuilder4\Lib".

 2. Start C++ Builder 4 IDE.

 3. Open "FormMagnetCB4.bpk" file.

 4. Install package to the components palette ("Install" button).

to C++ Builder 5

 1. Unzip files from "BCB5" directory and copy them to "CBuilder5\Lib".

 2. Start C++ Builder 5 IDE.

 3. Open "FormMagnetCB5.bpk" file.

 4. Install package to the components palette ("Install" button).

to C++ Builder 6

 1. Unzip files from "BCB6" directory and copy them to "CBuilder6\Lib".

 2. Start C++ Builder 6 IDE.

 3. Open "FormMagnetCB6.bpk" file.

 4. Install package to the components palette ("Install" button).

Source code

  1. Uninstall / delete all previous (trial) instances of FormMagnet.

  2. Unzip files from "Sources" directory and copy them to "..\Lib" directory.

  3. Run Delphi or ++ Builder IDE.

  4. Select "Component \ Install..." menu item.

  5. Press "Add" button and select "FormMagnet.pas" file.

  6. Rebuild library.


 Registration Information

FormMagnet component is SHAREWARE. This means that you can try it out for free, but if you like it and want to use it you have to register it with the author. Before continue read and accept license agreement please.

The only difference between the unregistered and registered versions is that the registered one has not message box with remind to register and works without Delphi (C++ Builder) running. You can also purchase the source code, if you would like to have it, and be able to compile or modify the FormMagnet on any 32bit version of Delphi or C++ Builder.

If you would like to use the FormMagnet and receive full, unrestricted version, priority support or even source code — you have to purchase proper license.

All prices in US dollars. Registering entitles you to unlimited support via E-Mail, minor version updates indefinitely and major version updates for 6 month from date of purchase.

Registration types:

Full, unrestricted version without source code:

Single user license:

•	https://secure.element5.com/register.html?productid=140836 - $19,95

Site license:

•	https://secure.element5.com/register.html?productid=140837 - $99,95

Full version including 100% Source Code:

Single user license:

•	https://secure.element5.com/register.html?productid=140838 - $29,95

Site license:

•	https://secure.element5.com/register.html?productid=140839 - $149,95

Comments

1. Site license covers a single organisation in one location (building complex). If you buy a site license, you may use the software in unlimited number of your company's computers withing this area. Site license is very cost-effective if you have many computers (many software developers).

See license agreement for more details.


 License Agreement

Copyright

The FormMagnet component (software) is Copyright © 1998-2001, by Utilmind Solutions® (Utilmind). All rights reserved.

The authors - Utilmind Solutions® and Aleksey Kuznetsov (founder of Utilmind), exclusively own all copyrights to the Advanced Application Controls (AppControls) and all other products distributed by Utilmind Solutions®.

Liability disclaimer

THIS SOFTWARE IS DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. YOU USE IT AT YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.

Restrictions

You may not attempt to reverse compile, modify, translate or disassemble the software in whole or in part. You may not remove or modify any copyright notice or the method by which it may be invoked.

Operating license

Unregistered version

You may distribute the unregistered version of software freely, provided that all files are included and remain unmodified and that no extra files have been added to the package. You may not ask any money for the distribution. You may use the unregistered version of software free of charge for testing purposes, but if you want to use it for other purposes than testing - you have to register it with the author.

Registered version (single user license)

Once you have registered, you will receive a personal registered copy via email and login information to access your personal area at AppControls.com. This copy may not be copied or lend. You have the non-exclusive right to use registered version of the software only by a single person, on a single computer at a time. You may physically transfer the software from one computer to another, provided that the software is used only by a single person, on a single computer at a time. In group projects where multiple persons will use the software, you must purchase an individual license for each member of the group or purchase site license. Use over a "local area network" (within the same locale) is permitted provided that the software is used only by a single person, on a single computer at a time. Use over a "wide area network" (outside the same locale) is strictly prohibited under any and all circumstances.

Registered version (site/team license)

Once you have registered, you will receive a personal registered copy via email and login information to access your personal area at AppControls.com. This copy may not be copied or lend. You have the non-exclusive right to use and transfer registered version of software on any number of computers by your company or your team only in one location (building complex). If you purchase a site license, you may use the program in an unlimited number of your company's computers within this area.

Registered version (Educational site license)

Once you have registered, you will receive a personal registered copy via email and login information to access your personal area at AppControls.com. This copy may not be copied or lend. You have the non-exclusive right to use and transfer registered version of software on any number of computers by your educational organisation (school/college/university etc) in one location (building complex). If you buy a educational site license, you may use the program in an unlimited number of your edicational organisation's computers within this area.

Registered version (World-wide license)

Once you have registered, you will receive a personal registered copy via email and login information to access your personal area at AppControls.com. This copy may not be copied or lend. You have the non-exclusive right to use and transfer registered version of software on any number of computers by your company or your team world-wide. If your company has many branches even with thouthands of computers, world wide license covers them all.

Notes (clarification)

"Single-user license" means "single-developer license". "Site license" means that it can be used by any number of software developers within your company.

You can use purchased components in ANY number of your projects and deploy the "end-user" software to ANY number of your users/customers without any additional royalty fees. However you are not permitted to distribute the component itself (the source code or .dcu files of components).

Back-up and transfer

You may make one copy of the software solely for "back-up" purposes, as prescribed by international copyright laws. You must reproduce and include the copyright notice on the back-up copy.

Terms

This license is effective until terminated. You may terminate it by destroying the program, the documentation and copies thereof. This license will also terminate if you fail to comply with any terms or conditions of this agreement. You agree upon such termination to destroy all copies of the program and of the documentation, or return them to author.

Other rights and restrictions

All other rights and restrictions not specifically granted in this license are reserved by authors.


Active
 Active property

Applies to

FormMagnet component.

Declaration

property Active: Boolean;

Description

The Active property controls whether the FormMagnet component and magneting and gluing features is currently active. If Active is True, the FormMagnet will be able to magnetize your form to other windows (with acFormMagnet component on them) and to the edges of screen / workarea.

See also

Glue, Power and ScreenMagnet properties.


FormDragable
 FormDragable property

Applies to

FormMagnet component.

Declaration

property FormDragable: Boolean;

Description

The FormDragable property controls whether your form can be moved on screen by client area. If FormDragable is True, user will be able to move the form dragging it by client area.


Glue
 Glue property

Applies to

FormMagnet component.

Declaration

property Glue: Boolean;

Description

The Glue property controls whether the current form is able to glue other forms to itself. If Glue is True, other forms will be glued to current form and when user moves the current form, others, attached forms will be moved too.

See also

Active property.


MagnetType
 MagnetType property

Applies to

FormMagnet component.

Declaration

type

  TMagnetType = (mkOnMoving, mkAfterMoving);

property MagnetType: TMagnetType;

Description

The MagnetType property controls how the FormMagnet component will magnetize current form to other forms and screen sides.

If MagnetType is mkOnMoving, the form will be attracted to others, every time when user moving the form on the screen (during the moving process).

If Magnet is mkAfterMoving, the form can be moved freely by whole screen and will be pulled to other forms once user releases the mouse button (after the moving process).


Power
 Power property

Applies to

FormMagnet component.

Declaration

property Power: Byte; // in screen pixels

Description

The Power property controls the maximum range (in screen pixels), where the form can be attracted to other object.

For example, if Power is 32, and move the form near other form with FormMagnet, approaching the form on distance of 32 screen pixels, forms will be magnetized each others.

See also

DesktopPower property.


ScreenMagnet
 ScreenMagnet property list

Sub properties

Applies to

FormMagnet component.

Declaration

type

  TacScreenMagnet = class(TPersistent)

  published

    property Area: TScreenArea;

    property DesktopPower: Byte;

    property Top: Boolean;

    property Bottom: Boolean;

    property Left: Boolean;

    property Right: Boolean;

  end;

Description

The ScreenMagnet is the list of properties that allow the forms to be magnetized to the edges of screen / work area.


Area
 Area property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

type

  TacScreenArea = (saFullScreen, saWorkArea);

property Area: TScreenArea;

Description

The Area property specifies the desktop area which can magnetize the form. If Area is saFullScreen, form can be attracted to the edge of whole screen. If Area is saWorkArea, form can be attracted only to edges of working area, considering the placements of taskbar and other application desktop toolbars (appbars).


Bottom
 Bottom property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

property Bottom: Boolean;

Description

The Bottom property controls whether the form is able to be attracted to the bottom edge of screen or work area. If Bottom is True, form can be magnetized to the bottom side of area specified in Area property.

See also

Left, Top, Bottom, Right and Area properties.


DesktopPower
 DesktopPower property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

property DesktopPower: Byte;

Description

The DesktopPower property controls the maximum range (in screen pixels), where the form can be attracted to the edge of screen / work area or border of parent form (for MDI childs).

For example, if DesktopPower is 32, and move the form near the edge of screen / work area, approaching the form on distance of 32 screen pixels, form will be magnetized to edge of screen / work area.

See also

Power and Area properties.


Left
 Left property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

property Left: Boolean;

Description

The Left property controls whether the form is able to be attracted to the left edge of screen or work area. If Left is True, form can be magnetized to the left side of area specified in Area property.

See also

Left, Top, Bottom, Right and Area properties.


Right
 Right property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

property Right: Boolean;

Description

The Right property controls whether the form is able to be attracted to the right edge of screen or work area. If Right is True, form can be magnetized to the right side of area specified in Area property.

See also

Left, Top, Bottom, Right and Area properties.


Top
 Top property

Applies to

FormMagnet component as subproperty of ScreenMagnet.

Declaration

property Top: Boolean;

Description

The Top property controls whether the form is able to be attracted to the top edge of screen or work area. If Top is True, form can be magnetized to the top side of area specified in Area property.

See also

Left, Top, Bottom, Right and Area properties.


DoMagnet
 DoMagnet method

Applies to

FormMagnet component.

Declaration

procedure DoMagnet;

Description

Call DoMagnet method to pull the current form to other forms (with FormMagnet component on them), or to the edges of screen / work area, or borders of parent form (for MDI childs).


OnDragMove
 OnDragMove event

Applies to

FormMagnet component.

Declaration

property OnDragMove: TNotifyEvent;

Description

The OnDragMove event occurs when the form changes the screen position.


OnGlue
 OnGlue event

Applies to

FormMagnet component.

Declaration

type

  TOnGlue = procedure(Sender: TObject; AnotherForm: TForm;

              var AllowGlue: Boolean) of object;

property OnGlue: TOnGlue;

Description

The OnGlue event occurs when the form is about to be glued to other form. You may allow or disallow the gluing, using AllowGlue variable.

See also

OnMagnet event.


OnMagnet
 OnMagnet event

Applies to

FormMagnet component.

Declaration

type

  TOnMagnet = procedure(Sender: TObject; AnotherForm: TForm;

                var AllowMagnet: Boolean) of object;

property OnMagnet: TOnMagnet;

Description

The OnMagnet event occurs when the form is about to be attracted to other form. You may allow or disallow magnetization, using AllowMagnet variable.

See also

OnGlue event.


Properties

Active	MagnetType

FormDragable	Power

Glue	ScreenMagnet


Methods

DoMagnet


Events

OnDragMove	OnMagnet

OnGlue


Properties

Area	Left

Bottom	Right

DesktopPower	Top


Declaration

type

  TMagnetType = (mkOnMoving, mkAfterMoving);

Values

mkOnMoving	form will be pulled to others during the moving process.

mkAfterMoving	form will be pulled to others after moving process.


type

  TacScreenArea = (saFullScreen, saWorkArea);


type

  TOnMagnet = procedure(Sender: TObject;

                        AnotherForm: TForm;

                        var AllowMagnet: Boolean) of object;


type

  TOnGlue = procedure(Sender: TObject;

                      AnotherForm: TForm;

                      var AllowGlue: Boolean) of object;