Page 1 of 1

Marking browse row

Posted: Fri Oct 21, 2011 12:57 am
by c-tec
Hello,
I have a customer that need to select records in the browser like MS standard, that means:
CTRL+left mouse = mark single record
SHIFT+left mouse = mark from previous selected record to actual record
For now I use itemmarked and an array of the last marked records, I shift the last marked record, that works so far. But how can I check in the itemmarked codeblock which key is actually pressed ? I need to check if CTRL or Shift is pressed when the record is marked.
Or is there a easier way in a browse handler function ?
regards
Rudolf


Code: Select all


aRecord := {0,0}
...
ITEMMARKED {||_dbfeditmark(oBrowse,getlist,@aRecord)}


static function _dbfeditmark(oBrowse,getlist,aRecord)
******************************************************************
if db->(recno()) # aRecord[1]
     aRecord[2] := aRecord[1]
     aRecord[1] := db->(recno())
endif
dcqdebug aRecord
return .t.


Re: Marking browse row

Posted: Fri Oct 21, 2011 3:51 am
by skiman
Rudolf,

See the tagging sample. It's all there.

Re: Marking browse row

Posted: Fri Oct 21, 2011 4:07 am
by c-tec
Hello,
thank you, have solved it with RBDOWN and appkeystate()
regards
Rudolf