focus problem

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

This is my EditText layout in a window.

ET1 ET2 ET3

ET4 ET5 ET6

ET7 ET8 ET9

What I want to do:

1. open window with ET1 in focus. (I know how to do that).

2. onKeyDown of ET1 I want focus to go to ET5 (not ET2).

3. onKeyDown of ET5 I want focus to go to ET9.

4. onKeyDown of ET9 I want focus to go back to ET1 and so on.

How can I do that?

I'm using the following code but it doesn't work.

 
procedure ET_onKeyDown (integer self, integer event, sequence params)--params is ( atom scanCode, atom shift ) 
   if params[1]	= 13 then 
      if self=ET1 then 
         setFocus(ET5) 
      elsif self=ET5 then 
         setFocus(ET9) 
      elsif self=ET9 then 
         setFocus(ET1) 
      end if 
end procedure 
setHandler({ET1,ET5,ET9} w32HKeyDown, routine_id("ETonKeyDown")) 
 
procedure Window1_onActivate (integer self, integer event, sequence params)--params is () 
   setFocus(ET1) 
end procedure 
setHandler( Window1, w32HActivate, routine_id("Window1_onActivate")) 

Don Cole

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

Search



Quick Links

User menu

Not signed in.

Misc Menu