by russimicro » Tue Dec 20, 2011 3:29 pm
// CAMBIOS EN LA CLASE DBCOMBO.PRG ... Y ME ESTA FUNCIONANDO
CLASS TDBCombo FROM TComboBox
DATA cSearchBackup // JOHNSON RUSSI - DIC 20 DE 2011
///
METHOD New( nRow, nCol, bSetGet, aItems, nWidth, nHeight, oWnd, nHelpId, ;
bChange, bValid, nClrFore, nClrBack, lPixel, oFont, ;
cMsg, lUpdate, bWhen, lDesign, acBitmaps, bDrawItem, ;
cAlias, cFldItem, cFldList, aList ) CLASS TDBCombo
DEFAULT cAlias := alias(), ;
cFldList := "", ;
cFldItem := "", ;
aList := {},;
aItems:= {}
::aList := aList
::aItems := aItems
::cAlias := cAlias
::cFldList := cFldList
::cFldItem := cFldItem
::cSearchKey:=""
::cSearchBackup :="" // JOHNSON RUSSI - DIC 20 DE 2011
METHOD KeyChar( nKey, nFlags) CLASS TDBCombo
local nNewAT := 0, nOldAT:=::nAT
::cSearchKey := ::cSearchBackup // JOHNSON RUSSI - DIC 20 DE 2011
// Incremental search
if nKey = VK_BACK // VK_BACK RESETEA L ABUSQUEDA , SE QUITA EL VK_SPACE , PARA PODER BUSCAR EN ORACIONES : "NOTA CREDITO" // JOHNSON RUSSI - DIC 20 DE 2011
::cSearchKey := ""
::cSearchBackup := "" // JOHNSON RUSSI - DIC 20 DE 2011
::Set( If( ValType( Eval( ::bSetGet ) ) == "N", 1, ::aItems[ 1 ] ) )
else
if nKey = 45 // CON EL SIGNO (-) BORRA ULTIMO CARACTER JOHNSON RUSSI - DIC 20 DE 2011
::cSearchKey := left(::cSearchKey,Len(::cSearchKey)-1)
else
::cSearchKey += upper(chr(nKey))
endif
::cSearchBackup := ::cSearchKey // JOHNSON RUSSI - DIC 20 DE 2011
nNewAT := ascan(::aList, {|x| subs(upper(x),1,len(::cSearchKey)) == ::cSearchKey} ) // JOHNSON RUSSI - DIC 20 DE 2011