And there is a similar example works with the database?
Code: Select all
FUNCTION XSample_175()
/*
This sample shows how to use checkbox bitmaps
to provide the ability to check and uncheck
items in a browse.
*/
LOCAL GetList[0], oBrowse, aDir, n := 1, GetOptions
aDir := Directory()
FOR n := 1 TO Len(aDir)
AAdd(aDir[n],.f.)
NEXT
n := 1
@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 80,12 ;
PRESENTATION DC_BrowPres() FIT ;
POINTER n ;
MARK 11
DCBROWSECOL DATA {|x|x:=DC_GetColArray(11,oBrowse), ;
IIF(x,BITMAP_CHECKBOX_CHECKED_S,BITMAP_CHECKBOX_UNCHECKED_S)} ;
PARENT oBrowse HEADER 'Sel' WIDTH 1 ;
TYPE XBPCOL_TYPE_BITMAP ;
EVAL {|oB|oB:dataArea:lbClick := {|a,b,o|IIF(oBrowse:colPos=1,(aDir[n,11]:=!aDir[n,11],oBrowse:refreshCurrent()),nil)}}
DCBROWSECOL ELEMENT 1 PARENT oBrowse HEADER 'Name' WIDTH 10
DCBROWSECOL ELEMENT 2 PARENT oBrowse HEADER 'Size' WIDTH 8
DCBROWSECOL ELEMENT 3 PARENT oBrowse HEADER 'Date' WIDTH 8
DCBROWSECOL ELEMENT 4 PARENT oBrowse HEADER 'Time' WIDTH 8
DCGETOPTIONS AUTORESIZE
DCREAD GUI FIT ADDBUTTONS MODAL ;
OPTIONS GetOptions ;
TITLE 'Click in CheckBox to Select/Unselect'
RETURN aDir
*** END OF EXAMPLE ***