Event | Event ID | 备注 |
Clicked | 1281 | |
RowFocusChanged | 2048 | |
RightMouseButtonDown | 2314 | |
Left Button Up | 2313 | |
Retreive End | 769 | |
MouseMove | 2311 | |
RowFocusChanged | 2048 | 至于问题中的上下滚动,倘为键盘,将导致行焦点改变(此外,还导致一个ID=2049的事件) |
PageUp/PageDown | 2339 | 鼠标点击滚动条上下按钮 |
3、根据上述列表,就可以在 pbm_command 事件中判断对DDDW做了何种操作:
DataWindowChild ldwc_Child
GetChild( "Column", ldwc_Child )
IF IntLow( Message.Longparm ) = Handle( ldwc_Child ) THEN
CHOOSE CASE IntHigh( Message.Wordparm )
CASE 2048 // RowFocusChanged on DDDW
CASE 1281 // Clicked
CASE 2314 // Right Mouse Button Clicked
CASE 2311 // MouseMove
END CHOOSE
END IF
PB可以直接使用其参数hwndchild、notificationcode代替其中的intLow(Message.LongParm)和intHigh(Message.WordParm)。
一个简单例子 -- 自动选择DDDW
DataWindowChild ldwc_Child
String ls_Pointer
Long ll_Row, ll_Lparam, ll_Lparam
ll_Lparam = Message.LongParm
ll_Lparam = Message.WordParm
GetChild( "status", ldwc_Child ) // Replace the column name "status" as you needed
IF IntLow( ll_Lparam) = Handle( ldwc_Child ) THEN
CHOOSE CASE IntHigh( ll_Lparam )
CASE 2311 // MouseMove
// Get the object at pointer and parse out the Row #
ls_Pointer = ldwc_Child.GetObjectAtPointer()
ll_Row=Long( Mid( ls_Pointer, Pos( ls_Pointer, "~t" ) + 1 ))
// If the Row is different then highlight it
IF ldwc_Child.GetRow() <> ll_Row AND ll_Row > 0 THEN
ldwc_Child.ScrollToRow( ll_Row )
END IF
END CHOOSE
END IF