long ll_rowkeydown
long j
string ls_AddPict
string ls_CurObj
string ls_Picture
string ls_CurCol
integer li_PictPos
// 点击表格的题头进行排序
ls_CurObj = String(dwo.Name)
If Row = 0 AND &
This.Describe(ls_CurObj + ".Text") <> "!" AND &
This.Describe(ls_CurObj + ".Band") = "header" Then // Valid header object?
ls_CurCol = Left(ls_CurObj,Len(ls_CurObj) - 2)
If is_OrderCol <> ls_CurCol Then // Different Column
This.Modify("DESTROY p_" + is_OrderCol)
is_OrderCol = Left(ls_CurObj,Len(ls_CurObj) - 2)
ls_Picture = ".\image\ORDERUP.BMP"
is_SortType = "A" // Ascending sort
li_PictPos = Integer(This.Describe(ls_CurObj + ".X"))+ (Integer(This.Describe(ls_CurObj + ".Width")) - 70)
ls_AddPict ='create bitmap(band=foreground filename="' + ls_Picture + '" ' + &
' x="' + String(li_PictPos) + "~tInteger(describe('" + is_OrderCol + &
".X')) + (Integer(describe('" + is_OrderCol + ".Width'))" + ' - 70)" y="24" ' + &
' height="33" width="51" border="0" name=p_' + is_OrderCol + ' visible="1")'
This.Modify(ls_AddPict)
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
Else
If is_SortType = "A" Then
ls_Picture = ".\image\ORDERDW.BMP"
is_SortType = "D"
Else
ls_Picture = ".\image\ORDERUP.BMP"
is_SortType = "A"
End If
This.Modify('p_' + is_OrderCol + '.filename = "' + ls_Picture + '"')
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
End If
End If
// 点击时选中某一行或组合键选中多行(Ctrl,Shift)
ll_rowkeydown = this.getclickedrow()
if ll_rowkeydown = 0 or isnull(ll_rowkeydown) then return
if keydown(keycontrol!) then
if isselected(ll_rowkeydown) then
selectrow(ll_rowkeydown,false)
else
selectrow(ll_rowkeydown,true)
end if
key_orde = ll_rowkeydown
else
if keydown(keyshift!) then
this.selectrow(0,false)
if ll_rowkeydown > key_orde then
for j=key_orde to ll_rowkeydown
this.selectrow(j,true)
end for
else
for j= key_orde to ll_rowkeydown step -1
this.selectrow(j,true)
end for
end if
key_orde = ll_rowkeydown
else
this.selectrow(0,false)
this.selectrow(ll_rowkeydown,true)
this.setrow(row)
this.setrowfocusindicator(hand!)
key_orde = ll_rowkeydown
end if
end if