Re: XForms: counter, input and ... RETURN_END_CHANGED.

Michael Glickman (michg@alphalink.com.au)
Wed, 05 May 1999 23:33:40 +1000

# To subscribers of the xforms list from Michael Glickman <michg@alphalink.com.au> :

Trent Piepho wrote:

> # To subscribers of the xforms list from Trent Piepho <xyzzy@u.washington.edu> :
>
> How about adding a wrap around (modulus) to the counter object? For example
> if the counter is set to go from 1 to 10 with a step of 1, clicking the
> increase button with the counter at 10 would cause it to go back to 1.
>
> One can sort of get this effect using a callback kludge, but there are
> limitations. This is done by increasing the counter range by one step, in the
> previous example the range would be 0 to 11 for example, and having the
> callback set the counter to 1 when it reaches 11, and setting it to 10 when it
> reaches 0.
>
> In order to do this, the counter has to be set to activate the callback when
> changed (ie FL_RETURN_CHANGED instead of FL_RETURN_END_CHANGED), not on only
> on end. With the counter set to FL_RETURN_CHANGED there is no easy way to
> detect the end of the change. So if FL_RETURN_END_CHANGED was the behavior
> you really wanted, it is hard to achieve.
>
> Then there is a visual glitch, where the counter goes to 11 then changes back
> to 1 that gives the application an unpolished look.
>
> Any chance of the this getting added to a new release of xforms? It's not a
> hard thing to do. If I had the xforms source I could probably have done it by
> now in the time it took me to write this message.
>
> A counter than can count an arbitrary sequence would be nifty too. Count up
> by primes, or skip 13, or in my case, skip TV channels that are programmed
> out, like a TV or VCR does.
>

Sorry, I am not going to discuss your point. Once you need "nifty"
and non-standard counter, you can simply emulate it with a box
and two or four buttons around it Remember XForms is open for
new controls, especially those that can easily be realized
(as in your case) .

But once you raised
the problem of inconsistency with RETURN_END_CHANGED ,
I just want to emphasize that this is true not for the counter only.

Take input field for example. If you wish to be non-intrussive,
a good idea would be to wait till the input has been finished,
and then you can process it. This appears to be the main idea
behind RETURN_END_CHANGED.

However, RETURN_END_CHANGED fires only when pressing
"Enter" or <CR> key. Meanwhile you can simply leave the field
by selecting another object (or with Tab key for inputs). In this
case callback routine will be never called!

This where I really couldn't do anything and I was forced
to use RETURN_CHANGED in
places where RETURN_END_CHANGED looked more
appropriate!

Michael

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/