4. Upgrading from OpenROAD 4.0 or 4.1 : Phase 2: Convert the Applications : Known 4.1 Issues to Resolve : Incorrect Field Colors
 
Share this page                  
Incorrect Field Colors
If you are using a site-specific color definition file for OpenROAD, this issue may not affect your applications.
This issue typically manifests itself as display areas showing the “wrong gray” when the developer starts adjusting field positions, margins, and transparency.
ISSUE: OpenROAD changed the color definitions it used between OpenROAD 3.5 and OpenROAD 4.0. These definitions have not changed since. For systems already on OpenROAD 4.x, visible color issues will have been resolved already. However, a potential problem remains with the varieties of gray.
In applications developed initially in OpenROAD 3.x, CC_PALE_GRAY and CC_LIGHT_GRAY were identical, and many fields were set to one or the other indiscriminately. When those applications were upgraded to OpenROAD 4.x, fields not visible to the developer—generally composite fields—were not always corrected.
The definition of CC_SYS_BTNFACE also changed over time: on Windows NT 4 the buttonface color was defined as rgb(192,192,192). It is now rgb(212,208,200).
In the upgrade to the current version of OpenROAD, fields that have these color problems may not be visible initially. They may become evident only when changing to a background of FP_CLEAR or when changes are made to composite field margins.
Note:  Any references to CC_LIGHT_GRAY (or CC_SYS_BTNFACE) in the original 3.5 code logic that might be broken by making the following change should have been found and resolved during the previous upgrade to 4.x. If you suspect that it has not been fixed, do not make the following change.
RESOLUTION: You can standardize color attributes using the PropertyChanger tool. The following procedure assumes that you have already loaded the PropertyChanger tool into your OpenROAD project (see "To use the PropertyChanger tool on your applications" in Incorrect FP_CLEAR Field Setting). For more information, see Upgrading Applications with the PropertyChanger Utility.
Note:  Before updating any of your applications, we recommend that you back them up by either exporting the affected applications or taking a checkpoint of the OpenROAD 5.1 code repository database.
To change field colors using the PropertyChanger
1. In the application, examine the PropertyChanger component behavior defined for CC_LIGHT_GRAY, CC_PALE_GRAY, and CC_SYS_BTNFACE, and confirm that it takes the action you require. The following is the default code provided to make this change:
/*
** Change all fields that have CC_LIGHT_GRAY to
** CC_PALE_GRAY.
** (but ensure tablefield reset does not override its
** columns, tablebody, tableheader)
**
** Change all fields that have
** CC_SYS_BTNFACE to CC_PALE_GRAY.
** (disabled – only enable if the platform you are currently
** deployed on uses rgb(192,192,192) and you want to preserve
** that shade of gray)
*/
IF fieldToChange.BgColor != CC_LIGHT_GRAY
/* AND fieldToChange.BgColor != CC_SYS_BTNFACE */
THEN
/* do nothing */;
ELSEIF fieldToChange.IsA(TableField) != TRUE THEN
fieldToChange.BgColor = CC_PALE_GRAY;
 
ELSE
tbl = fieldToChange;
copiedTbl = tbl.Duplicate();
 
tbl.BgColor = CC_PALE_GRAY;
 
tbl.TableBody.BgColor = copiedTbl.TableBody.BgColor;
IF tbl.TableHeader IS NOT NULL THEN
tbl.TableHeader.BgColor = copiedTbl.TableHeader.BgColor;
ENDIF;
FOR i = 1 TO tbl.TableBody.ChildFields.LastRow DO
col = tbl.TableBody.ChildFields[i];
copiedCol = copiedTbl.TableBody.ChildFields[i];
col.BgColor = copiedCol.BgColor;
IF col.TitleTrim IS NOT NULL THEN
col.TitleTrim.BgColor = copiedCol.TitleTrim.BgColor;
ENDIF;
ENDFOR;
 
ENDIF;
Modify this code as necessary to meet your requirements.
2. Run the following command from a command window:
w4gldev rundbapp yourdatabasename propertychanger
An Upgrade Assistant is displayed.
3. Using the assistant, do the following:
a. Select which applications you are correcting.
b. Specify that you want to change fields only.
c. Specify that you want to correct Gray Color Settings.
d. Specify the suffix to use if you want the assistant to make backup copies of your existing applications. Leave this blank if you do not want backup copies to be made (for example, if you have backed up your applications elsewhere).
e. Click Upgrade to make the changes.
Note:  You may want to save the PropertyChanger output to help with later acceptance testing (see Phase 3: Conduct Acceptance Testing).
4. Compile and run the applications to confirm that the color problems have been corrected and these changes have caused no new issues.
If you created backup copies using the Upgrade Assistant, delete them after you are satisfied that the changes are correct.
Note:  When you are done using them, remove the SourceElements.img image file and the imported PropertyChanger application from your OpenROAD project.