Skip to main content

We are trying to use the new button color feature in 9.2, but can't get the colors to work as a variable.  The value can be negative, so we are using signed variables.  The max color value is FFFFFF (16,777,215 = 8 digits).  In the sample excerpt below, Button 1 shows with a Pink background.  The other two buttons have a maroon background.  How can we set the colors at runtime?

Working-Storage Section.

78 RGB-Pink value X#CBC0FF.
01 ws-color-pic pic S9(8).
01 ws-color-int usage is signed-int.

Screeen Section.

01 main-screen.
03 push-button line 2 col 10 title "Button 1" background-rgb RGB-Pink.
03 push-button line 2 col 30 title "Button 2" background-rgb ws-color-pic.
03 push-button line 2 col 50 title "Button 3" background-rgb ws-color-int.

Procedure Division.

move RGB-Pink to ws-color-pic, ws-color-int.
display main-screen.
display message "stop".
destroy main-screen.
stop run.


#ButtonRGBColor

We are trying to use the new button color feature in 9.2, but can't get the colors to work as a variable.  The value can be negative, so we are using signed variables.  The max color value is FFFFFF (16,777,215 = 8 digits).  In the sample excerpt below, Button 1 shows with a Pink background.  The other two buttons have a maroon background.  How can we set the colors at runtime?

Working-Storage Section.

78 RGB-Pink value X#CBC0FF.
01 ws-color-pic pic S9(8).
01 ws-color-int usage is signed-int.

Screeen Section.

01 main-screen.
03 push-button line 2 col 10 title "Button 1" background-rgb RGB-Pink.
03 push-button line 2 col 30 title "Button 2" background-rgb ws-color-pic.
03 push-button line 2 col 50 title "Button 3" background-rgb ws-color-int.

Procedure Division.

move RGB-Pink to ws-color-pic, ws-color-int.
display main-screen.
display message "stop".
destroy main-screen.
stop run.


#ButtonRGBColor

Hi Shane .. I think you are very close .. I think the issue is you should use 9.2.1 ... 9.2.0 had a couple issues with the new COLOR feature, 9.2.1 has ecn4230: 9.2.1 which dealt with push-button colors. I put a standard window in your program and named each button ...
03 pb1 push-button
03 pb2 push-button
03 pb3 push-button 
 Now all three show pink.


We are trying to use the new button color feature in 9.2, but can't get the colors to work as a variable.  The value can be negative, so we are using signed variables.  The max color value is FFFFFF (16,777,215 = 8 digits).  In the sample excerpt below, Button 1 shows with a Pink background.  The other two buttons have a maroon background.  How can we set the colors at runtime?

Working-Storage Section.

78 RGB-Pink value X#CBC0FF.
01 ws-color-pic pic S9(8).
01 ws-color-int usage is signed-int.

Screeen Section.

01 main-screen.
03 push-button line 2 col 10 title "Button 1" background-rgb RGB-Pink.
03 push-button line 2 col 30 title "Button 2" background-rgb ws-color-pic.
03 push-button line 2 col 50 title "Button 3" background-rgb ws-color-int.

Procedure Division.

move RGB-Pink to ws-color-pic, ws-color-int.
display main-screen.
display message "stop".
destroy main-screen.
stop run.


#ButtonRGBColor

I switched to "Micro Focus extend compiler version 9.2.1 ECN-4243 ECN-4245" and "Micro Focus extend runtime version 9.2.1 ECN-4243 ECN-4245".  The button colors are now working properly.  Thanks!