Re: dbcombo ( lostfocus no funciona ) NO RESUELTO

Re: dbcombo ( lostfocus no funciona ) NO RESUELTO

Postby Patricio Avalos Aguirre » Wed Dec 12, 2012 10:18 pm

Estimados

Por que en los dbcombo no funciona
bGotfocus no deja abrir los combos
bLostFocus no hace nada

en el ejemplo dbctest.prg

Code: Select all  Expand view  RUN
REDEFINE DBCOMBO oState VAR cState ID ID_STATE OF oClient ;
      ALIAS "STATES" ;
      ITEMFIELD "CODE" ;
      LISTFIELD "NAME"

    oState:bLostfocus := { || cTmp := cState }
    oState:bgotfocus := { || cTmp := cState }
 
Last edited by Patricio Avalos Aguirre on Mon Dec 17, 2012 7:59 pm, edited 1 time in total.
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: dbcombo ( lostfocus no funciona )

Postby karinha » Fri Dec 14, 2012 12:31 pm

Intenta con:

XFOCUS( oState )
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: dbcombo ( lostfocus no funciona )

Postby Patricio Avalos Aguirre » Fri Dec 14, 2012 1:32 pm

Hola

he solucionado el bGotfocus

Code: Select all  Expand view  RUN

    oState:bgotfocus := { || cTmp := cState, oState:SetFocus() }
 


pero blostfocus no hace nada

Code: Select all  Expand view  RUN
   oState:bLostfocus := { || cTmp := cState}
 
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: dbcombo ( lostfocus no funciona ) NO RESUELTO

Postby Patricio Avalos Aguirre » Mon Dec 17, 2012 7:53 pm

No funciona, estuve como 1 hora buscando el error, y era el

oState:bgotfocus := { || cTmp := cState, oState:SetFocus() }

cuando valida algo y este devuelve .f. queda en un bucle indefinidamente devolviendo .f., solo hay que cerrar el programa

le saque

//oState:bgotfocus := { || cTmp := cState, oState:SetFocus() }

funciona bien ahora
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: dbcombo ( lostfocus no funciona ) NO RESUELTO

Postby Patricio Avalos Aguirre » Tue Dec 18, 2012 7:42 pm

Hola

Aqui dejo posible correcion de lostfocus del dbcombo

Code: Select all  Expand view  RUN
METHOD LostFocus() CLASS TDBCombo

   local nAt := ::SendMsg( CB_GETCURSEL )

   if nAt != CB_ERR
      ::nAt = nAt + 1
      Eval( ::bSetGet, ::aItems[ ::nAt ] )
   else
      Eval( ::bSetGet, GetWindowText( ::hWnd ) )
   endif

//aqui se evalua el blostfocus
   if ! Empty( ::bLostFocus )
      return Eval( ::bLostFocus, Self, ::hWnd )
   endif
//fin modificacion

   ::cSearchKey:=""

return nil
 
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1060
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests