Highlighted
Absent Member.
Absent Member.
577 views

[archive] Changing colors

[Migrated content. Thread originally posted on 03 October 2005]

I want to change the background and foreground colors of entry-fields, labels etc...

Using W$PALETTE, I get values in WPAL-RED WPAL-GREEN WPAL-BLUE.

How do one have to code these values to change f.i. the background of an entry-field ?
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Changing colors

This code works for setting the foreground and background colors:

initialize wpalette-data.
call "W$PALETTE" using 1, WPALETTE-DATA
giving result.
if result = WPAL-FULL-SUPPORT
call "W$PALETTE" using WPALETTE-CHOOSE-COLOR
WPALETTE-DATA giving result
if result not equal WPERR-CANCELLED
call "W$PALETTE" using WPALETTE-SET-COLOR,
WPALETTE-DATA giving result.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Changing colors

I was aware of this function but thanks anyway.
Meanwhile I figured it out myself.

Your code changes a certain color indead. But then to change the back- and foreground-color of an entry-field, one just have to use the basic values of that color.

For instance : MODIFY ENTRY-FIELD, COLOR = 48

This will set the background-color to black (32) and the foreground-color to white (16)... whatever RGB-value one set for black and white.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.