1. Focus Problem

Hello Everybody,

My code:

constant pPriceET={EditText38,EditText39,EditText40}--placed in a column (column 1) 
constant pTotCostET{EditText48,EditText49,EditText50--these are placed to the right of pPriceET 
                                                    --(column 2) 
 
procedure on_key_down(integer self, integer event, sequence params)  
  integer a 
    a=0 
    if params[1]=13 then 
      while 1 do 
        a+=1 
           if a>3 then 
               a=1 
           end if 
       doEvents(0) 
       setFocus(pPriceET[a]) 
      end while 
    end if 
end procedure 
setHandler(pPriceET,w32HKeyDown,routine_id("on_key_down")) 
 

This works fine except after hitting EditText38, EditText48 blinks then EditText39 focuses

as it should. The same thing happens all the way down the righthand EditTexts blink.

I just want the pPriceET column to focus. I don't want to mess with the pTotCostET column,

What am I doing wrong?

Thank you,

Don Cole A Bug is an un-documentedfeature. A Feature is a documented Bug.

new topic     » topic index » view message » categorize

2. Re: Focus Problem

I don't quite understand what you're trying to accomplish here. Do you want focus to move down the first column, or jump across to the right column when the user hits Return? getlost

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Focus Problem

Hello Greg,

Everytime I enter a number in the left column I want the focus to jump down to the EditText under it. It does that except that it breifly focuses the EditText to it's right before going down there. I reality I have a lot more than 3 rows. I just symplfied it to 3.

1 4
2 5
3 6

I want it to go 1 , 2 , 3 not 1-4 , 2-5 , 3-6.

In focusing 4,5 and 6 it turns the EditText blue but it stays blue only for a micro second then it jumps down to the next row 1,2 or 3 turning that EditText blue and it stays that way until another input is made.

I hope this makes it clearer.

Thank you.

Don Cole A Bug is an un-documented feature. A Feature is a documented Bug.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Focus Problem

Don,

I think you would be better off using taborder and letting windows control all keys, not just the (13).

Mike

new topic     » goto parent     » topic index » view message » categorize

5. Re: Focus Problem

Mike777 said...

Don,

I think you would be better off using taborder and letting windows control all keys, not just the (13).

Mike

Thank you Mike,

But I don't follow you here. I can't find taborder anywhere.

Don Cole A Bug is an un-documentedfeature. A Feature is a documented Bug.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Focus Problem

I think it is part of Win32Lib. Sorry, but the actual command is setTabStops (taborder is used as a label in create forms).

Mike

new topic     » goto parent     » topic index » view message » categorize

7. Re: Focus Problem

Thanks Mike and Chris,

I finally figured it out.

This will jump down each row and focus it if something is inside.

No other EditTexts BLINK. My main problem before.

Also it will jump back to the top if it hits bottom.

Code if anybody is interested:

constant pPriceET={EditText1,EditText2,EditText3} 
constant pTotET={EditText4,EditText5,EditText6} 
 
procedure on_key_down(integer self, integer event, sequence params)  
      integer a,b 
             if params[1]=13 then 
                      a=find(getFocus(),pPriceET)    
                           if a=length(pPriceET) then--turn around if needed 
                               a=0 
                           end if 
                    while 1  do--before set focus be sure is not empty 
                        b= check_price_entry(pPriceET[a+1])--this checks if empty or not 
                           if b then  --not empty 
                               doEvents(0) 
                               setFocus(pPriceET[a+1]) 
                               exit 
                           else --yes empty go on to next one 
                               a+=1 
                                 if a=length(pPriceET) then--turn around if needed 
                                   a=0 
                                 end if 
                           end if 
                    end while 
              end if   
end procedure 
setHandler(pPriceET,w32HKeyDown,routine_id("on_key_down")) 
 
 

Don Cole A Bug is an un-documented feature. A Feature is a documented Bug.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu