home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!waikato.ac.nz!canterbury.ac.nz!lincoln.ac.nz!cachoo
- Newsgroups: comp.lang.pascal
- Subject: Re: Input validation standards (was Re: ... Inputing Real Numbers)
- Message-ID: <1992Jul22.171117.222@lincoln.ac.nz>
- From: cachoo@lincoln.ac.nz
- Date: 22 Jul 92 17:11:16 +1200
- References: <10529810.23.711265015@eng2.eng.monash.edu.au> <9978@vice.ICO.TEK.COM> <54370@mentor.cc.purdue.edu>
- Distribution: comp.lang.pascal
- Lines: 48
-
- In article <54370@mentor.cc.purdue.edu>, pf@bilbo.bio.purdue.edu (Paul Furbacher) writes:
- > In article <9978@vice.ICO.TEK.COM>, bobb@vice.ICO.TEK.COM (Bob Beauchaine) writes:
- >> I recently received email from a user of TVinp101 who mentioned a
- >> question touched on in passing on this group:
- >> What is the proper way to check the validity of an input in a
- >> dialog box? I don't have a copy of the CUI spec, but a poster
- >> here as I remember mentioned that no input should be validated
- >> until the user attempts to close the dialog. My routines
- >> currently trap keystrokes that change the focused view and
- >> validates the input right on the spot, but I made
- >> no attempt to trap mouse initiated focus changes. As I
- >> contemplate an upgrade, I would like to resolve this issue before
- >> I release a new version.
- >
- >
- > I had wondered about this, too. In deriving an input validation for
- > descendents of TInputLine (hadn't seen Bob's unit on garbo), the
- > question of whether to trap loss-of-focus caused by the mouse
- > arose. Surveying many programs which do and do not conform
- > to CUA standards, it appears that none do this. I tried
- > various schemes for doing this, but it seemed too difficult to
- > implement (but I was much less experienced with TV at
- > that time).
- <...>
- > though few implement this. Could it be that mouse events
- > in event-driven systems are handled in such a way as
- > to make this more difficult to implement, therefore, the path
- > of least resistance is taken time-after-time? It seemed
- > difficult to trap the loss-of-focus caused by the mouse
- > in TV. Since I made my compromise, I haven't
- > thought/worried about it since.
- >
- > In terms of the mouse and *most* (not all) operations,
- > my advice is "use the keyboard". For many users, that's
- > a novel idea.
-
- Excuse my ignorance, I don't know what CUA standards are. But concerning
- input validation in TV, I've found it convenient to use the cmReleasedFocus
- broadcast command. This command is issued everytime a view losses focus,
- whether through keyboard or mouse action, this command informs TDialog that
- it should give focus to a different view. So my approach is to create a
- TSmartInputLine whose HandleEvent responds to cmReleasedFocus (this command
- is broadcast back from the dialog to all its subviews), if the Event.InfoPtr
- is equal to @Self, then the input line 'knows' that it should validate itself.
- Makes sense?
-
- Oscar
-
-