CANCEL en tsbutton 7.0, no funciona

Post Reply
User avatar
noe aburto
Posts: 418
Joined: Wed Nov 26, 2008 6:33 pm
Location: Morelia, Mich. Mexico.

CANCEL en tsbutton 7.0, no funciona

Post by noe aburto »

Saludos.

habia dejado este detalle al olvido, pero si alguien ha resuelto el problema del la clausula CANCEL en el sbrowse 7.0
y si lo pudiera compartir.

Caso.

@ 11,10 SBUTTON oBtn[1] PROMPT '&Aceptar' RESOURCE 'GOSEMA','GOSEMV' OF oDLG(1);
ACTION ( lSalir:=ValidaVent(aVent),; // valida que los gets se cumplan
IF( lSalir,;
( _lSalvar:=.T.,;
AfectaDBF(aVent,lBloquea,bProceso),;
NIL) );
XP COLOR COLOR_ACEPTA;
SIZE 33,12 TEXT POSITION 4;
PIXEL

@ 11,100 SBUTTON oBtn[2] PROMPT '&Cancelar' RESOURCE 'GOSEMN','GOSEMR' OF oDLG(1);
ACTION ( lSalir:=.t., _lSalvar:=.F.,;
AfectaDBF(aVent,lBloquea,bProceso) ),;
XP COLOR COLOR_CANCELA;
SIZE 33,12 TEXT POSITION 4;
PIXEL CANCEL /////// aqui el detalle///////

al presionar el boton "cancelar", este no pierde el foco, me sigue avisando de los gets que debo validar.
esto no lo hacia en la version 4.0
Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
User avatar
noe aburto
Posts: 418
Joined: Wed Nov 26, 2008 6:33 pm
Location: Morelia, Mich. Mexico.

Re: CANCEL en tsbutton 7.0, no funciona

Post by noe aburto »

Expongo una diferencia entre las versiones 4 y 7 en el segundo return (x) cambia

version 7 ***************************************************************************************
METHOD GetDlgCode( nLastKey ) CLASS TSButton

If nLastKey > 0 .and. nLastKey == ::nWakeup
::nWakeup := 0
EndIf

If ( ! ::oWnd:lValidating .and. ::lCancel .and. ::cAccel != Nil .and. GetAsyncKey( VK_MENU ) .and. ;
GetAsyncKey( Asc( Upper( ::cAccel ) ) ) .and. ::nWakeup == 0 )

::SendMsg( FM_CLICK )
Return 1
ElseIf (! ::oWnd:lValidating .and. ::lWhen .and. !::lCancel .and. ::cAccel != Nil .and. ;
GetAsyncKey( VK_MENU ) .and. GetAsyncKey( Asc( Upper( ::cAccel ) ) ) .and. ::nWakeup == 0 )

::SendMsg( FM_CLICK )
Return NIL ////////////// aqui /////////////////
EndIf

Return If( ::lActive, DLGC_WANTALLKEYS, Nil )

version 4****************************************************************************************************
METHOD GetDlgCode( nLastKey ) CLASS TSButton

If nLastKey > 0 .and. nLastKey == ::nWakeup
::nWakeup := 0
EndIf

If ( ! ::oWnd:lValidating .and. ::lCancel .and. ::cAccel != Nil .and. GetAsyncKey( VK_MENU ) .and. ;
GetAsyncKey( Asc( Upper( ::cAccel ) ) ) .and. ::nWakeup == 0 )

::SendMsg( FM_CLICK )
Return 1
ElseIf (! ::oWnd:lValidating .and. ::lWhen .and. !::lCancel .and. ::cAccel != Nil .and. ;
GetAsyncKey( VK_MENU ) .and. GetAsyncKey( Asc( Upper( ::cAccel ) ) ) .and. ::nWakeup == 0 )

::SendMsg( FM_CLICK )
Return 1 ////////////// aqui /////////////////
EndIf

Return If( ::lActive, DLGC_WANTALLKEYS, Nil )
Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: CANCEL en tsbutton 7.0, no funciona

Post by Antonio Linares »

Noé,

Por favor prueba a añadir TSBUTTON a esta lista de nombres de Clases en control.prg Método KillFocus():

Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TBUTTONBMP;TBTNFLAT" .and. ;
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
noe aburto
Posts: 418
Joined: Wed Nov 26, 2008 6:33 pm
Location: Morelia, Mich. Mexico.

Re: CANCEL en tsbutton 7.0, no funciona

Post by noe aburto »

Antonio Linares.
Gracias por la solución.
Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
Post Reply