but not run ok I wish show the number of records ( with the tooltip) when I use the incfilter search on xbrowse
#include "fivewin.ch"
#include "xBrowse.ch"
#define LIGHTCYAN nRGB( 203, 225, 252 )
#define MEM_FILE_USER "User.mem"
#define MEM_USER_SECTION "Browse"
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
static oTitle
static aFlds,aHdrs,nWild
function Main()
local oDlg, oGrid, oFont
local nOrder:= 1
local nRecno:= 1
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
USE CUSTOMER ALIAS CL
INDEX ON CL->FIRST TAG FIRST TO CUSTOMER
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -12
nWild := 2
aBrowse := { { { || CL->FIRST}, i18n("Cognome"), 150 },;
{ { || CL->LAST }, i18n("Nome"), 100 },;
{ { || CL->STREET }, i18n("Indirizzo"), 190 },;
{ { || CL->STATE}, i18n("Stato"), 145 } }
DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
FONT oFont TITLE 'Test '
oGrid := TXBrowse():New( oDlg )
oGrid:nTop := 30
oGrid:nLeft := 2
oGrid:nBottom := 200
oGrid:nRight := 320
FOR i := 1 TO Len(aBrowse)
oCol := oGrid:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
NEXT
oGrid:lIncrFilter := .t.
oGrid:lSeekWild := ( nWild == 2 )
oGrid:cFilterFld := "FIRST"
oGrid:SetRDD()
oGrid:CreateFromCode()
CL->(DbSetOrder(nOrder))
if nRecNo < CL->(LastRec()) .AND. nRecno != 0
CL->(DbGoTo(nRecno))
else
CL->(DbGoTop())
endif
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT( Create_bar(oDlg), Cerca_cliente(oTitle,"CL",oGrid) )
return nil
Function Create_bar(oDlg)
DEFINE BUTTONBAR oTitle _3D SIZE 44, 46 OF oDlg
return nil
Function Cerca_cliente(oTitle,cdbf,oGrid)
Local nLen := Len( oGrid:aCols )
Local n
Local oCbx
Local cCampo := oGrid:cFilterFld
/*
aFlds :=array( nLen )
aHdrs:= array( nLen )
FOR n = 2 TO nLen
aFlds [ n ]:= oGrid:aCols[ n ]:cExpr
aHdrs [ n ]:= oGrid:aCols[ n ]:cHeader
NEXT
*/
nWild := 2
cList := "FIRST,LAST,STREET,STATE"
aFlds := HB_ATokens( cList, ',' )
aHdrs := { i18n("Cognome") ,;
i18n("Nome") ,;
i18n("Indirizzo") ,;
i18n("Stato") }
@ 6.9, 10 COMBOBOX oCbx VAR cCampo ;
ITEMS aHdrs ;
ON CHANGE (oGrid:cFilterFld :=aFlds[ocbx:nat], oGrid:Seek( "" ), oGrid:SetFocus() ) ;
SIZE 150,400 PIXEL OF oTitle
@ 6.9, 190 COMBOBOX nWild ITEMS { "Voci che iniziano con..", "Voci che contengono...." } ;
ON CHANGE ( oGrid:lSeekWild := ( nWild == 2 ), ;
oGrid:Seek( If( oGrid:lSeekWild, oGrid:cSeek, "" ) ), ;
oGrid:SetFocus() ) ;
SIZE 150,400 PIXEL OF oTitle
/I wish change this into a get
@ 6.9,340 say oGrid:oSeek PROMPT oGrid:cSeek SIZE 180,20 PIXEL ;
OF oTitle COLOR CLR_BLACK,CLR_WHITE PICTURE '@!' BORDER
return nil