Contents
AIMS Format

AIMS_Format is an Alpha Five addin for version 5 designed to be used by application developers for formatting multiple layout objects at one time. This is most useful for Form layouts but can also be used for Reports, Letters, and Labels.

Although A5's built-in formatting routines are quite good, there are a number of situations where developers would like to format groups of objects at one time but cannot do so due to the limitations of the built-in routines. The AIMS_Format addin significantly improves the developer's efficiency by increasing the ability to add multiple format styles to multiple field objects at one time.

Installing AIMS_Format

Using AIMS_Format

Why "AIMS" Format?

For additional technical support, check our website at www.aimsdc.net for current contact information.


What is AIMS_Format?

The AIMS_Format addin is an Alpha Five version 5 addin designed to be used by application developers for formatting multiple layout objects at one time. This is most useful for Form layouts but can also be used for Reports, Letters, and Labels.

Although A5's built-in formatting routines are quite good, there are a number of situations where developers would like to format groups of objects at one time but cannot due to the limitations of the built-in routines. The AIMS_Format addin significantly improves the developer's efficiency by increasing the ability to add multiple format styles to multiple field objects at one time.


Layout Objects

- "Layouts" is a general term for referring to Forms, Reports, Letters, Labels, and Browses.

- Layout objects are simply the objects that have been placed on the layout - such as fields, labels, text boxes, buttons, etc.


Installing AIMS_Format

Running the install routine will copy the AIMS_Format.aex file and this AIMS_Format.hlp file to your Alpha Five Addins_installed folder which is located directly under the folder where your Alpha Five executable files are located. Since the runtime cannot be used to design layouts, the installation file will only install to a full version of A5v5 which already exists on the computer.

To make the script usable, you must modify your System Toolbar named Form_Editor. To do that, follow these steps:
(Specific A5 items to click are highlighted.)

1.	Open Alpha Five to the Control Panel.

2.	Click the Code tab in the Control Panel. If the Code tab is not visible, right click on any tab that is visible and check the word "Code" at the bottom of the drop-down to make the Code tab visible.

3.	Now click Code in the menu bar at the top of the window. This is normally the third menu item from the left.

4.	Select Customize System Menus/Toolbars from the Code drop-down. Then select Customize System Toolbars from that drop-down list.

5.	In the Edit System Toolbars window that appears, click on the toolbar name Form_Editor to highlight it then click the Edit Toolbar button just to the right.

