I am using an array in Xbrowse to enable/disable checkbox(BitMap).
IF oRecSetUserPermission:Fields("Menu_Type"):Value=='S' When this Condition if true i want to
Disable CheckBox else i want to enable checkbox(BitMap).When this code is Executed i am Getting a error.
Error:Method valid only for Logical operator is Displayed in MsgBox .
after that Menu is Displayed in x Browse but Status is not Displayed.
Version used FWH(9.04)
Code: Select all
@0,30 XBROWSE oBrw OF oDlg ;
LINES CELL ;
Size 400,600 ;
FONT oFontGet ;
COLUMNS 1,2 ;
Headers "Menu","Status"
oBrw:nMarqueeStyle := 6
oBrw:nRowDividerStyle := LINESTYLE_NOLINES
oBrw:nColDividerStyle := LINESTYLE_NOLINES
oBrw:nHeaderHeight := 38
oBrw:nRowHeight := 20
oBrw:lColDividerComplete := .T.
aClrCol :={ { 0, nRGB(192,221,255) }, { 0, nRGB(221,245,255) } }
oBrw:bClrStd := { || aClrCol[ oBrw:KeyNo % 2 + 1 ] }
oBrw:bClrHEADER := {|| { CLR_BLUE, CLR_WHITE } }
oBrw:l2007 := .T.
// aadd( aArray1,{"",.F.} )
WHILE !oRecSetUserPermission:BOF() .AND. !oRecSetUserPermission:EOF()
//oRecSetUserPermission( RecordSetObject)
IF oRecSetUserPermission:Fields("Menu_Type"):Value=='S'
aadd( aArray1,{oRecSetUserPermission:Fields("Menu"):Value,nil} )//Disable Check List
ELSE
aadd( aArray1,{oRecSetUserPermission:Fields("Menu"):Value,.F.} )//Enable
END IF
oRecSetUserPermission:MoveNext()
END
oBrw:SetArray(aArray1)
oBrw:CreateFromCode()
oBrw:aCols[1 ]:cHeader := "Menu"
oBrw:aCols[1 ]:nWidth :=300
oBrw:aCols[2 ]:cHeader := "Status"
oBrw:aCols[2 ]:SetCheck( {"on.bmp","off.bmp"}, {|o,u| o:Value( u ) } )
oBrw:aCols[2 ]:bStrData := {|| NIL }
oBrw:aCols[2 ]:lBmpTransparent:= .f.
//xBrwAdoSettings(oBrw,oRecSetUserPermission)
oDlg:oClient:=oBrw
oBrw:Refresh()
oDlg:Refresh()
RETURN oBrw
sajith