Can we add custom color(with RGB value) to background of widgets in progress 4gl

92 Views Asked by At

Can we add custom color(with RGB value) to background of widgets in progress 4gl ? I want to add orange color to the background. Orange color (with RGB value 255,165,0) is not available in the progress ADE and I don't want to edit the *.ini file.


2

There are 2 best solutions below

2
Mike Fechner On

You can use the COLOR-TABLE system handle to manipulate colors at runtime through code.

https://community.progress.com/s/article/howtousespecificRGBcolorvaluesforwidget

But why don't you want to edit the progress.ini file? It's the place where colors and font's along with the PROPATH of an application are defined.

Progress colors are defined in the progress.ini file used (-basekey ini, -ininame startup parameters) in the colors section:

    [Colors]
;******************************************************************************
; THE DEFINITION OF COLOR 0 THROUGH 15 IS PRIVATE TO THE PROGRESS ADE.  
; MODIFYING COLORS 0 THROUGH 15 MAY PREVENT THE PROGRESS ADE FROM RUNNING.
; The following color definitions correspond to the ADE standards.
;  0 to 15  - reserved
color0=0,0,0
color1=0,0,128
color2=0,128,0
color3=0,128,128
color4=128,0,0
color5=128,0,128
color6=128,128,0
color7=128,128,128
color8=192,192,192
color9=0,0,255
color10=0,255,0
color11=0,255,255
color12=255,0,0
color13=255,0,255
color14=255,255,0
color15=255,255,255
color16=227,239,255
color17=255,255,255
color18=160,160,160
color19=0,0,0
color20=0,0,0
color21=0,0,0
color22=0,0,0
color23=0,0,0
color24=0,0,0
color25=0,0,0
color26=0,0,0
color27=0,0,0
color28=0,0,0
color29=0,0,0
color30=0,0,0
color31=0,0,0
color32=0,0,0
color33=227,239,255

You can use colors 16 and up for your own purpose.

When you're not using an .ini file, those settings are in the registry:

enter image description here

0
FloW On

here a function example with COLOR-TABLE system handle

the return value is a new number in the COLOR-TABLE with your rgb values

   FUNCTION SetClrRgbVal RETURNS INTEGER (iRgbVal AS INTEGER):      

      DEFINE VARIABLE iCnt AS INTEGER    NO-UNDO.
      COLOR-TABLE:NUM-ENTRIES = 255.

      DO iCnt = COLOR-TABLE:NUM-ENTRIES - 1 TO 1 BY -1:

         IF COLOR-TABLE:GET-RGB-VALUE(iCnt) = 0 OR COLOR-TABLE:GET-RGB-VALUE(iCnt) = iRgbVal THEN DO:
            
            COLOR-TABLE:SET-DYNAMIC(iCnt,TRUE).
            COLOR-TABLE:SET-RGB-VALUE(iCnt, iRgbVal).
            RETURN iCnt.

         END.

      END.

      RETURN ?.
   END. 

and a widget with a orange color

edColor:BGCOLOR IN FRAME {&FRAME-NAME} = SetClrRgbVal(RGB-VALUE(255,165,0)).