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.
相关文章