Flex 4:标题窗口超出可访问区域
我有一个奇怪的问题 - 我使用标题窗口来创建给用户的消息。用户可以在屏幕上移动标题窗口,以便主屏幕可见。
但是,如果用户将标题窗口移动太多,它实际上可能会超出浏览器可访问区域 - 用户别无选择,只能关闭浏览器并重新开始。我们如何确保标题窗口的移动受到限制,以便标题栏始终可供控制?
我的措辞可能不对 - 请检查所附图片。
I have a strange issue- I use a title window to create a message to the user. The user has the ability to move the title window around the screen so that the main screen is visible.
However if the user were to move the title window way too much, it can actually go outside the browser accessible area- the user has no option but to close the browser and start again. How do we ensure that the title window movement is limited, such that the title bar is always available for control?
I might not have worded this right- pls check the attached image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会听 move TitleWindow 的 事件。如果窗口移出应用程序的可见坐标,请将其移回来。
如果您唯一的问题是允许用户关闭窗口,那么除了顶部的“x”之外,您还可以在窗口底部添加一个“关闭”按钮。
I'd listen to the move event of the TitleWindow. If the window is moved out of the visible coordinates of the application, move it back.
If you're only issue is w/ allowing the users to closet the window, then you could add a "Close" button on the bottom of the window in addition to the 'x' at the top.
如果您可以使用自定义组件,我建议您重写 TitleWindow 的 move() 方法。我使用以下代码来限制窗口移动:
If you can use a custom component I'd suggest you override the TitleWindow's move() method. I'm using the following code to restrict the window movement:
该函数在 titlewindow 的移动事件上调用:
This function is called on move event of titlewindow: