930421 - CDockablePane的子窗口需要有滚动条 [英] 930421 - a child window of a CDockablePane needs to have scrollbars

查看:137
本文介绍了930421 - CDockablePane的子窗口需要有滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我的程序中有一个可停靠的窗格,有三个子窗口,一个tab ctrl和两个类似工具箱的窗口。由于我的程序窗口可能会被用户调整大小,因此可停靠窗格应该具有垂直和水平滚动条,必要时它们必须可见,这样如果隐藏了工具,可能会暴露这些工具。抱歉,如果我无法描述得更好。简而言之,可停靠窗格或其中的两个工具箱子窗口应具有滚动条。两个窗口没有同时显示。他们用tab ctrl切换。

首先,让我知道哪一个更好?为工具箱窗口或整个窗格放置滚动条?我认为最好将滚动条放在工具箱窗口中,因为如果我把它们放在整个窗格中,tab ctrl也会滚动。

然后,问题是当我点击滚动条时似乎滚动条不接收鼠标消息,而是由窗格本身接收它们。窗格通过取消停靠响应鼠标消息!

我想要的理想是:

- 当单击工具ctrl时,工具ctrl窗口接收到点击(现在这种情况发生了)

- 当点击滚动条时,滚动条会收到点击(现在不是这样)

- 当我点击工具箱的区域时在所有工具ctrls之外,窗格是未对接的(就是这种情况)

i认为我要创建滚动条ctrls,而不是启用窗格或工具箱ctrls的WS_VSCROLL和WS_HSCROLL样式。

请帮我找到如何继续。

thx

hi i've a dockable pane in my program with three child windows, a tab ctrl and two toolbox-like windows. since my program's window may be resized by user, the dockable pane should have vertical and horizontal scrollbars which have to get visible when required, so that the tools may be exposed if have got hidden. sorry if i couldn't describe better. in brief, a dockable pane or the two toolbox child windows inside it should have scrollbars. the two windows are not shown at the same time. they're toggled with the tab ctrl.
first, let me know which one is better? putting scrollbars for the toolbox windows or for the whole pane? i think it's better to put scrollbars for the toolbox windows, since if i put them for the whole pane, tab ctrl is also scrolled.
then, the problem is that when i click on the scrollbars it seems that the mouse messages are not received by the scrollbars and they're received by the pane itself instead. the pane responses to the mouse messages by getting undocked!
what i want as ideal is that:
- when a tool ctrl is clicked the tool ctrl window receives the click (now this happens)
- when a scrollbar is clicked the scrollbar receives the click (it's not the case now)
- when i click on the area of the toolbox which is outside of all tool ctrls the pane is undocked (it's the case)
i think i've to create scrollbar ctrls instead of enabling WS_VSCROLL and WS_HSCROLL styles of the pane or the toolbox ctrls.
please help me find how to go on.
thx

推荐答案

您需要研究这些消息和通知处理流程控制。单击或移动滚动条时,它会向其父窗口发送通知消息,以便该窗口需要处理该消息并根据滚动的方向和数量重新绘制自身。至于你放置滚动条的位置,这取决于你认为最适合视觉风格和用户友好性的地方。
You need to study the message and notification handling process for these controls. When a scrollbar is clicked or moved, it sends a notification message to its parent window, so that window needs to handle the message and repaint itself according to the direction and amount of scrolling. As to where you put the scrollbars, that depends on where you think is the best for visual style and user friendliness.


这篇关于930421 - CDockablePane的子窗口需要有滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