Page 1 of 1

logic value in txbrowse cell

Posted: Tue Feb 22, 2022 9:34 pm
by Detlef
Hi all,

I have an issue with a logic cell in my txBrowse.
Column 4 represents a field of type "L".

Code: Select all | Expand

WITH OBJECT oBrw:aCols[ 4 ]
      :SetCheck()
      :bLDClickData := { || pos->okay := !pos->okay, oBrw:Refresh() }  
END
 


Now I can toggle the cell value by doubleclick.
But I can't toggle with no keypress at all.

What do I miss?

Re: logic value in txbrowse cell

Posted: Tue Feb 22, 2022 9:51 pm
by Marc Venken
I use this to toggle a Logic field with F2 Key

oBrw[1]:bKeyDown := {| k | IF ( K == VK_F2, if(oBrw[1]:uitass:value = .f., oBrw[1]:uitass:Varput( .t. ), oBrw[1]:uitass:Varput( .F. ) ) , NIL ) }

Re: logic value in txbrowse cell

Posted: Tue Feb 22, 2022 11:22 pm
by Detlef
Thanks, Marc.
Your idea works for me.

Re: logic value in txbrowse cell

Posted: Wed Feb 23, 2022 12:34 am
by nageswaragunupudi

Code: Select all | Expand

WITH OBJECT oBrw:aCols[ 4 ]
      :SetCheck( nil, .t. )  // .t. means :nEditType := EDIT_GET
//      :bLDClickData := { || pos->okay := !pos->okay, oBrw:Refresh() }  // not required
END
 


Double click on cell automatically toggles the value.
If marqueestyle <= 4, <Space> key toggles the value.

Re: logic value in txbrowse cell

Posted: Wed Feb 23, 2022 10:10 am
by Detlef
Thanks for your suggests, Mr. Rao.
It works fine now.