RE: getFocus & setFocus

new topic     » topic index » view thread      » older message » newer message

Ron Austin wrote:
> 
> 
> We have a program that has a main window, a listview window, a menu bar, 
> 
> a tool bar, 7 Tool tips,  7 labels and 7 EditText controls Data[1] thru 
> Data[7].  We want to change focus to the next EditText control when we 
> hit the Enter key or down arrow and change to the previous EditText 
> control when we hit the up arrow key.

After shuffling the controls around a little, I now have my 7 EditText 
controls giving me 14,12,11,10,9,8,7.  This is better.  If it wouldn't 
skip 13 I could deal with it.  I could deal with it anyway by making 
some sort of cross referrence table; 14=1, 12=2, etc, but I don't think 
I should have to.  How can I fix this?
> 
> This is working ok, so far.  We set pos=1 to begin with and then add or 
> subtract from it, being carefull not to go over 7 or under 1.
> 
> The problem comes in if someone uses the mouse to change the focus to 
> another control.  We tried using getFocus() but instead of returning a 
> nunmber from 1 to 7, it returns 7,5,4,19,34,33,32
> These controls were created one after the other.  Why don't it assign an 
> 
> id in assending sequential order?
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu