You are here: Development Standards > Upgrading OSAS > Converting to 6.xx Graphical > Graphical Control Standards

# Graphical Control Standards

In the charts below you’ll see the controls used in OSAS resource files and the standards for using and maintaining them:

Forms

Forms in a .BRC file must start with control ID 1 and increase by 1 for each form.

Property | Value
Title | <title of character screen>
Name | frm<screen description> (for example, frmCustomers)
X Position | 15
Y Position | 45
Width | 600
Height | 460*
Fore Color | <System Default>
Back Color | <System Default>
Default Font | MS Sans Serif, Regular, 8
Current Units | Pixels
Flags | Close Box, Enter as Tab, Invisible, Keyboard Navigation, Minimizable
Event Mask | Activate, Control focus, Key press, List click
Menu Status | <System Default>
Has status bar | Yes

*Height may be greater if necessary, but should be no more than 425 pixels in order to maintain 640x480 compatibility when the status bar and menu bar are added.

Status Bar

Status bars exist on most forms. Status bars are not generally used on forms that appear over another form, but work together with the other form to accomplish a specific task. However, if a form appears over another form, but is a separate process (such as F6 Maintenance forms, Shift+F2 Information forms, and so on), then it will have its own status bar.

When you add a form manually using ResBuilder, and you enter Yes in the Has Status Bar form property, the status bar is added to the form automatically.

Property | Value
Control ID | 100
Name | Status Bar
Text | <leave this field blank>
Font | MS Sans Serif, Regular, 8
Justification | <System Default>

Static Text Controls

Static text controls are used in two ways in OSAS. Field prompts are displayed in static text controls, as are field values that are display only (the value cannot be changed by the user).

Property | Value
Control ID | For field prompts, <1000, increasing by 10> For display-only fields - <2000, increasing by 10>*
Name | for field prompts - lbl<field name> (for example, lblCustID) for display-only fields - txt<field name> (for example, txtCustID)
Text | <same text as the character-mode prompts> (may also be populated through code)
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | 15
Fore Color | <System Default>
Back Color | <System Default>
Font | for field prompts - MS Sans Serif, Regular, 8 for display-only fields - MS Sans Serif, Regular, 8, Bold
Justification | <System Default>

*Standard OSAS screens have text and label fields numbered in increments of 10. This allows you room to add other controls between standard controls if necessary.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

INPUTE Controls

INPUTE controls are field entry controls. Use these controls wherever the user needs to enter alphanumeric data (with the exception of list fields and yes/no fields, which are handled with other controls).

