Copyright: CopyRight (C) 1996, ACSD


Frmpos Unit

The following items are declared in the Frmpos unit:

Components

TFormPosition


TFormPosition Component
TFormPosition Component - UnRegistered Shareware Version

Properties	Methods	Tasks

Unit

Frmpos

Description

The Tformposition component saves the position and size of any form containing this component.

The information is stored in an Ini file specified with the Inifile property. Use the section property to specify which section the forms position and size should be stored.

If the file does not exist then a new file will be created as specified in the filename property.

The forms position property must be set to either Podesigned or PoDefault.


Using the TFormPosition Component

Purpose

Use the formposition component to have your application automatically save the position and size of the form. Each time the application runs the form will be displayed in the position and size changed by the user.

Tasks

To save the forms position set the saveposition property to true ( the default)

To use a file or create a file to hold the form's position data in the directory where the application was executed set the useexedir property to true.

To load a form in it's designed position from within an application set the saveposition to false before displaying the form.


Properties

DesignMode	Name	UseExeDir

FileName	SavePosition	IniSection

Tag


DesignMode Property

Applies To

TFormPosition

Declaration

Property DesignMode : Boolean;

Description

The designmode property when set to true will load the saved positioning and size of the form from the file while editing the form.

If the project is saved this will be the forms new position.  Once it is turned on the only way to undo the new positioning is to close the project without saving.

This property should only be set at design time changing the property at runtime has no affect.


FileName Property

Example

Applies To

TFormPosition

Declaration

Property FileName : string;

Description

The filename property specifies the name of the file to store your application's forms position and size.  If the file does not exist then a file will be created.

Even though the file is of type INI you can use any extension.  You may also provide a path in front of the filename. If no path is specified then the file will be created in the windows sub-directory by default.

If the UseExeDir property is set to true then the file will be created in the directory where the application was executed from.  This will occur even if you specified a path in the filename property.


FileName Example

The following example will save the forms positions in Form.Dat within the subdirectory C:\QuickApp.

procedure TForm1.Button1Click(Sender: TObject);
Begin

   FormPosition1.FileName := 'C:\QuickApp\Form.Dat';

end;


IniSection Property

Example

Applies To

TFormPosition

Declaration

Property IniSection : String;

Description

The IniSection specifies which section of the inifile to store the forms positions.

You can use any valid section name you want. Each form could be placed in different sections or the same sections.


IniSection Example

The following example places the forms positions in the "Saved QuickApp Forms" section.

procedure TForm1.Button1Click(Sender: TObject);
Begin

    FormPosition1.IniSect := 'Saved QuickApp Forms';

end;


Name Property

Applies To

TFormPosition

Declaration

Property Name;

Description

The name of the component added to your application. You can change this to a name more suitable to your application.


SavePosition Property

Example

Applies To

TFormPosition

Declaration

Property SavePosition : boolean;

Description

The saveposition property allows you to turn on and off the forms position and size saving mechinism.

This allows you to add the component to a form and then have a setup option that activates and deactivates the application remembering the positions and sizes of the forms.

If you turn off the saveposition property and then display the form the form will be displayed in the position it was designed.


SavePosition Example

The following example shows a button being pressed to turn on and off saving the forms position.

procedure TForm1.Button1Click(Sender: TObject);
Begin

    IF FormPosition1.SavePosition then
       FormPosition1.SavePosition := False
    else
       FormPosition1.SavePosition := True;

end;


Tag Property

Applies To

TFormPosition

Declaration

Property Tag : Integer

Description

The tag property is available to store an integer as part of a compent. You can use this property to store a value for your application.


UseExeDir Property

Example

Applies To

TFormPosition

Declaration

Property UseExeDir : Boolean;

Description

The useexedir property tells the component to use the directory where the application was executed to save the forms positions.

If this is set to true and a path was specified with the filename in the filename property the component will ignore the path and create the file  the directory where the application was executed.

This is useful if you want to keep all data files in the same sub-directory as the executable.


UseExeDir Example

The following example sets the UseExeDir to True.  It will ignore the path
specified in the filename property.

procedure TForm1.Button1Click(Sender: TObject);
Begin

     FormPosition1.FileName := 'C:\Temp\Form.Dat';

     FormPosition1.UseExeDir := True;

      The application is executed from the Quickapp
       subdirectory ... Form.Dat is now created in
       the QuickApp Subdirectory

end;


Methods

SaveFormPosition


SaveFormPosition Method

Applies To

TFormPosition

Declaration

Procedure SaveFormPosition;

Description

The SaveFormPosition method allows your program to force a save of the forms position without the form being moved.


Registration

By Mail	Credit Card	Compuserve

Registration is $15.00.  PA Residents add 6% sales tax

Registration Benefits

Registered Users get both the 16 bit and 32 bit source to the formposition component
Support via compuserve and the Internet
Bug fixes for current registered version
Information on new components or software.
New Help and KWF files without registration information

Questions & Comments

Any questions, comments, or suggestions concerning this product are welcome. I can be reached via the following methods:

Compuserve :  70254,637

       Internet :  70254.637@CIS.COM

 Postal Mail :   Paul Shay
                      799 Butler Road
                      Kittanning, PA 16201


Registration By Mail
To Register By Mail

Select "Print Topic" from the "File" menu to print this form.

TFormPosition  16 Bit and 32 Bit Components

$15.00  Shipping & Handling   ( US Funds Only )

PA - residents add 6% sales tax.

Please register my copy of TformPosition - ,
I am sending a check or money order for $___________,
( Check orders allow 2-4 weeks for Delivery )

Name:________________________________________________

Company:_____________________________________________

Address1:____________________________________________

Address2:____________________________________________

City:________________________________________________

State:_______________________________________________

Zip:_________________________________________________

Country:_____________________________________________

Phone:_______________________________________optional
Diskette Size:  ____ 3.5 inch ____ 5.25 inch

Send completed form with payment to:

Paul Shay
ACSD
799 Butler Road
Kittanning, PA  16201


Registration By Credit Card
To Register With Credit Card

For technical support or comments about this program, please contact me at:  Email at 70254.637@CIS.COM  or by letter at Paul Shay 799 butler Road Kittanning, PA  16201.  Please Note NorthStar Solutions can/does not provide any technical support or comments about this program.

For your convenience we have contracted NorthStar Solutions to process any orders that you wish to place with your valid Visa or MasterCard. They may be contacted for orders only via any of the following methods:

Voice: 1-800-699-6395 (10:00am - 10:00pm, Eastern Standard Time. Calls from the U.S. Only)
          1-803-699-6395 (10:00am - 10:00pm, Eastern Standard Time.)

Fax:   1-803-699-5465 (Available 24 Hours. International and business orders encouraged.)

E-MAIL: America Online: STARMAIL    Compuserve: 71561,2751     Internet: STARMAIL@AOL.COM

Regardless of how you register, please have the following information ready:

The program (TFORMPOSITION) and version number (1.0) you are registering.  Where the latest version should be mailed (e-mail will be used if provided). Your Visa or MasterCard # and its expiration date. Your drive types, 5.25 inch or 3.5 inch.  Your E-Mail address (so an E-Mail confirming your order can be sent and I (Paul Shay) can contact you easily with some important follow-up information).


Registration Via Compuserve
To Register Via Compuserve

If you have a Compuserve account, this is the fastest way to register

TformPosition 16 & 32 Bit Components / Version 1.0

GO SWREG and select #12648, the registration fee of $15.00 - will be billed to your Compuserve account.