GWT 可调整大小的对话框
据我了解,默认情况下,DialogBox 在 GWT 中是不可调整的(甚至没有实现)。我所说的可调整大小是指单击对话框的边缘并将其拖动得更大。 我在网上看到过一些自定义的可调整大小的面板,但没有看到对话框。我对如何制作可调整大小的对话框有一些想法,只是不想重新发明威尔。也许有人知道可调整大小的对话框的实现,并且可以将我链接到源代码?
As far as I understand DialogBox by default is not reizable (it is not even implemented) in GWT. By resizable I mean clicking on the edge of the DialogBox and dragging it bigger.
I've seen some custom resizable panels on the web, but not the DialogBox. I've some ideas on how to make resizable DialogBox, just don't want to re-invent the weel. Maybe someone knows an implementation of resizable DialogBox and can link me to the source code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我做了类似的事情,它只是在右下角添加了一个红色框,然后您可以将鼠标处理程序添加到该红色框以调整大小。
I did something like this, it just adds a red box to the bottom right corner, you can then add mouse handlers to that red box for resizing.
好吧,经过一些研究,我得出的结论是,由于 DialogBox 的构造,它无法完成。至少在不失去 DialogBox 默认行为的情况下无法完成此操作。所有鼠标事件都必须被覆盖。如果我覆盖所有事件,我可以放松默认行为,以防 Google 将来更改某些内容。
对话框标题不是与对话框本身分开的。在所有鼠标事件上,DialogBox 检查发送者是否为 Caption,如果不是,则吞掉鼠标事件。这样对话框就可以在屏幕上移动。
OK after some research I've come to a conclusion that due to construction of DialogBox it can not be done. At-least it can not be done without loosing DialogBox default behavior. All the mouse events has to be overridden. If I override all the events, I can loose default behavior in case Google changes something in the future.
DialogBox caption is not made seperate from DialogBox it self. On all the mouse events DialogBox checks if sender is Caption, if it is not, it swallows the mouse event. That way DialogBox is moved around the screen.