xbrowse problem with :bLClicked
Posted: Sun Apr 21, 2024 7:09 pm
i have a xbrowse with :SetMultiSelectCol()
with bRClicked I associated a menupopup
with :bLClicked I click on a row and select it I made the same with :bKeyChar ( space button)
but if I use the mouse in the first column the system works, that is, if there are still records selected it does not change the buttonbar menu, if I use the space bar to deselect or select a record it puts the buttonbar buttons back on without checking if there are other records selected
yet I put this command for spacebar
when I select a row the procedure change the options of buttonbar ( see samples\barchange.prg)
if I click twice it opens to edit the record
However, it happens that if I have selected two or more records and deselect only one, the procedure returns the buttonbar buttons to their initial state even if there are actually still two records selected
what happens is that if I click twice it selects the record and at the same time it goes to edit the record and it doesn't go well
with bRClicked I associated a menupopup
with :bLClicked I click on a row and select it I made the same with :bKeyChar ( space button)
Code: Select all | Expand
:bLClicked := { |r,c,f,oBrw| if( oBrw:Mousecolpos( c ) == 1, ;
( if( ( f := AScan( oBrw:aSelected, oBrw:BookMark ) ) == 0, ;
( AAdd( oBrw:aSelected, oBrw:BookMark ), ;
if( Len( oBrw:aSelected ) = 1, Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw), ) ), ;
( ADel( oBrw:aSelected, f, .t. ), ;
if( LEN(oBrw:aSelected)==0, Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw), )) ), ;
Refresh_title(oBrw,oDlg,oDbf,cTitle),;
oBrw:RefreshCurrent() ), ) }
but if I use the mouse in the first column the system works, that is, if there are still records selected it does not change the buttonbar menu, if I use the space bar to deselect or select a record it puts the buttonbar buttons back on without checking if there are other records selected
yet I put this command for spacebar
Code: Select all | Expand
:bKeyChar := {| k | (If( k == VK_SPACE,(IIF( oBrw:IsSelectedRow(),;
Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw,aBtnBrow[4]), ;
IIF(LEN(oBrw:aSelected)==0, Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw,aBtnBrow[4]),) )), nil),;
Refresh_title(oBrw,oDlg,oDbf,cSection))}
if I click twice it opens to edit the record
Code: Select all | Expand
// from 2column
FOR i := 2 TO Len( oBrw:aCols )
oCol := oBrw:aCols[ i ]
oCol:bLDClickData := {|| Edit_Comuni(oBrw,2,oDlg,oDbf,aBtnBrow[4]) }
NEXT
what happens is that if I click twice it selects the record and at the same time it goes to edit the record and it doesn't go well