Re: 4GL window reverse colour
Posted in 2003
<top posting rearranged>
Tsutomu Ogiwara wrote:
>
>>From: Ian Wilson <scobloke2@infotop.co.uk>
>>
>>When in ancient 4GL I do
>>
>> open window mywin at 5,5
>> with form "idwc"
>> attribute (border, reverse, yellow)
>>
>>I expect to get a yellow rectangle including a yellow background in
>>otherwise empty parts of the window.
>>
>>However 4GL draws blank bits of the form in the wrong background color.
>>
>>I've tried various termcap entries with various ZA strings - all give
>>the same result. By looking at the transmitted codes, 4GL explicity sets
>>the attributes to white on black, then transmits spaces.
>>
>>Was this fixed in less ancient versions of 4GL?
>>
> Hi Ian.
>
> Can you display reverse characters as following command ?
>
> echo "\\033[7;35mTHIS IS REVERSED CHARATERS\\033[0m"
That produces the expected effect.
> If you can not display reverse characters, make sure your TERM and TERMCAP
> and your telnet app.
> This url http://dickey.his.com/vttest/vttest.html may be helpful for you.
Thanks, but my problem is the way I4GL draws the window. I have tried a
variety of terminal emulators, TERM values and TERMCAP entries.
I used a network sniffer to capture the transmitted data. For the line
beginning "c" in my form below, I4GL sends strings such as these: (I
changed space to underscore for clarity)
<esc>(0
<esc>[0;43;30mx
<esc>(B
<esc>[0;47;30m___________________________________
<esc>(0
<esc>[0;43;30mx
<esc>(B
The above is how I4GL draws the vertical bars of the border at left and
right of the window. Note it paints the bars in black on yellow but
incorrectly fills the interior with black on white background (not
yellow!). Later I4GL sends:
<esc>[0;43;30m
...
<esc>[11;5Hc_
<esc>[0;47;30m
The above writes the "c" correctly in black on yellow.
The only workaround I have found is to add explicit spaces to the end of
the lines in the form.
instead of "c" I put "c " and this
causes I4GL to transmit
<esc>[11;5Hc_________________________________
thus causing a yellow background to be correctly overpainted.
In case you are wondering, the ZA string for the above is one I tweaked
to show black on white characters normally:
:ZA=\\E[0;%?%p2%t%?%p1%{0}%=%t40;37%e%p1%{1}%=%t43;30%e%p1%{2}%=%t45;37%e
%p1%{3}%=%t41;37%e%p1%{4}%=%t46;30%e%p1%{5}%=%t42;30%e%p1%{6}%=%t44;37%e%p1%{7}%
=%t40;33%;%e47;%?%p1%{0}%=%t30%e%p1%{1}%=%t33%e%p1%{2}%=%t35%e%p1%{3}%=%t31%e%p1
%{4}%=%t36%e%p1%{5}%=%t32%e%p1%{6}%=%t34%e%p1%{7}%=%t37%;%;%?%p3%t;5%;%?%p4%t;4%
;m:
However I observed the same problem with ZA strings gleaned from IIUG
and elsewhere. The ZA string defines how I4GL constructs the colour
specifier to be transmitted but cannot influence how I4GL chooses to use it.
>>
>>76% cat idwc.4gl
>>/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/
>>#>># test colour attributes
>># glitch: when I4GL displays message
>># it clears to EOL using wrong attributes
>>#
>>
>>main
>>define
>> l_name character(10),
>> l_add1, l_add2 character(20)
>>
>>options
>> input attribute (reverse, underline, green),
>> display attribute (reverse, blue)
>>
>>display "+----------------------------------------------------+" at 1,1
>>display "|1111111111111111111111111111111111111111111111111111|" at 2,1
>>display "|2222222222222222222222222222222222222222222222222222|" at 3,1
>>display "|3333333333333333333333333333333333333333333333333333|" at 4,1
>>display "|4444444444444444444444444444444444444444444444444444|" at 5,1
>>display "|5555555555555555555555555555555555555555555555555555|" at 6,1
>>display "|6666666666666666666666666666666666666666666666666666|" at 7,1
>>display "|7777777777777777777777777777777777777777777777777777|" at 8,1
>>display "|8888888888888888888888888888888888888888888888888888|" at 9,1
>>display "|9999999999999999999999999999999999999999999999999999|" at 10,1
>>display "|0000000000000000000000000000000000000000000000000000|" at 11,1
>>display "|1111111111111111111111111111111111111111111111111111|" at 12,1
>>display "|2222222222222222222222222222222222222222222222222222|" at 13,1
>>display "|3333333333333333333333333333333333333333333333333333|" at 14,1
>>display "|4444444444444444444444444444444444444444444444444444|" at 15,1
>>display "|5555555555555555555555555555555555555555555555555555|" at 16,1
>>display "+----------------------------------------------------+" at 17,1
>>
>>open window mywin at 5,5
>> with form "idwc"
>> attribute (border, reverse, yellow)
>>
>>message "hello"
>>error "oops!"
>>
>>let l_name = "Joe Smith"
>>let l_add1 = "32767 main st"
>>
>>display l_name to sfname
>>input l_add1, l_add2
>> from sfadd1, sfadd2
>>
>>close window mywin
>>
>>end main
>>/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/
>>77% cat idwc.per
>>/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/>>database formonly
>>
>>screen
>>{
>> Name: [f01 ]
>> Address: [f02 ]
>> [f03 ]
>>a
>>b b
>>c
>>}
>>end
>>
>>attributes
>> f01 = FORMONLY.sfname type character, noentry;
>> f02 = formonly.sfadd1 type character, comments="Street address";
>> f03 = formonly.sfadd2 type character, comments="City, Post Code,
>>Country";
>>end
>>
>>instructions
>> delimiters " "
>>end
>>/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/