都让楼上两位说了,我来说说选中的问题:
实例变量:
boolean ib_action_on_buttonup = false
long il_LastClickedRow
dw clicked()事件
//////////////////////////////////////////////////////////////////////////////////////////////////
// Clicked script for dw_1
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
// This event will be the controlling event for all of the types of
// Highlighting that will be done.
//////////////////////////////////////////////////////////////////////////////////////////////////
string ls_KeyDownType
//////////////////////////////////////////////////////////////////////////////////////////////////
// First make sure the user clicked on a Row. Clicking on WhiteSpace
// or in the header will return a clicked row value of 0. If that
// occurs, just leave this event.
//////////////////////////////////////////////////////////////////////////////////////////////////
//check for a valid row
If row = 0 then Return
//case of select multiple rows range using the shift key
If Keydown(KeyShift!) then
wf_Shift_Highlight(row)
//In filemanager style, the click and ctrl-click events on a selected row take
//place on the button up event.
ElseIf this.IsSelected(row) Then
il_LastClickedRow = row
ib_action_on_buttonup = true
ElseIf Keydown(KeyControl!) then
// (CTRL KEY) keep other rows highlighted and highlight a new row or
// turn off the currint row highlight
il_LastClickedRow = row
this.SelectRow(row,TRUE)
//////////////////////////////////////////////////////////////////////////////////////////////////
// This event will be the controlling event for all of the types of
// Highlighting that will be done.
//////////////////////////////////////////////////////////////////////////////////////////////////
long ll_ClickedRow
string ls_KeyDownType
//////////////////////////////////////////////////////////////////////////////////////////////////
// First make sure the user clicked on a Row. Clicking on WhiteSpace
// or in the header will return a clicked row value of 0. If that
// occurs, just leave this event.
//////////////////////////////////////////////////////////////////////////////////////////////////
//In filemanager style, the the click and ctrl-click events on a selected row take place
//on the button up event.
If ib_action_on_buttonup Then
ib_action_on_buttonup = false
// (CTRL KEY) keep other rows highlighted and highlight a new row or
// turn off the currint row highlight
If Keydown(KeyControl!) then
this.selectrow(il_lastclickedrow,FALSE)
Else
this.SelectRow(0,FALSE)
this.SelectRow(il_lastclickedrow,TRUE)
End If
//last action was deselecting a row , an anchor row is no longer defined
il_lastclickedrow = 0
End If