maudruidas Posted September 29, 2021 Report Share Posted September 29, 2021 Boa tarde, estou habilitando meu F2 da seguinte forma: SETKEY(VK_F2 , {|| LOCGRU(OGETG,DGRU,ODSGRU) }) até aí nenhum problema. Gostaria de saber como fazer para ativar este F2 apenas quando o usuário entrar no meu GET e quando sair desativar. Meu get: REDEFINE GET OGETG VAR GRU ID 105 OF ODLGMS FONT OFNC3 PICTURE "999" ; VALID FUNGRU(GRU,DGRU,ODSGRU,OGETG,"N") BITMAP "BUSCAR" ACTION(LOCGRU(OGETG,DGRU,ODSGRU)); WHEN (LETRA="I" .OR. LETRA="A") OGETG:lBtnTransparent := .t. // transparent button Fivewin for xHarbour 21.2 xHarbour 1.2.3 Intl. (SimpLex) (Build 20201212). Workshop. Quote Link to comment Share on other sites More sharing options...
macs Posted September 29, 2021 Report Share Posted September 29, 2021 OGETG:bGotFocus := { || SETKEY(VK_F2 , {|| LOCGRU(OGETG,DGRU,ODSGRU) }) } OGETG:bLostFocus := { || SETKEY(VK_F2 , NIL ) } Quote Link to comment Share on other sites More sharing options...
kapiaba Posted September 29, 2021 Report Share Posted September 29, 2021 REDEFINE GET aGet[10] VAR cTPSerCod PICTURE "@K !!!!" ID 21 OF oDlg ; UPDATE COLORS CLR_BLACK, CLR_WHITE FONT oFont BITMAP "BUSCAR" ; VALID( VERIFICA_COD_SERVICO( aGet, cTPSerCod ) ) ; ACTION( MOSTRAR_COD_SERVICO( aGet, cTPSerCod ) ) aGet[10]:cToolTip := OemToAnsi( "<F7> - Mostra o Tipo do Servi‡o" ) aGet[10]:lBtnTransparent := .T. // transparent button aGet[10]:bKeyDown := { |nKey| IF( nKey == VK_F2, Eval( aGet[10]:bAction ), Nil ) } Regards, saludos. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted September 29, 2021 Report Share Posted September 29, 2021 Não uso o setkey, faço assim: OGETG:bKeyDown := { |nKey| If(nKey=VK_F2, LOCGRU(OGETG,DGRU,ODSGRU),Nil) } Desta forma o F2 faz a chamada somente quando estiver no get, e ainda posso definir, funções diferente para cada get. Quote Link to comment Share on other sites More sharing options...
maudruidas Posted September 29, 2021 Author Report Share Posted September 29, 2021 Deu certo, muito obrigado. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.