Show quoted text 18 lines
On 8/18/06, Darius Blaszijk wrote:
> Just a note, but the "auto-sizing" of components as depicted in the
> fig2. example is perfectly possible with Anchoring already. There's
> no need for a layout manager for that functionality.
>
> Darius
Lazarus has much better anchoring support that Delphi, I have to
admit. But "auto-sizing" is just one of the things the Layout
Managers do. It also aligns the components, positions them, prevents
them from being clipped (setting minimum allowed size) when the form
is resized, etc... All this by just creating a layout manager and
inserting widgets into it.
Take a look at the attached screenshot. This is how most of the
dialogs in Lazarus look to me. It is compiled with Gtk1. Most of the
captions are clipped, group boxes don't align... It doesn't resize
the controls when the dialog resizes.
Right. This dialog is not using all LCL abilities.
Show quoted text 9 lines
Those problems will never
happen in fpGUI, no matter the language, resolution, dpi setting, etc.
Yes, I have tried to recreate that exact screen using Lazarus with
all its anchoring features and alignment features. I never got it to
work 100% and it wasn't easy at all.
Good news is, if you don't like the Box and Grid Layouts, you can
always use the Fixed Layout, which then allows you to place component
anywhere without auto-align and positioning.
yes, both approaches have their pros and cons. The rule based Box/Grid layout is never overlapping, but more work to setup and is more difficult to change. While the 'fixed' layout is quite the opposite: Easy to learn, easy to setup, easy to change and easily overlaps. The never overlapping feature is important for platform/theme independent software, while the other approach is more comfortable for the rapid application goal.
The LCL has already Boxes and simple Grids. Complex Grids are missing. You can use the autosizing properties to prevent overlapping, but then you loose the ability to easily change the layout. I think, best would would be the 'fixed' layout editing plus automatic anti overlapping and some properties to fine tune the automatic. Delphi has Scaling, which is easy to implement, but does not work for different languages.
It should more work like: If a control overlaps, then the overlapped controls must be moved and maybe the parent enlarged.
Mattias