演示了处理鼠标事件的基本作法,为获取鼠标事件的名称和坐标值,特意定义了一个函数SetValues(),返回鼠标事件名称s,坐标值xPos,yPos。作为最直观的...
代码说明:
演示了处理鼠标事件的基本作法,为获取鼠标事件的名称和坐标值,特意定义了一个函数SetValues(),返回鼠标事件名称s,坐标值xPos,yPos。作为最直观的表示,随着鼠标的动作,在paint()立即显示鼠标事件的名称和坐标值。在这个基础上稍加改动,当拖动鼠标时,在其移动路径上连续地留下一系列的小圆点。当点击鼠标后,在其位置上画一个红色小十字。-demonstration of the mouse handle basic approach to mouse events access the names and coordinates, specifically defines a function SetValues (), to name s mouse events, coordinates xPos, yPos. As the most intuitive, as the mouse moves, the paint () immediately showed the mouse names and coordinates. On this basis is modified, when the Drag, on his mobile straight path, leaving a series of small dots. When the click of a mouse, in its place painted a small red cross.
下载说明:请别用迅雷下载,失败请重下,重下不扣分!