gpt4 book ai didi

c++ - MFC 扩展 CFileDialog

转载 作者:行者123 更新时间:2023-11-27 23:06:13 31 4
gpt4 key购买 nike


我需要在 MFC 中构建一个控件来显示某些文件的预览。这些文件是 3D 模型,所以我需要使用 OpenGL 来绘制它们并让用户与之交互(平移、缩放等)。

我想扩展 CFileDialog 类,因为再次在文件系统中进行导航会浪费时间,而且结果肯定不会相同。
我已经设法修改 CFileDialog 资源,添加我的子对话框:

SetTemplate( 0, MAKEINTRESOURCE( IDD_MYPREVIEWDLG ) )

但是 child 附加在底部,而我想在右侧看到我的预览。

这可能吗?

最佳答案

来自 MSDN (强调我的):

To make room for the new controls, the system expands the default dialog box by the width and height of the custom dialog box. By default, all controls from the custom dialog box are positioned below the controls in the default dialog box. However, you can override this default positioning by including a static text control in your custom dialog box template and assigning it the control identifier value of stc32. (This value is defined in the Dlgs.h header file.) In this case, the system uses the control as the point of reference for determining where to position the new controls. All new controls above and to the left of the stc32 control are positioned the same amount above and to the left of the controls in the default dialog box. New controls below and to the right of the stc32 control are positioned below and to the right of the default controls. In general, each new control is positioned so that it has the same position relative to the default controls as it had to the stc32 control. To make room for these new controls, the system adds space to the left, right, bottom, and top of the default dialog box as needed.

关于c++ - MFC 扩展 CFileDialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23358513/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com