创建鼠标跟踪器,
参数为控件或窗口对象
返回鼠标跟踪器 - 实际上就是返回控件对象自身,
如果已经调用此函数创建过鼠标跟踪器,则直接返回参数
设为false时禁止在单击控件时设置此控件为焦点控件
winUiTrackerObject.onFocusGot = function(hLostFocus){
..win.setFocus(hLostFocus);/*得到焦点触发此事件,hLostFocus为失去焦点的窗口句柄,
如果在这里将hLostFocus恢复焦点,则阻止当前窗口得到焦点*/
}
winUiTrackerObject.onFocusLost = function(hFocus){
/*失去焦点触发此事件,hFocus为得到焦点的窗口句柄*/
}
winUiTrackerObject.onKeyDown = function(keyCode,lParam,repeat){
/*按下键盘键*/
}
winUiTrackerObject.onKeyUp = function(keyCode,lParam){
/*放开键盘键*/
}
winUiTrackerObject.onMouseActivate = function(hwndTop,hitTest,message){
return _MA_/*鼠标点击并且将要激活窗口时触发此事件
hwndTop表示被激活的顶层窗口,
hitTest参数请参考WM_NCHITTEST消息
message为鼠标消息ID
返回值的作用请参数MSDN*/
}
winUiTrackerObject.onMouseClick = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标左键在控件上单击,
orphanWindow模式下如果阻止控件得到焦点,此事件不会被触发*/
}
winUiTrackerObject.onMouseDoubleClick = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标双击*/
}
winUiTrackerObject.onMouseDown = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标左键按下,
orphanWindow模式下如果阻止控件得到焦点,此事件不会被触发*/
}
winUiTrackerObject.onMouseDrag = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标左键按下拖动,
自动捕获鼠标,允许拖出控件范围*/
}
winUiTrackerObject.onMouseEnter = function(wParam,lParam){
/*鼠标移入*/
}
winUiTrackerObject.onMouseHWheel = function(flags,delta,lParam){
delta = -delta/(120/3);
/*水平滚动鼠标滚轮,flags 参数以 _MK_CONTROL 等常量表示按键*/
}
winUiTrackerObject.onMouseHover = function(wParam,lParam){
/*鼠标悬停*/
}
winUiTrackerObject.onMouseLeave = function(wParam,lParam){
/*鼠标移出*/
}
winUiTrackerObject.onMouseMove = function(wParam,lParam){
if( wParam & 0x1/*_MK_LBUTTON*/ ){
var x,y = win.getMessagePos(lParam);
/*鼠标移动*/
}
}
winUiTrackerObject.onMouseUp = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标左键弹起*/
}
winUiTrackerObject.onMouseWheel = function(flags,delta,lParam){
delta = delta/(120/3);
/*滚动鼠标滚轮,flags 参数以 _MK_CONTROL 等常量表示按键*/
}
winUiTrackerObject.onRightMouseDown = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标右键按下*/
}
winUiTrackerObject.onRightMouseUp = function(wParam,lParam){
var x,y = win.getMessagePos(lParam);
/*鼠标右键弹起*/
}
winUiTrackerObject.onSelectChange = function(prev){
/*单选模式下已选中当前控件,prev 为同一分组之前选中的控件
同一分组之前没有选中控件时 prev 为 null*/
}
winUiTrackerObject.onStateChange = function(){
/*状态已改变*/
}
winUiTrackerObject.onSysKeyDown = function(keyCode,lParam,repeat){
if(keyCode!=0x12/*_VK_ALT*/){
/*按下键盘ALT组合键*/
}
}
winUiTrackerObject.onSysKeyUp = function(keyCode,lParam){
/*放开键盘键*/
}
单选模式下选中控件
单选模式下选中控件的文本
鼠标或键盘键按下状态
是否选中状态
已禁用
是否按下鼠标且正在拖动
是否已得到焦点
鼠标是否在控件上方
悬停超过预设时间后触发onMouseHover事件