smartGWT 中不同画布缺少鼠标松开事件
我有两张彼此相邻的画布。其中一个应该是一种可以添加项目、选择和重新排列项目的工作区。另一间只是房产视图。
我想做的是能够在工作区上绘制一个矩形。只要用户按住鼠标按钮,矩形就会出现。如果他释放按钮,则矩形下方的所有项目都将被选择。目前,这适用于 MouseDown、MouseStillDown 和 MouseUp 事件。我正在工作区上绘制另一个矩形阴影画布,该画布将在每个 MouseStillDown 事件上进行转换,并且选择将在 MouseUp 事件上发生。我的问题是,如果用户按住鼠标按钮并将其移动到属性画布,然后释放按钮,则不会调用工作区中的 MouseUp 事件。两者都不是该属性中的一个,因为它缺少 MouseDown 事件。因此,如果用户释放按钮,则选择将不起作用,并且矩形仍保留在工作区中。
是否有机会以某种方式避免这种情况?或者是否有更好的方法来确定用户在按住鼠标左键的同时用鼠标选择的区域?
I have two canvases located to each other. One is supposed to be a kind of workspace you can add items to, select and rearange them. The other one is just a property view.
What I want to do is to be able to draw a rectrangle on the workspace. As long as the user holds down the mouse button the rectangle will show up. If he releases the button all items that are beneath the rectangle will be selected. This currently works good with the MouseDown, MouseStillDown und MouseUp events. I'm drawing another rectangle shaed canvas on the workspace which will be transformed on every MouseStillDown event and the selection will occur on the MouseUp event. My problem is, that if the user hold down the mouse button and moves it to the property canvas and then releases the button the MouseUp event from the workspace isn't called. Neither is the one from the property since it's missing a MouseDown event. So if the user releases the button there the selection won't work and the rectangle stays in the workspace.
Is there an oppurtunity to somehow avoid this? Or is there a better way to determine the area the user selected with it's mouse while holding down the left mouse button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论