


Most controls, including entry fields, base their width on the width of the "0" (zero) character in the control's font. This usually works well because in most fonts, the "0" character is slightly wider than the average character. This means that the field is optimally sized for numeric data, and nearly optimally sized for alphanumeric data (actually it is slightly oversized, which is preferable because the user can enter data that is wider than average). In cases where the user enters very wide data, the entry field will scroll horizontally to fit all the data.
However, there are a few cases where this rule does not produce the best results. To handle these cases, several special sizing rules apply to entry fields.
The most pronounced problem arises when the input includes a lot of upper-case data. Upper-case characters are quite a lot wider than the average character ("0"), so when there are many upper-case characters they often do not fit in the space allotted by the normal rule. Therefore, additional rules handle two cases: (a) upper-case-only fields, and (b) small fields. Small fields require special handling because they tend to be coded fields (which are usually shown in upper-case). Also, scrolling in small fields feels odd to most users while scrolling in large fields is familiar.
To do a better job with these cases, the runtime employs a second font measurement. The second measure averages the width of the "0" (zero) character with the width of the maximum-width character in the font. This value is approximately the size of the average upper-case character in most fonts. We call this measurement the wide font measure. The size of the "0" character is known as the standard font measure.
When the runtime constructs an entry field, the first applicable rule from the list below is used to determine the entry field's physical size. Overhead for the entry field's box, if present, is added to this width.
1. An entry field is never allowed to be smaller than the size of the maximum width character. This ensures that at least one character of data is visible in the field.
2. If the field has the NUMERIC style, then its SIZE is multiplied by the standard font measure (i.e., numeric fields are normal).
3. If the field has the UPPER style, and the configuration variable EF-UPPER-WIDE is non-zero, then its SIZE is multiplied by the wide font measure (i.e., upper-case fields are wide).
4. If the field's SIZE is less than or equal to the value of the configuration variable EF-WIDE-SIZE, then its SIZE is multiplied by the wide font measure (i.e., small fields are wide).
5. Otherwise, its SIZE is multiplied by the standard font measure (i.e., everything else is normal).
The default setting of EF-UPPER-WIDE is "1" ("on"). The default setting of EF-WIDE-SIZE is "5".