I need to edit a column under conditions
my code
oBrw:aCols[5]:nEditType := EDIT_GET
oBrw:aCols[5]:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, (IF(! DET->SDETAIL,EDITLU(v,OBRW,@TABPARAM,,LCOPY,LMODE,TABSEC,@TABTOT), ) ), ) }
oBrw:aCols[5]:beditwhen := {|o, v, n| IF(DET->SDETAIL,.F. , .T.) }
when i dbl click on the column (when not allowed to edit) it is ok nothing happens
if i press on the enter key twice i get the following message
ocol:aeditlisttxt not defined
fivewin class txbrwcolumn
any idea ?
solution in changing method keydown xbrowse.prg
case nKey == VK_RETURN
oCol := ::SelectedCol()
if oCol:oEditGet != nil
PostMessage( oCol:oEditGet:hWnd, WM_KEYDOWN, nKey ) //VK_RETURN )
elseif oCol:lEditable .and. ! oCol:hChecked .and. ::lEnterKey2Edit .and. ! ( oCol:nEditType == EDIT_LISTBOX .or. oCol:nEditType == EDIT_GET_LISTBOX )
return oCol:Edit()
elseif (oCol:nEditType != EDIT_LISTBOX .or. oCol:nEditType != EDIT_GET_LISTBOX) .AND. oCol:lEditable // chidiak
//Simulate Click over button for no lost focus
PostMessage( oCol:oBtnList:hWnd, WM_LBUTTONDOWN, 1, 1 )
PostMessage( oCol:oBtnList:hWnd, WM_LBUTTONUP, 1, 1 )
elseif ::oTreeItem!=nil
If( ::oTreeItem:oTree != nil,( ::oTreeItem:Toggle(), ::Refresh() ),)
else
::GoRight()
endif