6.	The new button can be entered anywhere on the toolbar but most people will want to put it at the end of the current toolbar. To do this, scroll all the way down the list of existing toolbar buttons and click the last icon - typically the Control Panel icon. The new item will be added after whichever icon you highlight. (It can be moved later if you don't like the location.)

7.	Click the Add Custom Button button.

8.	For the button action, select Run XBasic and type in (or cut-and-paste from here):  script_play( "group_format" )

9.	The new action has been added. Save your changes and Close the toolbar window.

This action can be repeated for the Report_Editor, Letter_Editor, and Label_Editor toolbars if desired. (See the "Important Note" under Using AIMS_Format.)

There is also a video demo at http://www.aimsdc.net/Tips_Funcs/Purch_AIMS_Format.htm. Scroll down to the bottom of the page to start it.


Using AIMS_Format

The AIMS_Format routine is designed to allow you to change as many format settings as possible at one time. You may select multiple types of objects and multiple format settings at one time. The routine will automatically check to be sure the modified formats will only be applied where appropriate. In addition, the user can select which object type the settings will be applied to. This often makes the selection process much faster because it allows you to lasso multiple object types while only changing a specific type. For more details, click on Using specific features below.

Example #1  (2 different objects selected)

Example #2  (many object types selected)

Using specific features

AIMS_Format can be used with Forms, Reports, Letters, and Labels but will not work with Browses. (See warning below.)

WARNING:  Using AIMS_Format by itself does not always cause A5 to register the fact that something has been changed. This means that A5 will not prompt you to save the layout before closing it unless you have also changed something else. To be safe, always save the layout after running AIMS_Format.

IMPORTANT NOTE:  When used with Forms, AIMS_format is able to determine the current form. With all other layouts, the current layout cannot be determined so a list of currently open layouts will be displayed and you must select the name of the current layout. If you select the wrong layout, you will end up changing the format of any selected objects on the chosen layout rather than the one currently displayed. (Changes can only be made if the layout is in Design mode.)

Click here for a few other things you should know.


Other Things You Should Know

· You must select the objects to be modified before starting AIMS_Format.

· Start AIMS_Format by clicking the new icon you created on the toolbar.

· Since the AIMS_Format routine is designed to allow you to change as many things as possible at one time, no attempt is made to show current settings.

· Any format item that is left blank will have no effect on existing settings.

· Any format item that is not blank will result in that change being applied to any appropriate field that has been selected.

· If you attempt to change a setting for an object but that setting is not applicable to that object, no warning will be issued. Since the routine is designed to allow as many concurrent changes as possible, such warnings would be so common they would become objectionable.

· There are a few format options available in AIMS_Format that are non-standard formatting options. If you set one of these options then check the standard format box to see the result, you will probably see a blank in the box - this is normal since the selected format is not standard. One example is the date format 12.31.2002. Since these are not standard formats, we cannot be sure how they will work across various operating systems or with future A5 releases - use at your own risk.

· Although the AIMS_Format routine tries to cover the most common formatting issues, there are some which have not been included. If you feel that a significant formatting issue has been left out, please go to our website at www.aimsdc.net for up-to-date contact information and let us know about it.

· The routine can also be called directly from a script or the interactive editor by issuing the command script_play( "group_format" ) - I don't know why you would want to but you can.  This feature was added for convenience during development.


Example #1

(2 different objects selected)

If you selected one numeric field and one text object and one of the format options you set was "2 decimal places", this format would only be applied to the numeric field since the number of decimal places has no meaning for a text object. However, if you also selected Horizontal Alignment / Left, the alignment would be changed for both objects.


Example #2

(many object types selected)

Assume you are building an invoice form and are displaying the customer information but do not want the user to be able to change the customer information that's displayed - i.e., the customer fields should be read-only. The customer information is set in a frame for readability and you want to improve the appearance of the field labels. You also want to display the customer info in red if the due date is over 30 days old.

· After placing the objects on the form, 'lasso' all the objects including the fields, labels, and frame. (This is much faster than carefully selecting the individual objects.)

· Open AIMS_Format.

· Set Vertical Alignment to Middle.

· Set Read-Only to Yes.

· Enter a Color Equation such as: IF( cust->due_date < date()-30,"White on Red", "WinText on WinBack")

· Now set Font to Bold and Apply Font Changes to... Labels and Text.

· Click the Apply button and you've done the whole thing in one step!

· Now click the Clear button and set the Horizontal Alignment to Right and set the Apply to type to Text and Labels to set all the field labels at once to right justified without affecting any field justification.

· Click the Apply and Exit button and you're finished!

Note that Read-Only and Color Equations only apply to Field objects; we applied the Font to only the "Labels and Text"; Vertical Alignment was applied to both the Field objects and the Text objects (labels); and nothing affected the Frame.


Using Specific Features

"Apply" button

Cancel

"Apply Font Changes to..." Button

Misc/Align/Borders/Shadows - Apply to


Cancel

The 'Cancel' button will close the Format window without making any changes regardless of current settings.


"Apply Font Changes to..." Button

This button determines which of the selected objects will be affected by the font changes.

Font changes include all items on the Font tab - Face, Size, and the 5 items listed in the Attributes frame.

An example for using this option is to select both the Field objects and their Labels on a form, or an area of the form, then set the Apply Font Changes to... option to Labels and Text and set the font to Arial, 10, Bold and Apply the settings. Then change Apply Font Changes to... to Fields and set the font to Arial, 10 but set Bold to 'No'.


Misc/Align/Borders/Shadows - Apply to

As of version 1.09, the settings on the first two tabs, Misc/Align/Borders/Shadows, can be applied to all items selected or to any one of the following:  Fields, Text and Labels, Buttons, Browses, Tabbed Objects.

Combined with the Apply button, this gives the user the ability to select all objects on a form and change them one group at a time. For example, after selecting all objects, the text objects (typically field labels) could be set to Bold, Right Justified, and Vertically Centered while the field objects could be set to Not Bold, Left Justified, 2 decimals, Date format mm/yy, and a Color Equation could be applied.


Why "AIMS" Format?

The main purpose of adding "AIMS" to the routine name is to distinguish our routines from any routines that may be developed by Alpha in the future. AIMS DataCom is our company name so this was a convenient choice.

We are now much more aware of this issue since many of the applications developed by AIMS DataCom had to be changed when converted to Alpha Five version 5 because some of our UDFs (User Defined Functions) had the same name as the new functions now built-in to Alpha Five.


Technical Support

Check our website at  www.aimsdc.net  for current contact information.


Apply Button
"Apply" Button

An "Apply" button allows you to apply the current settings then make modifications before closing the Format window. This feature is useful for (a) checking your results then correcting them if necessary and (b) applying one group of settings to Fields (e.g., Arial, Not Bold, Left Justified) and another to Text objects (e.g., Arial bold, Right Justified, Vertically Centered).