Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!ames!killer!rpp386!dalsqnt!pollux!ti-csl!m2!holland From: holland@m2.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: Re: Editable TextItems in Dialogs - Help! Message-ID: <68270@ti-csl.CSNET> Date: 26 Jan 89 16:50:26 GMT References: <3543@ucdavis.ucdavis.edu> <887@mailrus.cc.umich.edu> Sender: news@ti-csl.CSNET Reply-To: holland@m2.UUCP (Fred Hollander) Organization: TI Computer Science Center, Dallas Lines: 23 In article <887@mailrus.cc.umich.edu> shane@chablis.cc.umich.edu (Shane Looker) writes: >In article <3543@ucdavis.ucdavis.edu> jedeline@deneb.ucdavis.edu (Jim Deline) writes: >> >>I would like to be able to parse a string as it is being typed >>into an editable textitem field of a dialog, and have all numbers >>typed appear subscripted relative to the rest of the string. > >An interesting idea. I don't think you can do it with the normal EditText >item, since it uses TextEdit. Probably your best bet is to create a UserItem >which is modified (the text in it) based on what field you are in, and what key is hit. The way to do that is to create a filter proc which interecpts keydown >events, and modifies a global variable. Then return a hit in the UserItem I'm not sure if this would work, but, why couldn't you use a filterProc even with an editText field? The filterProc could intercept keyDown events. If the character is invalid, it could modify itemHit and possibly theEvent. Like I said, I haven't tried this but it sounds like it should work. Fred Hollander Computer Science Center Texas Instruments, Inc. holland%ti-csl@csnet-rela The above statements are my own and not representative of Texas Instruments.