Code: Select all
DEFINE TIMER oTimer OF oWnd INTERVAL 5000 ACTION (oBrw:Refresh(.T.))
oBrw:Refresh( .T. ) = :Upstable() ? When the new record append, should it show on the Browse?
Regards,
Dutch
Code: Select all
DEFINE TIMER oTimer OF oWnd INTERVAL 5000 ACTION (oBrw:Refresh(.T.))
Code: Select all
#include "FiveWin.ch"
#include "xbrowse.ch"
function MAIN()
LOCAL AADBF := {}, ;
I := 0, ;
OBRW
REQUEST DBFCDX
Rddsetdefault( "DBFCDX" )
ERASE ("TEST.DBF")
ERASE ("TEST.CDX")
aADBF := {}
AADD(aADBF, {"NAME", "C", 40, 0 })
AADD(aADBF, {"NUMID", "N", 06, 0 })
DBCREATE("TEST", aADBF)
USE TEST NEW
INDEX ON NUMID TAG "NUMID"
INDEX ON NAME TAG "NAME"
TEST->(ORDSETFOCUS("NAME"))
FOR I = 1 TO 100
APPEND BLANK
REPLACE TEST->NUMID WITH I
REPLACE TEST->NAME WITH "NAME" + STR(I,3)
NEXT
TEST->(DBGOTOP())
DEFINE WINDOW oWnd FROM 0,0 TO 23,78
oBrw := TXBrowse():New( oWnd )
oBrw:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
oCol:=oBrw:AddCol()
oCol:bStrData:= {|| TEST->NAME }
oCol:cHeader := "Name"
ocol:nWidth := 200
oCol:bEditvalue := { || TEST->NAME }
oCol:nEditType := EDIT_GET
oCol:bonPostEdit := { | oCol, uValue, nLastKey | If( nLastKey == 13, (TEST->NAME := uValue , obrw:refresh()), nil ) }
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:SetRDD()
oBrw:bBookMark := {| n | iif( n == nil,TEST->(RecNo()), TEST->(dbgoto(n)) ) } // Required!
oBrw:CreateFromCode()
ownd:oClient := oBrw
ACTIVATE WINDOW OWND
TEST->(DBCLOSEAREA())
ERASE ("TEST.DBF")
ERASE ("TEST.CDX")
return nil
Code: Select all
oBrw := TXBrowse():New( oWnd )
oBrw:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }
oCol:=oBrw:AddCol()
oCol:bStrData:= {|| TEST->NAME }
oCol:cHeader := "Name"
ocol:nWidth := 200
oCol:bEditvalue := { || TEST->NAME }
oCol:nEditType := EDIT_GET
oCol:cSortOrder := "NAME"
oCol:bonPostEdit := { | oCol, uValue, nLastKey | If( nLastKey == 13, (TEST->NAME := uValue , obrw:refresh()), nil ) }
(TEST->NAME := uValue ), nil ) }
oBrw:SetRDD()
//oBrw:bBookMark := {| n | iif( n == nil,TEST->(RecNo()), TEST->(dbgoto(n)) ) } // Required! // NOT REQUIRED
Code: Select all
@ 0,0 XBROWSE oBrw COLUMNS "Name" ALIAS "TEST" COLOR CLR_BLUE,CLR_WHITE
oCol := oBrw:aCols[ 1 ]
oCol:nEditType := EDIT_GET
oCol:bonPostEdit := { | oCol, uValue, nLastKey | If( nLastKey == 13, ;
(TEST->NAME := uValue , obrw:refresh()), nil ) }