home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!chx400!urz.unibas.ch!gysin1
- From: gysin1@urz.unibas.ch
- Newsgroups: comp.lang.pascal
- Subject: Re: TV Focus in Dialog views
- Message-ID: <1992Aug21.190034.40057@urz.unibas.ch>
- Date: 21 Aug 92 19:00:34 MET
- References: <10202@vice.ICO.TEK.COM>
- Organization: University of Basel, Switzerland
- Lines: 42
-
- In article <10202@vice.ICO.TEK.COM>, bobb@vice.ICO.TEK.COM (Robert Beauchaine) writes:
- >
- > Here's the problem:
- >
- > I'm attempting to trap loss of focus events in Turbo Vision among
- > views within a dialog box. I want to validate my numerical input
- > lines whenever the user moves off the focused input, either via
- > the keyboard or mouse.
- >
- > I can trap a view's loss of focus by overriding the SetState()
- > method and looking for an sfFocused bit combined with a false
- > Enable. The problem with this scheme is that SetState() is
- > ignorant of what event is causing the change in focus. If I close
- > the dialog box with a cmCancel, SetState() is still called, and
- > the input line attempts to validate itself even though the user
- > does not care about the value.
- >
- > Keyboard events are not a problem, since they are automatically
- > routed to the focused event and can be handled by HandleEvent().
- > The positional events are where I'm getting hung.
- >
- > Suggestions?
- >
-
- Well, I think the only thing you can do is to override the
- HandleEvent-Method and redefine the function of kbTab and kbShiftTab (and -why
- not ? - kbEnter). The user is probably already typing in new values and has
- just to type the Tab-Key or Enter-Key to jump to the next InputLine. If he
- moves the focus with the mouse, he doesn't need to care for the value, any
- typing is ignored...
-
- For catching positional events, I suppose you should start at the
- Dialog's event handler that manages the subviews....
-
- Philipp Gysin
-
- Gysin1@urz.unibas.ch Basel, Switzerland
-
-
-
-
-
-