Nages,
I create a Scroll Panel with some Objs and save the obj on adata array
To manage open a Xbrowse with aData
I wish erase the obj on TscrollPanel When Click (SetCheck) on one items on xbrowse except product number 1
and del item on adata and refresh the oBrw
how I can resolve ?
I Tried with ( but run bad)
FOR i := 1 TO LEN(oBrw:aCols)
oCol := oBrw:aCols[ i ]
oCol:bLDClickData := { || Erase_Items(oBrw,oPanel) }
NEXT
Function Erase_Items(oBrw,oPanel)
local nItem:= oBrw:aArrayData[ oBrw:nArrayAt ][2]
aDel(oBrw:aArraydata,nItem-1)
// xbrowser oBrw:aArraydata
oPanel:aControls[nItem]:destroy()
oBrw:refresh()
oPanel:refresh()
return nil
- Code: Select all Expand view
- Function Manage_Items(aData,oBrowse)
local oDlg
local oBar
local oFont
local oBold
local nWd := GetSysMetrics(0) * .30
local nHt := (GetSysMetrics(1) / 3.5 ) -20
local oBtn := array(3)
local aBmp:= {" ","elimina.bmp"}
local aCols := {}
For n= 1 to Len(aData)
If !aData[n][5]
else
AAdd( aCols, {aData[n][1],n,!aData[n][5]})
Endif
Next
DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL ; //TRUEPIXEL
TITLE "Products" ;
FONT oFont COLOR CLR_BLACK, RGB( 245,245,235) ;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX)
@ 10,10 XBROWSE oBrw SIZE -10,-20 PIXEL OF oDlg ;
DATASOURCE aCols ;
COLUMNS 1,3 ;
HEADERS "Descrizione","R" ;
COLSIZES 300, 40 ;
NOBORDER FONT oFONT
WITH OBJECT oBrw
:lHScroll:=.f.
:lRecordSelector:= .F.
:lDrawBorder := .t.
WITH OBJECT :aCols[ 2]
:SetCheck(aBmp, .t. )
:nHeadBmpNo := 2
END
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL