Problem with focus

Post Reply
Dorneles
Posts: 30
Joined: Mon Oct 30, 2006 2:39 pm
Location: Brasil

Problem with focus

Post by Dorneles »

Code: Select all

   REDEFINE GET oGetItem.it_codbarra   VAR aGetItem.it_codbarra   ID 4005 OF oDlgM PICTURE "@!"   WHEN (lDisableI .AND. vModo = "I" .AND. EMPTY(aGetItem.it_codbarra))  VALID AchaProduto(@aGetItem,@oGetItem,1)
   REDEFINE GET oGetItem.it_id_comanda VAR aGetItem.it_id_comanda ID 4002 OF oDlgM PICTURE "@!"   WHEN (lDisableI .AND. vModo = "I" .OR. vModo = "A" )  VALID AchaComanda(aGetCli)
   REDEFINE GET oGetItem.it_nm_produto VAR aGetItem.it_nm_produto ID 4008 OF oDlgM PICTURE "@!"   NO MODIFY UPDATE color nRGB( 000, 070, 180 ),nRGB( 255, 255, 255 )
   REDEFINE GET oGetItem.it_quantidade VAR aGetItem.it_quantidade ID 4014 OF oDlgM PICTURE "999,999.999"   WHEN IF(vmodo = "I",(lDisableI  .AND. EMPTY(aGetItem.it_quantidade)),lDisableI) VALID FTotProd(@aGetCli,2)
   REDEFINE GET oGetItem.it_prunitario VAR aGetItem.it_prunitario ID 4016 OF oDlgM PICTURE "999,999.999"   WHEN .F. //lDisableI VALID aGetItem.vlunit_ped > 0
   REDEFINE GET oGetItem.it_prtotal    VAR aGetItem.it_prtotal    ID 4007 OF oDlgM PICTURE "999,999.999"   WHEN .F. color nRGB( 000, 070, 180 ),nRGB( 255, 255, 255 )

	REDEFINE BUTTON oBtn1 ID 702 OF oDlgM WHEN (!EMPTY(aGetItem.it_quantidade)) ACTION (GravaProduto(aGetCli,oGetCli,aGetItem,vModo,@nRegi),oGetItem.it_codbarra:SetFocus()) UPDATE
   REDEFINE BUTTON       ID 701 OF oDlgM ACTION (CancelaIt(oGetCli,@aGetCli,@lSaidaM,@lBotaol),oDlgM:End()) UPDATE CANCEL
What can this wrong, the focus needs to go to oGetItem.it_codbarra
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

ACTIVATE DIALOG oDlgM ON INIT ( oGetItem.it_codbarra:SetFocus(), .F. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Dorneles
Posts: 30
Joined: Mon Oct 30, 2006 2:39 pm
Location: Brasil

Post by Dorneles »

Very thankful!

And to force the focus go to the object after using a FUNCTION GRAVAPRODUTO()

Code: Select all

REDEFINE BUTTON oBtn1 ID 702 OF oDlgM WHEN (!EMPTY(aGetItem.it_quantidade)) ACTION (GravaProduto(aGetCli,oGetCli,aGetItem,vModo,@nRegi),oGetItem.it_codbarra:SetFocus()) UPDATE 

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

REDEFINE BUTTON oBtn1 ID 702 OF oDlgM WHEN (!EMPTY(aGetItem.it_quantidade)) ACTION (GravaProduto(aGetCli,oGetCli,aGetItem,vModo,@nRegi),oBtn1:oJump := oGetItem.it_codbarra ) UPDATE
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply