Toggle Box Colour

Posted by SHASHANK on 08-Aug-2018 08:24

Hello All,

I need to fill Color inside the toggle box in GUI interface when it is checked, I do below:

if tgl:CHECKED then

ASSIGN

    tgl:BGCOLOR = 14

   tgl:FGCOLOR  = 14.

it filling color around the toggle box but not in it's Checkbox.

it is possible to fill color in toggle check box.

Please Suggest.

Thanks,

Shashank S. Singh

Posted by Matt Gilarde on 08-Aug-2018 10:36

It's not possible to change the color of the check box in a toggle-box widget in OpenEdge. BGCOLOR changes the background color of the toggle-box widget. FGCOLOR changes the color of the toggle-box widget's text. Neither attribute will change the color of the check box. Also, note that the text color won't change unless you're using the Classic Windows interface. This is due to a bug in Windows.

All Replies

Posted by Matt Gilarde on 08-Aug-2018 10:36

It's not possible to change the color of the check box in a toggle-box widget in OpenEdge. BGCOLOR changes the background color of the toggle-box widget. FGCOLOR changes the color of the toggle-box widget's text. Neither attribute will change the color of the check box. Also, note that the text color won't change unless you're using the Classic Windows interface. This is due to a bug in Windows.

Posted by Adriano Correa on 09-Aug-2018 09:47

Do you need a toggle, or you need something to click on and change a color?

If option 2, try this:

DEFINE VARIABLE fl-togo AS CHARACTER FORMAT "X(256)":U INITIAL "False"

    LABEL "My Togo"

    VIEW-AS FILL-IN

    SIZE 3 BY .71

    BGCOLOR 12 FGCOLOR 12  NO-UNDO.

DEFINE FRAME DEFAULT-FRAME

    fl-togo AT ROW 3 COL 20 COLON-ALIGNED

   WITH 1 DOWN SIDE-LABELS THREE-D

        AT COL 1 ROW 1 SIZE 80 BY 10.

ON MOUSE-SELECT-CLICK OF fl-togo IN FRAME DEFAULT-FRAME

DO:

   IF fl-togo = "True"

       THEN ASSIGN fl-togo = "False"

                   fl-togo:BGCOLOR = 12

                   fl-togo:FGCOLOR = 12.

       ELSE ASSIGN fl-togo = "True"

                   fl-togo:BGCOLOR = 10

                   fl-togo:FGCOLOR = 10.

END.

DISPLAY fl-togo WITH FRAME DEFAULT-FRAME.

ENABLE fl-togo WITH FRAME DEFAULT-FRAME.

ASSIGN fl-togo:READ-ONLY IN FRAME DEFAULT-FRAME        = TRUE

      fl-togo:SCREEN-VALUE = "".

WAIT-FOR CLOSE OF THIS-PROCEDURE.

Posted by Rick Terrell on 09-Aug-2018 10:28

Or define a fill-in with a small rectangle next to it. Do something similar to the code shown, except change the fill color of the rectangle as appropriate. 

Rick Terrell 
Principle Consultant, Professional Services 
Progress

Sent from my iPhone

This thread is closed