Property | Value
Control ID | <4000, increasing by 10>*
Name | txt<field name> (for example, txtCustID>
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | 18
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked***
Client Edge | checked
Mask | see Using Masks later in this section
Max Length | <number of characters> (same as X4 in text mode)

*Standard OSAS screens have INPUTE controls numbered in increments of 10. This allows you room to add other controls between standard controls if necessary.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

***Refer to Disabling Fields later in this section.

INPUTN Controls

INPUTN controls are numeric entry controls. Use these controls wherever the user needs to enter numeric data (with the exception of fields that are used for selection a print/sort/pick type option, which are handled with other controls).

Property | Value
Control ID | <4000, increasing by 10>*
Name | txt<field name> (for example, txtSalesYTD)
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | 18
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked***
Client Edge | checked
Mask | see Using Masks later in this section

*Standard OSAS screens have INPUTN controls numbered in increments of 10. This allows you room to add other controls between standard controls if necessary.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

***Refer to Disabling Fields later in this section.

List Button Controls

List Button controls provide a list of choices from which a selection is required. Use these fields wherever the user needs to make a choice between two or more options (with the exception of Yes/No selections, which are handled by other controls).

Property | Value
Control ID | <4000, increasing by 10>*
Name | cbo<field name> (for example, cboCustType)
Initial Contents | <choice1>\n<choice2>\n<choice3>... (type \n between choices)
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | <depends on number of selections>***
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked****
Client Edge | checked
Set Height Mode | <System Default>

*Standard OSAS screens have list buttons numbered in increments of 10. This allows you room to add other controls between standard controls if necessary.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

***Make the height large enough to display all options when the list is displayed. If you make the control larger than necessary, the extra space will not be displayed. As a guide, a height of 40 will work for one option, 60 will work for two options, 80 will work for three options, and so on.

****Refer to Disabling Fields later in this section.

Check Box Controls

Check Box controls are used when the user must choose either Yes or No.

Property | Value
Control ID | <4000, increasing by 10>*
Name | chk<field name> (for example, chkGenlInfo)
Text | <same text as the character-mode prompt>
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | 15
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked***
Client Edge | unchecked
Justification | <System Default>
Text Left | checked

*Standard OSAS screens have check boxes numbered in increments of 10. This allows you room to add other controls between standard controls if necessary.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

***Refer to Disabling Fields later in this section.

Radio Button Controls

Radio Button controls are used to force a choice between several options. Use radio buttons wherever the user would enter a numeric value between 1 and n from a list of n choices (such as with sort options on report pick screens).

Property | Value
Control ID | <4000, increasing by 1>*
Name | rdo<field name> (for example, rdoSortBy)
Text | <same text as the character-based prompt> (Do not include the number in front of the option in the character screen.)
X Position | <position>**
Y Position | <position>**
Width | <field length>**
Height | 15
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | unchecked***
Client Edge | unchecked
In Group | checked
Justification | <System Default>
Button Group | <any unique value> (Buttons with the same button group number will act together; when one is checked, the other button(s) will uncheck.)

*Radio buttons must always be in increments of 1. The group box that should surround all radio groups are allocated in increments of 10, and the radio buttons increase from the group box number.

**To calculate X position, Y position, and width, refer to “Calculation of Field Sizes”.

***Refer to Disabling Fields later in this section.

Button Controls

Standard Button controls are used where command bar options exist on the equivalent character screen. These are normally found on HLE screens and on inquiry screens, where a list of commands appears at the bottom of the screen.

Property | Value
Control ID | <9000, increasing by 10>*
Name | btn<field name> (for example, btnFirst)
Text | <same text as the character-based command> (Use an ampersand [&] in front of the letter that activates the command.)
X Position | <position>**
Y Position | <position>**
Width | <button width>**
Height | 20
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked***
Client Edge | unchecked
Justification | <System Default>

*Standard OSAS screens have buttons numbered in increments of 10. This allows you room to add other button controls between standard controls if necessary.

**Buttons are usually positioned at the bottom of the screen, equally spaced, equally sized, and horizontally lined up with each other. If one button requires more space because of the text needed for its command, that button should be larger than the other buttons only if space prohibits equal sizing. In this case enlarge the affected button and leave the other buttons equally sized.

***Refer to Disabling Fields later in this section.

Group Boxes

Group Boxes are used for grouping radio buttons and command buttons. They are also used to divide a form into multiple sections, in the same manner as the text-based screens are divided by boxes.

Property | Value
Control ID | for radio groups, use <4000, increasing by 10>* for all other boxes, use <5000, increasing by 10>*
Name | grp<field description> (for example, grpSortBy)
Text | for radio groups, use text that describes the radio group for all other boxes, use no text
X Position | see Group Box Spacing below
Y Position | see Group Box Spacing below
Width | see Group Box Spacing below
Height | see Group Box Spacing below
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | unchecked
Client Edge | unchecked

*Group boxes around radio buttons must be in sequence with the other controls (in increments of 10). The buttons inside the group should then be incremented by 1 from the group box (for example, a Sort By group box with 4 selections may be numbered 4050 for the group box, and the radio buttons numbered 4051, 4052, 4053, and 4054).

Group Box Spacing

Group Boxes can be lined up and spaced out to any desired setting. However, OSAS standard screens are laid out following a set of rules. For radio groups, follow these standards:

1. If a box contains 2 radio buttons, set the height of the group box to 59; for each additional radio button, add 17 pixels to the height. For the width, use whatever looks appropriate. Try to center the radio buttons within the group box, based on the longest button text.
2. Use a Y position 17 pixels higher than the first radio button.

For command bar group boxes, follow these standards:

1. Set the height of the group box to 35, and the width of the group box to the exact width of the entire form.
2. Use a Y position 11 pixels higher than the top of the buttons.

For group boxes that are used to divide the screen, follow these standards:

1. If boxes must start on the left-most part of the screen, use x-position 0. If the boxes must end at the right-most part of the screen, be sure that the xposition plus the width is equal to the entire width of the form.
2. For boxes that need to start at the top of the form, don’t set the Y position lower than 27. This provides enough room for the tool bar on the form.
3. When adding multiple group boxes that are stacked vertically, set the yposition of the lower group box using this formula:
   y-position of the upper group box + height of the upper group box - 3
   This formula provides adequate vertical spacing between group boxes.
4. When adding multiple group boxes that are arranged horizontally, set the xposition of the right-most group box using this formula
   x-position of the right-most group box + width of the right-most group box + 1
   This formula provides adequate horizontal spacing between group boxes.

Tool Buttons for Scroll Regions

Tool buttons are used to control scrolling (HLE) regions within a graphical screen. Tool buttons include images that imply that the user can go to the top or bottom of a scroll region, or can scroll through pages and lines of entries.

The tool buttons are arranged in two groups of three in relation to the associatedgrid. The upper group consists of the buttons for Home, Page Up, and Up and in aligned with the top of the grid; while the lower group consists of the buttons for End, Page Down, and Down and is aligned with the bottom of the grid.

Property | Value
Control ID | <8001-6>
Name | 8001 - btnHome 8002 - btnPageUp 8003 - btnUp 8004 - btnDown 8005 - btnPageDown 8006 - End
Text | <none>
X Position | <next to, but not overlapping, the right edge of grid>
Y Position | <in groups of 3 near top and bottom of grid>
Width | 15
Height | 18
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked*
Client Edge | unchecked
Face Type | Bitmap
Bitmap File | 8001 - OSHLEHM.BMP 8002 - OSHLEPGU.BMP 8003 - OSHLEUP.BMP 8004 - OSHLEDN.BMP 8005 - OSHLEPGD.BMP 8006 - OSHLEEND.BMP

*Refer to Disabling Fields later in this section.

Tool buttons are also used on tool bars. Tool buttons for tool bars, however, are built by GENGUFNC.PUB and must never be built within a resource file.

Grids

Grids are used for scrolling text (HLE) regions. The user is allowed to scroll up and down through a grid to look at multiple pages of data.

Property | Value
Control ID | 7000 (if more than one grid exists on the screen, increment by 10)
Name | grd<grid name>
Text | <blank>
X Position | <position>*
Y Position | <position>*
Width | <width>*
Height | <height>*
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked**
Client Edge | checked
Face Type | Bitmap
Num rows | <total number of rows to be displayed at one time (LN[2])>
Row height | 17
Num columns | <total number of columns to be displayed in scroll region>
Column prop | <see Calculating Column Proportion below>
Col lines, Row lines | checked
Max cols | <same as value in Num columns>

*You must visually line up each grid according to where the scroll region exists on the character screen.

**Refer to Disabling Fields later in this section.

Calculating Grid Column Proportions

Once you add a grid to the screen, you must determine how many columns will appear in the grid. You can determine the number of columns by examining the character screen. Set the Num Columns property to this value.

Next, you must decide how wide to make each column. You can try to estimate how wide each column should be and then adjust from there. The total width of all columns must not exceed the value in the Width property for the grid control. You can also use this chart to approximate the width of each column:

No. of Characters | Multiplier | Extended
1 | 17 | 17
2 | 14 | 28
3 | 13 | 39
4 | 13 | 52
5 | 13 | 65
6 | 13 | 78
7 | 11 | 77
8 | 11 | 88
9 | 11 | 99
10 | 12 | 120
11 | 10 | 110
12 | 10 | 120
13 | 7.5 | 97.5
14+ | 7.5 |

For example, if a column is 15 characters wide, determine the width of the column by multiplying 15 by the multiplier of 7.5 to get 112.5 which, when rounded up, becomes 113.

Tool Buttons for F2 Inquiry

Tool buttons are placed to the right of certain INPUTE and INPUTN controls, and act as a shortcut to the F2 Inquiry window for the corresponding controls.

Property | Value
Control ID | <control ID of the input control + 10000> (for example, 14010).
Name | btnInq<input field name> (for example, btnInqCustID)
X Position | <x-position of input control + width of the input control -3>
Y Position | <same as y-position of INPUTE/INPUTN control>
Width | 16
Height | 18
Fore Color | <System Default>
Back Color | <System Default>
Font | MS Sans Serif, Regular, 8
Disabled | checked*
Client Edge | checked
Face Type | Bitmap
Bitmap File | OSINQURY.BMP

*Refer to Disabling Fields later in this section.

INPUTE/Grid Usage for Last Field

On each form that has any type of input, you must add a control with the ID 4999. This control must be either a grid or an INPUTE control. This control handles the final focus events when the user enters through an entire form.

For forms where a series of input fields are used, use an INPUTE control. For forms where you must prompt the user for single-key input (ex. setting X3=8 or X3=9), use a grid instead.

Property | Value
Control ID | 4999
Name | txtEndField or grdEndField
X Position | 0
Y Position | 0
Width | 0
Height | 0
Fore Color | <System Default>
Back Color | <System Default>
Font | <System Default>
Disabled | unchecked
Client Edge | unchecked
Max Length | 255 (for INPUTE controls only)
Num Rows | 1 (for Grid controls only)
Row Height | 20 (for Grid controls only)
Num Columns | 1 (for Grid controls only)
Max Columns | 1 (for Grid controls only)