D 表单库 TableLayoutPanel?
每次我尝试使用 D Forms Library 时,我都会遇到这样一个事实:它没有TableLayoutPanel
——这使得我几乎不可能制作出一个好的 GUI。
有没有 DFL 的 TableLayoutPanel
实现?
如果没有它,人们通常如何使用这个库?
编辑:
指向另一个使用 DFL 的程序的链接对于答案来说将是一个巨大的奖励。 :)
Every time I try to use the D Forms Library, I run across the fact that it has no TableLayoutPanel
-- which makes it practically impossible for me to make a good GUI.
Is there any TableLayoutPanel
implementation out there for DFL?
How do people usually use this library without it?
Edit:
A link to another program that uses DFL would be a great bonus for an answer. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于长度超过评论长度限制,因此发布为答案。
我否决了你的问题,因为它是用火焰诱饵的元素来制定的。我猜想您之前使用 GUI 库的经验主要是支持框布局的库,例如 Qt。 Win32 GUI API 本身不提供任何用于创建框布局的原语 - 它始终使用绝对坐标。这在许多构建于 API 之上的 OO 库(例如 MFC)中保持不变。一些库(例如 VCL)具有用于创建框布局(具有对齐和自动调整大小的面板)的可选原语 - 但最终,所有控件重新定位都必须由应用程序或 GUI 框架完成,因此需要像这样的东西从头开始在 DFL 中实现。
所以,回答你的问题:
可能不会。
他们使用 Entice Designer 用鼠标在窗体上绘制控件。 (MFC/Visual Studio、VCL/Delphi IDE等也是如此)
回复评论:
我了解您希望在底部有一个固定高度的面板,并将剩余空间分成两个区域,当调整表单大小时,这两个区域都保持表单宽度的一半。
dock
设置为BOTTOM
。适当设置其高度。dock
设置为RIGHT
。正如您所看到的,获得更复杂的“橡胶表”很快就会变得混乱。我不会打扰,或者如果我真的需要复杂的动态布局,会寻找另一个库。
绝对不是我的观点 - 不需要使用 IDE 构建的语义布局的优点是显而易见的。只是由于其 Win32 API 根源,Windows GUI 库很少提供构建它们的良好方法。当’不是。)
Posting as an answer because length exceeds comment length limit.
I downvoted your question because it is formulated with elements of flamebait. I would guess that your previous experience with GUI libraries was mostly with libraries supporting box layouts, such as Qt. The Win32 GUI API itself does not provide any primitives for creating box layouts - it uses absolute coordinates through and through. This remains unchanged in many OO libraries that build on top of the API, such as MFC. Some libraries, like VCL, have optional primitives for creating box layouts (panels with alignment and auto-size) - but in the end, all control repositioning has to be done by the application or the GUI framework, so something like this would need to be implemented in DFL from scratch.
So, to answer your questions:
Probably not.
They draw the controls on the form with a mouse, using Entice Designer. (The same is true for MFC/Visual Studio, VCL/Delphi IDE, etc.)
Reply to comment:
I understand that you'd like to have a fixed-height panel at the bottom, and split the remaining space into two areas which both remain half the form's width when the form is resized.
dock
toBOTTOM
. Set its height appropriately.dock
toRIGHT
.As you can see, it can quickly get messy to get a more complicated "rubber table". I wouldn't bother, or if I really needed complex dynamic layouts, would look for another library.
Definitely not my point - the advantages of semantic layouts that don't require using an IDE to build are clearly visible. It's just that due to their Win32 API roots, Windows GUI libraries rarely provide good means to build them. Of course, their absence doesn't make building GUIs impossible or even hard - people simply usually go with fixed-size forms, etc. (This is clearly visible to end users switching from Windows to KDE - most KDE dialogs are resizable, while Windows' aren't.)
如果缺少表格布局,您可以使用位置和大小属性在板上放置东西(甚至可能实现您自己的表格布局),
您可以使用 吸引设计师制作 GUI 并在生成的源代码的基础上进一步构建
in lack of a table layout you can use the location and size properties to position stuff on the board (and maybe even implement your own table layout)
you can use the entice designer to make the gui and build further on the generated source
现在我已经接近我的代码了,有两种方法可以管理布局。正如棘轮所提到的,有绝对位置,也有对接。停靠会将项目放置在 5 个可能的位置。顶部、底部、左侧、右侧或中心(填充)。然后,您可以将一个面板放置在其中一个面板中,该面板本身可以包含停靠在其中的元素。您将停靠值分配给停靠属性。
Entice Designer 是用 DFL 编写的。
Now that I'm near my code, there are two ways to manage layout. As mentioned by ratchet there is absolute positions and also docking. Docking places the item in 5 possible locations. The Top, Bottom, Left, Right, or Center (fill). You can then place a panel in one of these which can itself contain elements that are docked within it. You assign the docking value to the dock property.
Entice Designer is written with DFL.