Windows C++ dialog resizer class(Windows C++ 对话框调整器类)
问题描述
我正在寻找一个非常好的对话框调整器类,它可以在调整屏幕大小时根据需要拉伸和收缩各个项目.Stephan Keil 有一个很好的 (DlgResizeHelper),它基本上可以按设定的比例调整所有内容的大小,但我正在寻找更智能的东西.
I'm looking for a really good dialog resizer class that will stretch and shrink individual items as needed as the screen is resized. Stephan Keil has a good one (DlgResizeHelper) which basically resizes everything by a set ratio, but I'm looking for something smarter.
例如:
图标不应调整大小
Icons should not resize
单行文本框不应垂直拉伸
Single-line text boxes should not be stretched vertically
按钮应该保持相同的大小
Buttons should probably stay the same size
基本上,我正在寻找可以查看所有控件的内容,找出静态文本字段与其旁边/下方的控件相关,并将两者锚定在一起,并以智能"方式调整大型控件的大小所以看起来不错.
Basically I'm looking for something to look at all of the controls, figure out that a static text field is related to a control next/below it and anchor the two together, and resize large controls in a 'smart' way so it looks good.
有这样的框架吗?我一直在做一个,但现成的可能会更好.
Are there such frameworks out there? I've been working on one but something ready-made would probably be better.
跟进:我正在查看建议的解决方案.其中许多要求您在对话框上的每个控件中加入一个锚点.我正在寻找一些聪明的东西,它可以弄清楚锚点应该是什么,如果猜测错误,它能够手动锚定.似乎应该是可能的——大多数人会同意编辑字段旁边的静态文本字段应该锚定在一起.猜猜我在这里几乎是在寻找一个小 AI :)
FOLLOW UP: I'm looking at the suggested solutions. Many of them require you to go in an anchor each control on the dialog. I'm looking for something smart that will figure out what the anchors ought to be, with the ability to manually anchor if the guesses are wrong. Seems like it should be possible -- most humans would agree a static text field next to an edit field should be anchored together. Guess I'm almost looking for a little AI here :)
推荐答案
你可以使用wxWidgets.它完全替代了 MFC,是多平台的,并为您提供了基于布局的对话框机制.
You can use wxWidgets. It completely replaces MFC, is multi-platform, and gives you a layout-based dialog mechanism.
这篇关于Windows C++ 对话框调整器类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Windows C++ 对话框调整器类
基础教程推荐
- 从 std::cin 读取密码 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01