Quantcast
Channel: FiveTech Software tech support forums
Viewing all articles
Browse latest Browse all 27092

Valid y When

$
0
0
Este Ejemplo me funciona bien para el Valid, porque en función de lo que devuelva, (.t.) o (.f.), la función KeyBoardEvents() detiene la aplicación, pero pierdo el control con el ratón y me gustaría en la función KeyBoardEvents() asignarle al ENTER que funcionará como el TAB, Saludos #include "FiveTouch.ch" function Main() local oDlg, oGet1, cTest local oBtnOk, oBtnCancel DEFINE DIALOG oDlg @ 20, 20 GET oGet1 VAR cTest OF oDlg SIZE 100, 20 oGet1:connect( QEvent_KeyPress , { |e| KeyBoardEvents( e, cTest ) } ) //QEvent_KeyPress -- viene de Hbqtgui.ch @ 200, 90 BUTTON oBtnOk PROMPT "Ok" OF oDlg ; ACTION MsgInfo( "Ok!" ) @ 200, 220 BUTTON oBtnCancel PROMPT "Cancel" OF oDlg ; ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTERED return nil //--------------------------------------------------- Function KeyBoardEvents( e, cText ) LOCAL lSalida := .T. LOCAL nKey := e:key() // (.T.) No Permite Continuar // (.F.) Permite Continuar Do Case Case nKey == Qt_Key_Return .OR. nKey == Qt_Key_Enter MsgInfo('Enter') lSalida := .F. Case nKey == Qt_Key_Tab MsgInfo('Tab') lSalida := .F. Case nKey == Qt_XButton1 MsgInfo('Mouse') lSalida := .F. Case nKey == Qt_Key_F1 MsgInfo('F1') lSalida := .T. EndCase Return( lSalida )

Viewing all articles
Browse latest Browse all 27092

Trending Articles