[Lazarus] Testing 0.9.29

Bo Berglund bo.berglund at gmail.com
Sat Feb 19 19:15:09 CET 2011


On Sat, 19 Feb 2011 17:14:34 +0100, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:

>On Sat, 19 Feb 2011 15:34:10 +0000
>Martin <lazarus at mfriebe.de> wrote:
>
>>[...]
>> >> Now tested and found a minor bug in TLabel:
>> >> 1. Put label on form
>> >> 2. Set Alignment=taRightJustify and Autosize=true
>> >> 3. Enter text and observe that the label is still anchored on its
>> >> *left* hand side (expands to the right).
>> > What is the state of Anchors?
>> > If it is set to akLeft, then the behavior is correct.
>> >
>> >
>> >> In Delphi labels that have taRightJustify will automatically
>> >> expand/contract on the left side so the right edge is fixed.
>> > Does the VCL automatically change the Anchors?
>> 
>> tested with turbo delphi.
>> 
>> No the anchor is not changed.
>> but the behaviour is consistent.
>>
>> The Anchors are not used if size changes from autosize
>
>If the VCL AutoSize ignores parts of the other layout settings then for
>me this sounds "inconsistent".
>
>What happens when you set Anchors to [akRight,akTop] in VCL?

In Delphi7 it works as follows on a fresh project form:
Drop a TLabel and its default properties are
Autosize=true
Anchors= [akLeft, akTop]
Alignment=taLeftJustify

Write text into its Caption property and the left side is stationary,
expansion is on the right.

Now change Alignment to taRightJustify
Write text and the right side stays stationary and expansion is to the
left.

The other properties do not change.

Change Autosize to false and now the text aligns to the right but the
label size does not change so if the text is too long the right hand
end stays visible and the left end is pushed into invisibility.

Change autosize back to true and the label expands to the left to show
the hidden text.

Although this is not an issue in the present snapshot of Lazarus,
which I beleieved, it is nevertheless an annoying non-feature because
I use labels a lot to the left of edit boxes to state their names and
I want the name to end just in front of the editbox.
In Delphi I just have to set the Alignment and it is ready.

In Lazarus this does not work unless I do some additional changes:
akRight = true
akLeft=false (because it does not sense the change in akRight)

Only now does the label behave as wanted.


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list