Migration Guide : E. Features Introduced in OpenROAD 6.2 : Changes to Existing Features : Character Width Settings for EntryFields Now Definable
 
Share this page          
Character Width Settings for EntryFields Now Definable
In previous versions of OpenROAD, the setting of the EntryField class's UseWidestCharacter attribute was derived from a call to the underlying window manager, GetTextMetrics. For some typeface settings, such as TF_SYSTEM or TF_COURIER, this logic produced satisfactory results, preventing characters from being clipped in field displays. For other typeface settings mapped to TrueType fonts, GetTextMetrics produced unusable results. In addition, once the width was set for any combination of TF_* typeface, font name, and font size, it could not be changed. This created problems in very narrow EntryField displays, particularly in TableFields and constructs such as calendars.
This version of OpenROAD makes TrueType widest character settings usable in common situations. It also lets you define exact widest character settings so that you can tune your EntryField text displays in different circumstances. These changes are compatible with existing applications and Unicode-enabled applications.
New EntryField.WidestCharacterWidth Attribute
The EntryField class also has a new attribute, WidestCharacterWidth (integer, RW). This attribute specifies the exact width in pixels of each text character when UseWidestCharacter is set to UWC_USER.
For more information, see the EntryField Class in the Language Reference Guide.
New System Constants for EntryField.UseWidestCharacter Attribute
The UseWidestCharacter attribute can now be set to the following system constants:
UWC_NONE
(Default) Specifies that a maximum character width is not used to calculate the field width. This setting corresponds to previous versions' FALSE setting.
UWC_NATIVE
Specifies that a maximum character width based on the specified font is used to calculate the field width. This setting corresponds to previous versions' TRUE setting.
UWC_SYSTEM
Specifies that a maximum character width based on the TF_SYSTEM font is used to calculate the field width.
UWC_USER
Specifies that a maximum character width defined by the developer in the WidestCharacterWidth property is used to calculate the field width.
For more information, see in the Language Reference Guide the EntryField Class and UseWidestCharacter Settings.