[Lazarus] Autosize behaviour

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Apr 8 20:16:50 CEST 2010


Mattias Gärtner schrieb:

>> The description of BorderSpacing is not very clear, can you improve it?
> 
> I tried. See here:
> 
> http://wiki.lazarus.freepascal.org/Autosize_/_Layout#BorderSpacing

Much better now :-)


>> In a generalized layout management every control could be adjustable 
>> inside the cell, that has been determined by the layout manager. I.e. 
>> a regular[1] layout manager would tile the client area and assign 
>> every control a cell. When required, every control can align itself 
>> inside its cell, instead of inside its parent, using the same 
>> properties. Then the fine-tuning is independent from a specific layout 
>> manager or control type.
> 
> Yes, see for example here:
> http://wiki.lazarus.freepascal.org/Autosize_/_Layout#Individual_cells

That's what inspired me :-)

> What is missing in the current LCL tables are column and row spans.

This will complicate many things, including designers. But you're right, 
it would be a nice feature. Perhaps the cells of a table should be 
handled like tabstops in this case, where the width/height of a 
control's cell snaps to the next stop. This model could be merged with 
anchors, when the anchors are defined for the containers, instead of 
from controls with fixed client positions.



>> Such layouts are quite easy to manage, in contrast to an arbitrary 
>> placement and anchoring of every single control within its parent or 
>> relative other controls (almost unmanaged until unmanageable).
> 
> I tend to disagree. Both can be easy and both can be pain.
> Tables are worse when some controls should not be placed into the 
> raster.

I'd call this a bad design, that does not scale well. An adjustment with 
BorderSpacing should be sufficient.

> And Anchoring misses the alignment with multiple controls.

That's why I suggested to define "tabstops" for containers, that do not 
break on a resize. The tabstops can scale with the container, or they 
can stay anchored to an edge or the center of an container. In the most 
general model a Resize handler can be used to adjust the rulers.


> Both need a good GUI. There should be a mode to visualize Anchors in the 
> designer for example with arrows. And for tables there should be a mode 
> to show the borders.

This could be done with guide-lines, replacing the uniform designer 
grid. Some feedback principles can be taken from docking...

DoDi





More information about the Lazarus mailing list