Path: utzoo!attcan!uunet!cs.utexas.edu!csd4.csd.uwm.edu!mailrus!cwjcc!gatech!mcnc!kk From: kk@mcnc.org (Krzysztof Kozminski) Newsgroups: comp.sys.mac.programmer Subject: Re: Moving a Textedit field in a modal dialog - solution (?) Message-ID: <1354@speedy.mcnc.org> Date: 24 Aug 89 23:14:04 GMT References: <15088@dartvax.Dartmouth.EDU> <21428@cup.portal.com> <58078@tut.cis.ohio-state.edu> <8356@hoptoad.uucp> <1341@speedy.mcnc.org> <8376@hoptoad.uucp> Reply-To: kk@mcnc.org.UUCP (Krzysztof Kozminski) Organization: Microelectronics Center of NC; RTP, NC Lines: 32 In article <8376@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >Deactivation is indeed a better solution, though it doesn't completely >address the problem of modality. But at least it gives a clear visible >indication of the modal behavior. With text edit items, you can always >disable them by turning them into user items with SetDItem and binding >a "draw light gray" drawing procedure, then doing an InvalRect on the >item's surrounding rectangle. I don't think this causes any problems. OK, I got the following idea: make an additional, inactive userItem that exactly overlaps the text edit item that may be subject to disappearance, and let its procedure draw a gray rectangle in patOr mode. Then just do Show/HideDItem on the text edit item as needed. The userItem shows up only when the text item is hidden, (otherwise it blends with the text box - that's why you need to use 'patOr' mode or to place the userItem underneath the text item) and you don't have to bother storing the control handle, activating/deactivating the item, making sure not to try to get text from your userItem, etc. Tim's proposition also works (I checked - Dialog Manager handles the 'tab loop' correctly), but requires approximately twice as much programming effort (20 lines of code versus 10 :-) On the subject of modality - sometimes you do need things like discussed above - imagine an object with attributes A, B, ..., Z, with attribute B that has a text value and that makes sense only if binary attribute A is set. Using different dialogs for the object, depending on the value of A, would be bothersome both for the user and for the programmer. KK -- Kris Kozminski kk@mcnc.org "The party was a masquerade; the guests were all wearing their faces."