#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
@ <nRow>,<nCol> SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE
<nWidth>,<nHeight> PIXEL OF oDlg
//--------------------------------------------
#include "FiveWin.ch"
#include "xbrowse.ch"
REQUEST DBFCDX
function Main()
local oDlg, oBrw, oFont
CheckIndexes() // required only for this sample
USE CUSTOMER SHARED VIA "DBFCDX"
Customer->( OrdSetFocus( "FIRST" ) )
Customer->( DbGoTop() )
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-14
DEFINE DIALOG oDlg SIZE 600,600 PIXEL ;
TITLE "XBrowse Incremental Seek" ;
FONT oFont
@ 10,10 XBROWSE oBrw ;
SIZE 280,230 PIXEL ;
OF oDlg ;
ALIAS "CUSTOMER" ;
AUTOCOLS AUTOSORT LINES CELL
@ 250,10 SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 280,10 PIXEL OF oDlg ;
COLOR CLR_BLACK, CLR_YELLOW
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
//-----------------------------------------------------------------------------//
*
* following code is only for the sample
*
*
static function CheckIndexes()
local n
if File( "customer.cdx" )
FErase( "customer.cdx" )
endif
USE CUSTOMER EXCLUSIVE VIA "DBFCDX"
for n := 1 to FCount()
CreateTag( FieldName( n ) )
next
USE
return nil
//----------------------------------------------------------------------------//
static function CreateTag( ctag )
INDEX ON &ctag TAG &ctag
return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 104 guests