[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Moving between text-entry widgets...

David Morris (dmorris@ball.com) writes:

> I have several IDL appliations I am building, each of which has
> multiple data-entry fields.  For smiplicity, I am bulding the
> data-entry screens using the CW_FORM function.  Most of the data
> fields are for entering integers, but some are button groups.
> Unfortunatley, using the mouse to go between these fields is a royal
> pain, especially durring debugging.
> The Question:  What is the easiest way to setup the TAB-key on the
> keyborad to go between data fields?  (and smilarly, Shift-Tab to go
> backwards through the fields).  I am not overly attached to the
> Compount Widgets built into IDL (yet), so if it is easier to re-build
> my widgets using objects, I can do this to make the additin of the
> TAB-key to switch between fields easier.

I think you may be out of luck here, without going to a lot
of effort that will certainly make your code machine-dependent.
The TAB character (ASCII character 9) is problematic. On a
Mac, you would tab to your field automatically. On a PC
you can only trap tab characters if the text widget is non-editable.
In an editable field, your machine beeps at you. There is no
hope, I believe for a Shift-Tab combination.

What you could probably do on a UNIX machine is turn All_Events
and Editable on in your text widgets. Then trap for an insert
event with an ASCII value of 9. If you got such an event, you
would just throw it away and move your focus to the next 
text widget. I've done this before, and I can assure you
it is WAY more work than it is worth. :-(


David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155