dBASE Programming - Tab Order

This is Interesting: Free IT Magazines  
Home > Archive > dBASE Programming > May 2005 > Tab Order





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Tab Order
john noble

2005-05-19, 7:47 am

On most of my forms I am able to continually tab to all available controls in a cycle. ie start at first control that can have focus then finish at last control. Press tab again and the process begins all over again.

However on one of my forms the process mentioned above does not repeat when I come to the final control that can acquire focus. It just stays there when I press tab.

I have tried to firstcontrol.setfocus() from the last control's onlostFocus event but it still will not budge.

Can anyone advise,

Thanks,

John
*Lysander*

2005-05-19, 5:50 pm

In article <l7vSEQGXFHA.1760@news-server>, john@nor-tech.co.uk says...

> Can anyone advise,


Of what type is the 'last' control on this form, and of what type the=20
'first'??




--=20
ciao,
Andr=E9
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
European dBase-conference dBKonEurope :::: C A N C E L L E D ::::
English spoken conference around different database-topics
john noble

2005-05-19, 5:50 pm

*Lysander* Wrote:

> Of what type is the 'last' control on this form, and of what type the
> 'first'??
>

Both are buttons.

John
John Fried

2005-05-19, 5:50 pm

Since you say the last control is a pushbutton, I'd have a close look at
any methods attached to it (or its parent if it is a custom control) --
especially onLostFocus or onClick. Sounds like _something_ is re-directing
focus or preventing the last control to lose focus.

John

john noble wrote:
>
> However on one of my forms the process mentioned above does not repeat when I come to the final control that can acquire focus. It just stays there when I press tab.
>
> I have tried to firstcontrol.setfocus() from the last control's onlostFocus event but it still will not budge.

john noble

2005-05-20, 7:49 am

John Fried Wrote:

> Since you say the last control is a pushbutton, I'd have a close look at
> any methods attached to it (or its parent if it is a custom control) --
> especially onLostFocus or onClick. Sounds like _something_ is re-directing
> focus or preventing the last control to lose focus.
>
>

Hello John,

The pushbuton in question has a original on_lostfocus event attached to it that changes the colour of the button when focus is removed. However I have overriden this event and added a second line of code that should set focus to btnADD (the first button i
n the z-order).

While overriding the event I still place a call to change colour as follows:


function BTNEXIT_onLostFocus
NPOBTN::PUSHBUTTON1_onLostFocus() // call to original event
form.btnadd.setfocus() // needed to set focus to first button on zorder
return

The colour changes as expexted i.e. the call to
*Lysander*

2005-05-23, 5:53 pm

In article <WvOsXpTXFHA.1528@news-server>, john@nor-tech.co.uk says...
> John Fried Wrote:


> form.btnadd.setfocus() // needed to set focus to first button on zo=

rder

Maybe I did not understand.
If your "last button" is already the last control on the form in Z-
order, focus must automatically go to the first element in z-order.
Why then do you need, in the onlostfocus-event, an additional method to=20
put focus on the first element?

If I misunderstood, and you want to set focus not on the first element=20
in z-order but to another one which looks like the first, check what is=20
happening in all events for the control which really is the next in line=20
after your "last button".

maybe this sounds strange, but did you also check if INDEED this object =20
exists, is visible and enabled? Sometimes the strangest problems happen=20
because of such small things.

inspect(form.btnadd) should help you to find out.
Also, if it still DOES exist and does not have an overridden name-
property or something, check if this control has some unexpected change=20
of tabstop-property or speedbutton-property.


--=20
ciao,
Andr=E9
*Lysander*

2005-05-23, 5:53 pm

In article <MPG.1cfc0cb6dd1201ab989787@news.dbase.com>,=20
nobody@nowhere.com says...

> of tabstop-property or speedbutton-property.


ouch!
speedbutton =3D speedbar
=20

--=20
ciao,
Andr=E9
John Fried

2005-05-25, 5:51 pm

It sounds like the onlostfocus event is setting focus back on itself. Does
the added form.btnadd.setfocus() work for you? I've done the same thing
myself on occasion.

John

john noble wrote:
>
> The pushbuton in question has a original on_lostfocus event attached to it that changes the colour of the button when focus is removed. However I have overriden this event and added a second line of code that should set focus to btnADD (the first button

in the z-order).
>
> While overriding the event I still place a call to change colour as follows:
>
> function BTNEXIT_onLostFocus
> NPOBTN::PUSHBUTTON1_onLostFocus() // call to original event
> form.btnadd.setfocus() // needed to set focus to first button on zorder
> return
>
> The colour changes as expexted i.e. the call to

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com