Page 1 of 1
Busqueda incremental
Posted: Sat Apr 12, 2008 7:33 pm
by jaba
Antonio
Con mis buenos deseos para ti y para la gente del foro
Antonio Por favor como hago una busqueda incremental dese un listbox?
De antemano Gracias
Cordialmente
Jairo Barbosa
jejejejejej
Posted: Sat Apr 12, 2008 8:58 pm
by leandro
Que pena la demora.... pero aqui esta el codigo de una de las formas como lo hago yo...
Code: Select all
DEFINE DIALOG oDem11 RESOURCE "oDemu11" OF oWinp
REDEFINE BTNBMP oBsali ID 73 OF oDem11 FILENAME (oLamcla:iSali) NOBORDER ACTION oDem11:end()
REDEFINE GET oT1og1 VAR oT1vg1 ID 115 OF oDem11 ON CHANGE ( ::Assign(),;
IF(tCon->(DbSeek(AnsiToOem(Upper(SubStr(oT1vg1,1,::nPos-1))+;
Upper(Chr(nKey))))),(oT1oli:UpStable(),oT1oli:Refresh(),.t.),((""),.f.)))
SELE tConc
REDEFINE LISTBOX oT1oli VAR oT1vli;
FIELDS tConc->ACformat,tConc->ACconcep,tConc->ACnombre;
FIELDSIZES 50,50,150;
ID 110 OF oDem11;
HEADERS "Formato","Concepto","Nombre";
ON CHANGE pRefCon();
ON LEFT DBLCLICK (Grabar:="ModCon",pModCon())
oT1oli:nclrpane:=oLamcla:cComb
oT1oli:bKeyDown:={|nKey|iif(nKey==13,(Grabar:="ModCon",pModCon()),(" "))}
oDem11:cTitle := "Catálogo Conceptos"
ACTIVATE DIALOG oDem11
Mas tarde público la otra manera de hacerlo
Saludos
LEANDRO ALFONSO
Bogotá (Colombia)
Re: jejejejejej
Posted: Sun Apr 13, 2008 8:22 pm
by jaba
leandro wrote:
Que pena la demora.... pero aqui esta el codigo de una de las formas como lo hago yo...
Code: Select all
DEFINE DIALOG oDem11 RESOURCE "oDemu11" OF oWinp
REDEFINE BTNBMP oBsali ID 73 OF oDem11 FILENAME (oLamcla:iSali) NOBORDER ACTION oDem11:end()
REDEFINE GET oT1og1 VAR oT1vg1 ID 115 OF oDem11 ON CHANGE ( ::Assign(),;
IF(tCon->(DbSeek(AnsiToOem(Upper(SubStr(oT1vg1,1,::nPos-1))+;
Upper(Chr(nKey))))),(oT1oli:UpStable(),oT1oli:Refresh(),.t.),((""),.f.)))
SELE tConc
REDEFINE LISTBOX oT1oli VAR oT1vli;
FIELDS tConc->ACformat,tConc->ACconcep,tConc->ACnombre;
FIELDSIZES 50,50,150;
ID 110 OF oDem11;
HEADERS "Formato","Concepto","Nombre";
ON CHANGE pRefCon();
ON LEFT DBLCLICK (Grabar:="ModCon",pModCon())
oT1oli:nclrpane:=oLamcla:cComb
oT1oli:bKeyDown:={|nKey|iif(nKey==13,(Grabar:="ModCon",pModCon()),(" "))}
oDem11:cTitle := "Catálogo Conceptos"
ACTIVATE DIALOG oDem11
Mas tarde público la otra manera de hacerlo
Saludos
LEANDRO ALFONSO
Bogotá (Colombia)
/**************************************************
Leandro
Muy agradecido por tu respueta la estare probando, y pena me da a mi quitarte tiempo cuando se que tienes poco.
Cordialmente
Jairo Barbosa
Posted: Sun Apr 13, 2008 11:22 pm
by Antonio Linares
Aqui tienes un ejemplo:
Code: Select all
#include "FiveWin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),;
oSay:Refresh() }
@ 14, 2 SAY "Searching:" SIZE 60, 30
@ 14, 12 SAY oSay PROMPT cSearch SIZE 80, 30
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function Search( nKey, cSearch )
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
endif
Customer->( DbSeek( cSearch, .t. ) )
return nil
//----------------------------------------------------------------------------//
Posted: Tue Apr 15, 2008 11:45 pm
by jaba
Antonio Linares wrote:Aqui tienes un ejemplo:
Code: Select all
#include "FiveWin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBrw, hBmp := ReadBitmap( CurDir() + "\go.bmp" )
local oSay, cSearch := ""
USE ( CurDir() + "\Customer" ) VIA "DBFCDX"
if ! File( CurDir() + "\LAST.CDX" )
INDEX ON Customer->Last TO ( CurDir() + "\LAST" )
endif
Customer->( OrdSetFocus( "LAST" ) )
Customer->( DbGoTop() )
DEFINE WINDOW oWnd TITLE "IncSearch"
@ 1, 1 LISTBOX oBrw ;
FIELDS hBmp, Customer->Last, Customer->First ;
HEADERS "", "Last", "First" ;
SIZE 220, 167
oBrw:bKeyChar = { | nKey, nFlags | Search( nKey, @cSearch ), oBrw:Refresh(),;
oSay:Refresh() }
@ 14, 2 SAY "Searching:" SIZE 60, 30
@ 14, 12 SAY oSay PROMPT cSearch SIZE 80, 30
ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )
return nil
//----------------------------------------------------------------------------//
function Search( nKey, cSearch )
if nKey = 8
cSearch = SubStr( cSearch, 1, Len( cSearch ) - 1 )
else
cSearch += Upper( Chr( nKey ) )
endif
Customer->( DbSeek( cSearch, .t. ) )
return nil
//----------------------------------------------------------------------------//
Antonio
Expreso mi agradecimiento a ti y a Leandro por su colaboracion
Funciona Ok
Cordialmente
Jairo Barbosa