Using 'Protect' in a Browse
Posted: Mon Sep 20, 2010 8:43 pm
I am trying to protect an item in a browse.
If an unprotected cell is edited and the up or down arrow moves to the protected cell it can then be edited.
When up/down leaves the protected cell, the focus goes to the bottom cell in the browse.
What am I missing, please.
Thanks, GeneB
If an unprotected cell is edited and the up or down arrow moves to the protected cell it can then be edited.
When up/down leaves the protected cell, the focus goes to the bottom cell in the browse.
What am I missing, please.
Thanks, GeneB
Code: Select all
FUNCTION Test()
local nPointer, aList, oBrowse, oFrame
aList := { {11,"Unknown"} ;
, {12,"Chain"} ;
, {13,"Bulb"} ;
, {14,"Glass"} ;
, {15,"Wire"} ;
, {16,"Parts"} }
@ 0,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX ;
SIZE 100,25 ;
OBJECT oFrame
@ 2,2 DCBROWSE oBrowse PARENT oFrame ;
DATA aList SIZE 31,21 ;
FREEZELEFT {1,2} ;
POINTER nPointer ;
EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITDOWN
DCBROWSECOL ELEMENT 1 HEADER "Num" PARENT oBrowse WIDTH 4 ;
PROTECT {|| .T.}
DCBROWSECOL ELEMENT 2 HEADER "Name" PARENT oBrowse WIDTH 13 ;
PROTECT {|| ListProtect(aList[nPointer,1]) }
DCREAD GUI FIT
RETURN NIL
STATIC FUNCTION ListProtect(nNum)
IF nNum = 13
RETURN .T.
ENDIF
RETURN .F.