location in tab order?

Hello all. I'm wondering if it's possible to know where in the tab order
the cursor is (focus is) ? Specifically, I have say 7 text boxes (f. name,
l. name, address, phone, city, state, zip). So, if someone fills out f.
name, l. name, phone, but haven't gotten to city, state and zip yet; I'd
like to know if there's a way to know what text controls ABOVE the cursor
haven't been filled-out, but not below?

So, if I've gotten half way thru the tab order, and left blank 2 fields, I
want them to be high-lighted to show they're empty, but not the fields that
I haven't gotten to yet?

Thanks!
Dave

I think I would tackle this by capturing EVT_SET_FOCUS / EVT_KILL_FOCUS for all the text boxes. I can't find a GetFocus function, and anyway, it would need to be called from some event or other; the focus change events sound perfect.

Phil Mayes

···

At 10:16 AM 9/15/2006, you wrote:

Hello all. I'm wondering if it's possible to know where in the tab order
the cursor is (focus is) ? Specifically, I have say 7 text boxes (f. name,
l. name, address, phone, city, state, zip). So, if someone fills out f.
name, l. name, phone, but haven't gotten to city, state and zip yet; I'd
like to know if there's a way to know what text controls ABOVE the cursor
haven't been filled-out, but not below?

So, if I've gotten half way thru the tab order, and left blank 2 fields, I
want them to be high-lighted to show they're empty, but not the fields that
I haven't gotten to yet?

Thanks!
Dave

Bind EVT_SET_FOCUS on all of your text controls, and perhaps any 'OK' or
'Apply' buttons.

When one of them gets the focus, for each control previous to the
focused control in the tab order, if it is empty, change its background
color.

- Josiah

···

"S. D. Rose" <s_david_rose@hotmail.com> wrote:

Hello all. I'm wondering if it's possible to know where in the tab order
the cursor is (focus is) ? Specifically, I have say 7 text boxes (f. name,
l. name, address, phone, city, state, zip). So, if someone fills out f.
name, l. name, phone, but haven't gotten to city, state and zip yet; I'd
like to know if there's a way to know what text controls ABOVE the cursor
haven't been filled-out, but not below?

So, if I've gotten half way thru the tab order, and left blank 2 fields, I
want them to be high-lighted to show they're empty, but not the fields that
I haven't gotten to yet?

Phil Mayes wrote:

···

At 10:16 AM 9/15/2006, you wrote:

Hello all. I'm wondering if it's possible to know where in the tab order
the cursor is (focus is) ? Specifically, I have say 7 text boxes (f. name,
l. name, address, phone, city, state, zip). So, if someone fills out f.
name, l. name, phone, but haven't gotten to city, state and zip yet; I'd
like to know if there's a way to know what text controls ABOVE the cursor
haven't been filled-out, but not below?

So, if I've gotten half way thru the tab order, and left blank 2 fields, I
want them to be high-lighted to show they're empty, but not the fields that
I haven't gotten to yet?

Thanks!
Dave

I think I would tackle this by capturing EVT_SET_FOCUS / EVT_KILL_FOCUS for all the text boxes. I can't find a GetFocus function, and anyway, it would need to be called from some event or other; the focus change events sound perfect.

wx.Window.FindFocus() will give you with widget that currently has the focus.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!