it have some field as CveTab , Concep, desc, bitmap
On Field cveTab I insert only a Caracter and I set an array aKey:={"A","T","G","S"}
sample : all records have field CveTab="T" are types of customers
I want select a tab to select each group of records
I made a simply test but it not run ok
With the func ValPaint() I ordscope all record to --> aKey
- Code: Select all Expand view
#include "FiveWin.ch"
Stat oGrid,oTab,oDbf,aKey[4]
Function Test()
Local oDlg
Local nSplit:=00
Local aKey:={"A","T","G","S"}
use tabelle alias oDbf
Define dialog oDlg from 0,20 to 28,80
oGrid := TXBrowse():New( oDlg )
oGrid:nTop := 00
oGrid:nLeft := nSplit+2
oGrid:nBottom := 200
oGrid:nRight := 220
oCol:= oGrid:AddCol()
oCol:bStrData := { || oDbf->Concep} // 6
oCol:cHeader := "Codice"
oCol:nWidth := 100
oCol:= oGrid:AddCol()
oCol:bStrData := { || oDbf->Descri} // 50
oCol:cHeader := "Descrizione"
oCol:nWidth := 100
oCol:= oGrid:AddCol()
oCol:bStrData := { || oDbf->Bitmap} // 60
oCol:cHeader := "Descrizione"
oCol:nWidth := 160
oGrid:SetRDD()
oGrid:CreateFromCode()
@ oGrid:nBottom, nSplit+2 TABS oTab ;
OPTION nOrder SIZE oDlg:nWidth()-80, 12 PIXEL OF oDlg ;
ACTION ( nOrder := oTab:nOption ,;
oDbf->(DbSetOrder(nOrder)),;
oDbf->(DbGoTop()) ,;
oGrid:Refresh(.t.) )
oTab:aPrompts ={ "Banche","Tipo fornitore","Gradi","Squadra"}
activate dialog oDlg ON PAINT Val_Pant()
STAT FUNC Val_Pant()
LOCAL nF:=oTab:nOption
CursorWait()
odbf->(OrdScope(0,aKey[nF]))
oDbf->(OrdScope(1,aKey[nF]))
SysRefresh()
oGrid:GoTop()
oGrid:Refresh()
oGrid:SetFocus()
oTab:SetOption(nF)
CursorArrow()
RETURN (NIL)
here the test file sample : www.vdswin.it/tabelle.rar