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?
A link to another program that uses DFL would be a great bonus for an answer. :)
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:
Is there any
TableLayoutPanel
implementation out there for DFL?
Probably not.
How do people usually use this library without it?
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:
how do I put things in a table layout (e.g. two side-by-side, and one below)?
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
to BOTTOM
. Set its height appropriately.dock
to RIGHT
. protected override void onResize(EventArgs ea)
{
super.onResize(ea);
panel2.width = this.clientRectangle.width / 2;
}
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.
Or are you saying that's a bad idea in the first place?
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.)
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With