Consulta Tsbutton y Cancel nuevamente

Consulta Tsbutton y Cancel nuevamente

Postby devwin2004 » Mon Jan 30, 2006 8:46 pm

Estimados Colegas

Les hago una consulta con respecto a tsbutton y cancel, Como puedo hacer cuando presiono el boton me salte el valid y me ejecute la funcion local, estoy trabajando con FW 2.4 Clipper y tsbutton 4 o 5 , les adjunto el codigo ahora cuando presiono el codigo me ejecuta busdeli del valid y luego local

desde ya muchisimas gracias
Dante
devwin2004@yahoo.com.ar



@ 1.2,05.8 GET otelefo VAR xtelefo OF oDlgd size 60,15 font oFontb Picture '9999999999' ;
Valid busdeli (xtelefo,Odlgd,otelefo,nkey,xturno,xadicion,TIEMPO)



@ 11.0,277 SBUTTON b2 of oDLgd Cancel FILENAME "NEW1.BMP" size 24,24 pixels TEXT ON_BOTTOM NOBOX COLOR CLR_NBLUE,CLR_6 action local(xtelefo,Odlgd,otelefo,olbx1)


@ 34, 275 SAY "Procesado" OF oDlgD SIZE 35,10 PIXEL ;
FONT oFontC COLOR CLR_BLACK,CLR_6
devwin2004
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am

Postby Joel Andujo » Mon Jan 30, 2006 9:34 pm

Dante tienes que modificar el Método KillFocus de la clase tControl
agrega el string TSButton como en este ejemplo :

Saludos
Joel Andujo

Code: Select all  Expand view
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 )
User avatar
Joel Andujo
 
Posts: 130
Joined: Fri Oct 07, 2005 3:14 pm
Location: Cd. Obregón, Sonora, México

Postby devwin2004 » Wed Feb 01, 2006 5:09 pm

Gracias Joel

Funciona a la perfeccion

Dante
devwin2004@yahoo.com.ar
devwin2004
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests