如何在 Windows 上创建一个悬停在其他小部件上的浮动小部件?
假设我们在窗口层次结构和 sizer 层次结构中都有一个 wxWebView
控件。我们如何在 Windows 上创建一个悬停在 wxWebView
上方的静态文本“正在加载”?谢谢。
在 Linux 上这很简单。创建一个 wxStaticText
,其父级/所有者与 wxWebView
相同,仅此而已。不幸的是,它无法在 Windows 上运行。 wxStaticText
是不可见的,因为它被wxWebView
覆盖。我尝试了很多方法,包括调用他们的方法 Lower
和 Raise
来调整他们的 z 顺序,但没有成功。
我还尝试将文本放入 wxFrame
并使用 samples/shape/
作为示例,但转念一想,新的顶级框架可能会覆盖 GUI其他流程。所以这不是一个好的设计。
有什么建议吗?谢谢。
Assume we have a wxWebView
control in both window hierarchy and sizer hierarchy. How do we create a static text "loading" hovering above the wxWebView
on Windows? Thanks.
It's straightforward on Linux. Create a wxStaticText
of which the parent/owner is the same as the wxWebView
and that's all. Unfortunately, it won't work on Windows. The wxStaticText
is invisible because it is covered by the wxWebView
. I've tried many ways, including calling their method Lower
and Raise
to adjust their z-orders, but in vain.
I also tried putting the text into a wxFrame
and use samples/shaped/
as an example, but on the second thought, the new top-level frame may cover the GUI of other processes. So it isn't a good design.
Any suggestion? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
wxWidgets 不支持重叠子控件,因此您需要为浮动控件使用不同的顶级窗口,通常是
wxPopupWindow
——然后您可以在其中绘制文本或制作wxStaticText
它的孩子。wxWidgets doesn't support overlapping child controls, so you would need to use a different top level window for your floating control, typically a
wxPopupWindow
-- then you could either draw your text in it or makewxStaticText
its child.