[Lazarus] TMouseButton
Kjow
antispammoni at gmail.com
Wed Apr 7 15:46:01 CEST 2010
On Wed, 7 Apr 2010, Hans-Peter Diettrich wrote:
> Michael Van Canneyt schrieb:
>
>>>> Now the TControl/TWinControl classes have a set of properties that is the
>>>> union of all properties of a large set of layouters (because it must
>>>> mimic
>>>> the behaviour of all these layouters put together):
>>>> * AutoSize
>>>> * Anchors
>>>> * Align
>>>> * Constraints
>>>> * BorderSpacing
>>>> * ChildSizing
>>>
>>> Only Align, Anchors and ChildSizing.Layout are layouts. The rest are
>>> details that apply to all layouts. See the layouters of gtk.
>>
>> In my view, this is not correct. Borderspacing, Constraints and AutoSize
>> are also properties used in layouting. I see no reason why a control would
>> have these properties (assuming we were to move all layouting to a separate
>> component).
>
> IMO it's quite simple. A layout affects the position of child controls inside
> a container control, nothing else. Borders, Constraints and Autosize are
> general properties of all controls, which must be handled in/by the control
> itself.
I agree for Constraints, but not the other two.
It is in contradiction with what Mattias said, where he claimed that
when doing layouting you must always work inside-out and outside-in.
Borderspacing IS used when layouting: it determines the available space
for childs inside/outside the control.
Autosize as well: if autosize is true, then the size of the control
changes, and therefor the layout internal to the control, but also
externally. Hence it belongs in the layouter.
IMHO a control needs only 5 properties: top/left/width,height and
constraints. All the rest is layouting.
This does not mean I want to remove all these properties from the control,
but I do consider all other properties part of the layouting process.
Michael.
More information about the Lazarus
mailing list