Re: Couple of Dynamic-4GL questions using input array
Posted in 1998
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-342241519-903381931=:576 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 10 Aug 1998, Candy McCall wrote: > I have a form: > > DATABASE formonly > SCREEN > { > [a |b|c |d|e] > [a |b|c |d|e] > [a |b|c |d|e] > [a |b|c |d|e] > [a |b|c |d|e] > [a |b|c |d|e] > [a |b|c |d|e] > } > END > ATTRIBUTES > a = formonly.des1,NOENTRY; > b = formonly.buffer1,AUTONEXT; > c = formonly.des2,NOENTRY; > d = formonly.buffer2,AUTONEXT; > e = formonly.nextrow,NOENTRY; > END > INSTRUCTIONS > DELIMITERS " "; > SCREEN RECORD s_menu[7] (formonly.des1,formonly.buffer1, > formonly.des2,formonly.buffer2,formonly.nextrow) > > that is used in 4GL to simulate a menu. It can simulate a 2 column > menu in that as the user moves the cursor with the arrow keys, I can > highlight a particular column by using a statement such as: > DISPLAY .... TO s_menu[k].buffer1,s_menu[k].des1 ATTRIBUTE(REVERSE) > where k is the row to be highlighted. > > Well, this works great in I4gl. But now in Dynamic-4GL it doesn't > work the same way. First of all, the two entry fields show as empty > boxes on the form (in 4GL they were not visible) This is correct behaviour by D4GL; they were part of the I4GL form, but I agree they were not readily visible. This sort of thing does require coding changes. > and cosmetically the form doesn't look good. And, also, when I use the > DISPLAY ..... ATTRIBUTE(REVERSE) as above, the entire row is highlighted > instead of the desired fields so I don't have the same visual effect. Can you show some simple code with this problem? I attach my attempt. Note that if you comment out the BEFORE ROW and AFTER ROW blocks, you get the same visual effect as with them present, at least on my machine (Sun Sparc 20, Solaris 2.6, D4GL 2.00.UC1) -- the current row is automatically highlighted. > I was wondering if there is something I can change for the XTERM > termcap for one to cause it to highlight just some of the fields > instead of the entire row. I've seen mentioned somewhere an INVISIBLE > attribute field for a form. Can you set this on an entry field? > > Does anyone have any ideas so I can get my desired behavior? No, I'm not sure how you get your desired behaviour with INPUT ARRAY, or even with DISPLAY ARRAY. Are you trying to line up two options per row? Why not simply have a double-column array on the form? Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn ---559023410-342241519-903381931=:576 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kk.4gl" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.GSO.3.96.980817122531.576P@osiris.mp.informix.com> Content-Description: Sample 4GL code MAIN DEFINE r ARRAY[4] OF RECORD s1 CHAR(10), s2 CHAR(10) END RECORD DEFINE i INTEGER OPEN WINDOW w1 AT 1, 1 WITH FORM "kk" FOR i = 1 TO 4 LET r[i].s1 = i USING "rec ##&" LET r[i].s2 = i USING "fld ##&" END FOR CALL SET_COUNT(4) INPUT ARRAY r.* WITHOUT DEFAULTS FROM s_f.* BEFORE ROW LET i = ARR_CURR() DISPLAY r[i].s1 TO s_f[i].field1 ATTRIBUTE(REVERSE) AFTER ROW LET i = ARR_CURR() DISPLAY r[i].s1 TO s_f[i].field1 ATTRIBUTE(NORMAL) END INPUT CLOSE WINDOW w1 END MAIN ---559023410-342241519-903381931=:576 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kk.per" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.GSO.3.96.980817122531.576Q@osiris.mp.informix.com> Content-Description: Sample form file database formonly screen { [f000 ][f001 ] [f000 ][f001 ] [f000 ][f001 ] [f000 ][f001 ] } end attributes f000 = formonly.field1; f001 = formonly.field2; end instructions screen record s_f[4] (formonly.*) end ---559023410-342241519-903381931=:576--