Re: XForms: order of visitation

Richard Kent (kent@hydra.dra.hmg.gb)
Tue, 8 Jul 1997 14:18:32 +0100

To subscribers of the xforms list from "Richard Kent" <kent@hydra.dra.hmg.gb> :

> Would it be possible to construct a callback or some handler function that
> intercepts the tab and return keys? One might be able to place input boxes
> into an array and set the focus from that. I have an array of inputs in
> my program which form a spreadsheet, and I am trying to get the tab key
> to move horizontally (the return and tab keys currently move verticaly,
> the order in which they were created).

I haven't tried this but.....

You could presumably register a pre-emptive handler (see dirty tricks in the
manual) for the input boxes of interest. This will give you the Xevent so you
can do something like :-

int handler (FL_OBJECT *ob, int event,
FL_Coord mx, FL_Coord my,
int key, void *raw_event)
{
if (key == '\t')
{
if (ob == myform->input1)
fl_set_focus_object (myform->myform,myform->input2)
else if (ob == myform->input2)
fl_set_focus_object (myform->myform,myform->input3)
.....
}
return 0; (or possibly return FL_PREEMPT - not sure)
}

However, on a more general note it would certainly be a worthwhile addition to
Xforms to have the ability to define the input field order from within fdesign
(rather than it being set implicity using "order of creation"). In fact, I
still like the ability to work graphical dialogs using the keyboard only (it's
about the only thing I like about MS Windoze). So that would mean tab should
move around EVERYTHING in a specified order (not just input fields) and the
return key can push buttons, the arrow keys can scroll lists, etc, etc. In my
mind this would be the "finishing touch" currently lacking from Xforms (as well
as an NT port, hint, hint).

Hope this helps,

TicH

------------------------------------------------------------------------
| Name - Richard Kent |
| EMail - kent@hydra.dra.hmg.gb |
| Plan - All work and no play.....hi ho, hi ho |
------------------------------------------------------------------------

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