Valid , sbutton Cancel no me funciona

Valid , sbutton Cancel no me funciona

Postby Databaselab2002 » Mon Jan 16, 2006 12:24 am

Estimado Colegas

Como puedo hacer que me funcione cancel de sbutton y no que me
ejecute la funcion del valid,

Muchas Gracias
Fabian
Databaselab2002@yahoo.com.ar



@ 0.8,09 Get mg2 var xmesa Of oDlg size 40,30 font oFont Picture "999" Valid busmes((xmesa,Odlg,mg2,nkey,xturno,xadicion),.t.) && update


@ 0.8 , 16+20 sbutton b2 FILENAME "ok1.bmp" size 24,24 OF oDlgd cancel TEXT ON_BOTTOM NO BOX action local(xtelefo,Odlgd,otelefo,olbx1)
Databaselab2002
 
Posts: 142
Joined: Sun Oct 09, 2005 1:36 am

Postby karinha » Mon Jan 16, 2006 11:05 am

@ 0.8 , 16+20 sbutton b2 FILENAME "ok1.bmp" size 24,24 OF oDlgd ;
TEXT ON_BOTTOM NO BOX action local( (xtelefo,Odlgd,otelefo,olbx1), oDlgD:End() ) CANCEL
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7292
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Joel Andujo » Mon Jan 16, 2006 4:21 pm

Fabian vas a tener que modificar la clase Control el método KillFocus agrega TSButton como en este ejemplo :

METHOD KillFocus( hCtlFocus ) CLASS TControl

local oWnd

if ! Empty( hCtlFocus ) .and. ::bValid != nil .and. WndParents( hCtlFocus, ::hWnd ) .and. ;
( oWnd := oWndFromhWnd( hCtlFocus ) ) != nil .and. ;
Upper( oWnd:Classname() ) $ "TBUTTON;TBTNBMP;TSBUTTON" .and. ;
( oWnd:lCancel != nil .and. oWnd:lCancel .and. ;
( ::oWnd:nLastKey != VK_TAB .and. ::oWnd:nLastKey != VK_RETURN .and. ;
::oWnd:nLastKey != VK_DOWN .and. ::oWnd:nLastKey != VK_UP ) ) // JAAM Agregue ";TSBUTTON" para que le haga caso a
::oWnd:lValidating = .t. // la clusula CANCEL en los botones
::oWnd:nLastKey := 0
::ForWhen()
::oWnd:lValidating = .f.
::LostFocus()
return nil
else
if Upper( GetClassName( hCtlFocus ) ) == "TBTNBMP"
::oWnd:nLastKey := 0 // it fixes TBtnBmp CANCEL clause
endif
endif

// in FiveWin++ lValidating comes as nil sometimes
if ! Empty( hCtlFocus ) .and. ( ::oWnd:lValidating == nil .or. ! ::oWnd:lValidating ) ;
.and. IsWindowVisible( ::oWnd:hWnd ) .and. WndParents( hCtlFocus, ::hWnd )
PostMessage( ::hWnd, FM_LOSTFOCUS, hCtlFocus )
endif

return ::LostFocus( hCtlFocus )

Saludos
Joel Andujo
User avatar
Joel Andujo
 
Posts: 130
Joined: Fri Oct 07, 2005 3:14 pm
Location: Cd. Obregón, Sonora, México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 10 guests