Protected Fields with foreground and background colors

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Protected Fields with foreground and background colors

Post by Susan Smith »

Can anyone tell me (in BR 4.18) how I can have a protected field (in a RINPUT FIELDS MAT...) that is both protected AND has colors specified for foreground and background OTHER than those in the [INACTIVE] attribute?

I have several fields on the same screen that are protected, but I don't want to display them all with the same attributes. One of those protected fields is a key that is assigned by the computer. That key has to be easily visible to the user. I want to display it in BLUE foreground on a YELLOW background (#0000FF:#FFFF00), possibly with a bolder font as well. But the other fields that are protected should just have the standard protected look. They are all in the same RINPUT statement.

Any ideas?

-- Susan
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

I don't believe that you can. You are locked into the proteced/inactive appearance. For what you are trying to do you will need to have that feld unprocted, but not allow the user to change it. You can do this by:

LET HKEY$="123456"

01000 RINPUT FIELDS "3,10,c 6,[DX]x;4,10,c 5,[D]x;5,10,c 5,[D],P":key$.a$.b$ !:let key$=HKEY$
01010 do stuf
01020 goto 1000

So that even if your userts changes the key it is immediately set back to what it should be before the line is exited. The "X" attrribute on the key field is useful and putting the reset on the same line as the RINPUT statement is imperative so the user cna't change the key and sneak into some other processing branch.
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Thank you George. I didn't realize that I had ANY options!

I should also mention an idea that Gabriel suggested to me last night - just in case anyone else finds themselves in this same situation. You can always load your "special" protected data field into a caption/heading so that it gets out of the RINPUT loop altogether and can be colored anyway you want. Since the whole point is NOT to let the user change the field, it doesn't really HAVE to be in the RINPUT FIELDS data loop.

In my case, the "special" protected field that I want to color differently from the "normal" protected fields is a key. It needs to be visually PROMINENT, rather than "grayed out". But I don't want the user to be able to change it.

So if all of my screen captions are stored in MAT HEADING$, I just reserve one of those elements: let HEADING$(6)=PROTECTEDKEY$. I can even format the string with CNVRT$ if the key is numeric.

-- Susan
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Exactly. I didn't realize that this behavior had changed. I didn't see anything about it in any release notes - unless I just missed it. I know that Gordon once told me that I could change the look of ALL protected fields by setting the [INACTIVE] attribute to something else (which is true), but at that time, you didn't HAVE to use [INACTIVE] to color your protected fields separately. It was just one more option, not the ONLY way you could do this. At that point (in 4.17), you could use the [INACTIVE] attribute if you wanted to, or you could combine the "P" with color attributes for a different look. I'm disappointed that this apparently has changed. One other change is the automatic "S" attribute in RINPUT FIELDS. I'll address that in another message.

-- Susan


Mikhail wrote:
In 4.18i I wasn't able to print color on cells that are already protected,

but in 4.17L I was.
Post Reply