Universal Text Color

KMoody

Member
In our legacy programs, we've found many frames that look like this:

upload_2015-4-24_16-37-59.png

It's very difficult to distinguish labels from actual data.

Is there a way to universally set different colors or fonts for static and for dynamic text within frames? Is there a setting in the .INI we could change to accomplish this? We'd like to make the labels look different, but we don't want to change colors for every label in every frame if we can avoid it.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Look into the COLOR statement. You can do a couple of things:
  • use underline or reverse video to distinguish some text elements, e.g. COLOR DISPLAY [NORMAL | INPUT | MESSAGES] sometext WITH FRAME whatever;
  • use colours defined in the protermcap you're using with your session, e.g. COLOR DISPLAY color phrase sometext WITH FRAME whatever.
 

TomBascom

Curmudgeon
If the fields that you want to color are active for INPUT you could set the NORMAL and INPUT colors differently in PROGRESS.INI

Otherwise you will indeed need to modify each frame.
 

Osborne

Active Member
Is it possible to have an external program or class you could run for each program passing it the frame handle which could adjust the attributes at run-time? Something like the following that will change the foreground color and the font for all the labels of FILL-IN's and text objects in a frame:
Code:
DEFINE INPUT PARAMETER phFrame AS HANDLE NO-UNDO.

DEFINE VARIABLE hWidget AS HANDLE NO-UNDO.
DEFINE VARIABLE vCount AS INTEGER NO-UNDO.

ASSIGN
    hWidget = phFrame:FIRST-CHILD
    hWidget = hWidget:FIRST-CHILD.

DO WHILE hWidget <> ?:
    IF hWidget:TYPE = "LITERAL" THEN
        ASSIGN
            hWidget:FGCOLOR = 9
            hWidget:FONT = 6.
    hWidget = hWidget:NEXT-SIBLING.
END.
 
Last edited:

KMoody

Member
Tom, we were hoping we could give all active and inactive input fields the same colors, but it doesn't sound like we can.

Osborne, that's a neat solution, but we'd have to change every program and reference every frame to use your procedure.

Thanks for your help, everyone. Looks like there's no Easy Button on this one. :)
 
Top