在 CView 上浮动控件

发布于 2024-08-26 17:33:01 字数 590 浏览 4 评论 0原文

我有一个应用程序,它使用多个 CView 派生类(实际上是 CScrollView)来显示文档数据。对于一个特定视图,我想添加一个弹出编辑框来添加注释。也就是说,您会在窗口底部看到一个标有“页面注释”的选项卡,单击该选项卡将弹出编辑框。在编辑框可见时单击选项卡会将其缩小回仅选项卡。

我想我可以使用一个单选项卡 CTabCtrl 来保存一个编辑框,然后将其定位,以便最初只有该选项卡可见。捕获选项卡单击通知并将整个控件(带有编辑框)移动到视图中。再次单击该选项卡会将其向下移动,因此只有该选项卡可见。

CView 上托管 CTabCtrl 很好,我可以将其正确定位。问题是,如果滚动视图,选项卡控件也会随之滚动,而我需要它“浮动”在视图上并且不受任何滚动的影响。滚动后我可以将其移回原位,但闪烁很难看。

有没有一种简单的方法来实现“浮动”效果?我主要希望将选项卡嵌入视图中以进行维护,因为它是正在使用的多个视图类中唯一需要“页面注释”功能的视图类。

我应该把选项卡放在视图的父窗口中吗?我知道它不会受到滚动的影响,但我喜欢如果可能的话将选项卡保留为视图的一部分的想法。

I've got an app that uses several CView-derived classes (actually CScrollView) to display document data. For one particular view, I want to add a fly-out edit box to add notes. That is, you'd see a tab at the bottom of the window labeled "Page Notes", and clicking on that would bring up the edit box. Clicking the tab while the edit box is visible would reduce it back to just the tab.

I thought I could use a one-tab CTabCtrl holding an edit box and just position it so that only the tab is visible initially. Capture the tab click notification and move the entire control, with edit box, into view. Clicking the tab again would move it back down so only the tab is visible.

Hosting the CTabCtrl on the CView is fine, and I can get it positioned correctly. The problem is that if the view is scrolled, the tab control is scrolled along with it, whereas I need it to "float" over the view and not be affected by any scrolling. I can move it back into place after the scroll, but the flickering is unsightly.

Is there a straightforward way to accomplish the "floating" effect? I mainly want the tab embedded in the view for maintenance, since it's the only view class out of the several in use that needs the "Page Notes" feature.

Should I just buckle down and put the tab in the view's parent window instead? I know it won't be affected by scrolling there, but I like the idea of keeping the tab as part of the view if possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光匆匆的小流年 2024-09-02 17:33:01

听起来该选项卡的功能就像一个按钮。单击该选项卡,会出现一个飞出编辑框。您可以使用无模式对话框。
选择“页面注释”,将出现无模式对话框来编辑注释,允许您在对话框下滚动视图。

It sound like the tab is functioning like a button. You click the tab and a fly out edit box appears. You could use a modeless dialog.
Select the "Page Note" and the modeless dialog comes up to edit your notes allowing you to scroll your view under the dialog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文