🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #5930

Re: GUI Style Question

#5930
From: Glamdring
Date: Wed, 17 Oct 1990 19:35
58 lines
3522 bytes
In article <1990Oct12.053232.22478@nas.nasa.gov>, 
         smithwik@pioneer.arc.nasa.gov (R. Michael Smithwick -- FSN) writes:
> 
> In article <8973@milton.u.washington.edu> dlarson@blake.u.washington.edu (Dale Larson) writes:
> <
> <In an application I am currently developing, I have a window for entering 
> <data which includes radio buttons, string gadgets and integer gadgets.  
> <Some fields are optional.  My question is:  Since string gadgets only
> <notify when "RETURN" is pressed, should the value entered be the state
> <of the string when "RETURN" was last pressed, or should I copy the string
> <to the record just before freeing the gadget and closing the window?
> <I think that I should be doing the later, someone please correct me if
> <I'm wrong.
> <--
> <-Dale Larson  (dlarson@blake.u.washington.edu)
> 
> The data used should be the last data seen by the user whether he/she
> hits return or not. Vista 1.0 requires CR to be hit, and we get endless
> complaints about that. The user types in data into a single stringgad and
> just assumes that that is what will be used. Wrongo. The program doesn't do
> what the data in the window sez it should be doing and they file a bug report.
> 
> So make sure to read the gadgets buffer and never assume the user hit the CR.
> 
> 
> mike
> 
> 
>                                        >> mike smithwick <<

The real question then, becomes how to process user input on a per field
basis.  For instance, the user enters a part number or some key field, and
based on that data the program should fill in various other fields with
existing or default information.  Or better yet perhaps you wish to validate
the user's entry before (s)he proceeds beyond that point...

The user could enter the key data and then use the mouse to move, not pressing
CR and thereby not triggering your program's field processing code...  This is
not a good thing.

One might argue that all field validation should be done at the end of the
screen (ala FOCUS or other 4GLs), but IMHO that is very impolite to the user,
as they might have entered 20-30 fields before they find that some critical bit
of data was invalid...

My solution (this is the question part of this post...) is to always keep track
of which field was most recently activated (GADGETDOWN) and to perform the
field processing code on GADGETDOWN messages if the newly activated gadget
doesn't match the last activated gadget.  Is this the best way to do this?  It
appears to work, but I am leary of possible holes in my logic.  Better yet, is
there a better way to do this?  Thanks for any input, but do direct any flames
to me via mail.
 ______________________________________________________________________
/ Rockford Lhotka				INCSTAR Corp	       \
| Systems Administrator				PO Box 285	       |
| incstar!lhotka@uunet.uu.net         		1990 Industrial Blvd   |
\ 612/779-1701					Stillwater, MN 55082   /
 ----------------------------------------------------------------------
Technical Details
Message-ID: <635@incstar.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!nosc!crash!orbit!incstar!lhotka
References: <8973@milton.u.washington.edu> <1990Oct12.053232.22478@nas.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!nosc!crash!orbit!incstar!lhotka
From: lhotka@incstar.uucp (Glamdring)
Newsgroups: comp.sys.amiga.tech
Subject: Re: GUI Style Question
Message-ID: <635@incstar.uucp>
Date: 17 Oct 90 19:35:05 GMT
References: <8973@milton.u.washington.edu> <1990Oct12.053232.22478@nas.nasa.gov>
Organization: INCSTAR Corp, Stillwater MN
Lines: 58