如何在 Flex 应用程序边界内保持拖动的 TitleWindow
我在 FB4 中使用 PopupManager 来显示自定义对话框。
popwin = new TitleWindow(); popwin.addElement(myCustomDialog); PopUpManager.addPopUp(popwin,this,false); PopUpManager.centerPopUp(popwin);
当弹出的TitleWindow的灰色标题栏位于Flex应用程序矩形边界之外时,可以拖动弹出的TitleWindow并松开它,然后无法再次抓取弹出窗口。也可以向下拖动 TitleWindow,使其在 Flex 应用程序矩形底部边缘下方完全不可见。当 Flex 应用程序边界小于整个浏览器窗口并且用户工作速度很快时,发生这种情况的可能性就会增加。是否有一个简单的设置可以防止这种情况发生,或者程序员必须在拖动操作期间拦截该行为?
谢谢 蒂姆
I am using PopupManager in FB4 to display a custom dialog.
popwin = new TitleWindow(); popwin.addElement(myCustomDialog); PopUpManager.addPopUp(popwin,this,false); PopUpManager.centerPopUp(popwin);
It's possible to drag the popped up TitleWindow and let go of it when its gray title bar lies outside the bounds of the Flex app rectangle, and then the popup cannot be grabbed again. It's also possible to drag the TitleWindow downwards so it becomes completely invisible below the bottom edge of the Flex app rectangle. When the Flex app bounds are less than the full browser window, and the user is working quickly, this chances of this happening increase. Is there a simple setting that will keep this from happening, or must the programmer intercept the behavior during the drag operation?
Thanks
Tim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿,据我所知,没有一个简单的设置可以防止这种情况发生。您所需要做的就是观察它每次移动并确保它保持在一定的范围内。如果您愿意,您可以将该事件处理程序抽象到某个控制器类中。
这是一个基本示例:
希望有所帮助,
槊
Hey, there isn't a simple setting to prevent this from happening from my knowledge. All you need to do is watch it every time it moves and make sure it stays within certain bounds. You could then abstract that event handler into some Controller class if you'd like.
Here's a basic example:
Hope that helps,
Lance
只需创建类并覆盖移动事件
包 SmartComponants
{
导入spark.components.TitleWindow;
}
just create class and override move event
package SmartComponants
{
import spark.components.TitleWindow;
}