FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour DBCombo: pequeñas correcciones
Posts: 211
Joined: Wed Jul 16, 2008 12:59 PM
DBCombo: pequeñas correcciones
Posted: Wed Sep 03, 2008 09:15 PM
Hola amigos del foro:

Al usar el DBCombo me salia error de "Tipo de Dato" despues de hacer un "Incremental Search", por lo que tuve que modificar nuevamente el metodo KeyChar(..) de la clase; y quedo asi:

METHOD KeyChar( nKey, nFlags) CLASS TDBCombo

   local nNewAT := 0, nOldAT:=::nAT

   // Incremental search
   if nKey = 32   // space resets the search
      ::cSearchKey := ""
      ::Set( If( ValType( Eval( ::bSetGet ) ) == "N", 1, ::aItems[ 1 ] ) ) //<- RSU:  Aqui el cambio!!!!
   else
      if nKey = VK_BACK
         ::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
      else
         ::cSearchKey += upper(chr(nKey))
      endif

      nNewAT := ascan(::aList, {|x| upper(x) = ::cSearchKey} )

      if nNewAt != nOldAt .and. nNewAT != 0  // If found and changed

         if ::lSound
            tone(60,.3) // sound if searchkey found
         endif

         ::Set( If( ValType( Eval( ::bSetGet ) ) == "N", nNewAt, ::aItems[ nNewAt ] ) ) //<- RSU:  Aqui el cambio!!!!

         if ::bChange != nil

            if ::oGet != nil                        // Always not nil for dropdown
               ::oGet:VarPut( Eval( ::bSetGet ) )   // udate variable before calling bChange
               ::oGet:Refresh()
            endif

            Eval( ::bChange, Self, ::varGet() )

         endif

         return 0 //<- RSU: Aqui el cambio!!!!

      else
         ::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
      endif
   endif

   Super:KeyChar(nKey, nFlags)

RETURN 0   // Must be 0 - We don't want API default behavior.


Espero les sirva ...

Saludos

Rolando Salazar
Sauro Srl.
Informática y Sistemas
Cochabamba - Bolivia
FWH 8.02 xharbour 1.1.0 (SimpLex)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
DBCombo: pequeñas correcciones
Posted: Mon Sep 08, 2008 11:25 PM

Rolando,

Implementado, gracias! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion