[Lazarus] TPanel bevel and client size
Mattias Gärtner
nc-gaertnma at netcologne.de
Fri Feb 12 10:05:28 CET 2010
Zitat von cobines <cobines at gmail.com>:
> 2010/2/12 Paul Ishenin <ip at kmiac.ru>:
>> 12.02.2010 14:33, cobines wrote:
>>
>>> If I set any of the bevels instead, the control's ClientSize remains
>>> the same as Size. I would expect the bevels be treated like borders
>>> and also reduce client size. Or is this how it's supposed to work?
>>
>> Bevels reduce ClientRect by BevelSize value.
>
> I thought so that they're supposed to do that, but if I put a TPanel
> on a form with a outer bevel set to Lowered , the panel's ClientHeight
> = Height.
Bevel reduces the AdjustClientRect, which is ClientRect minus the Bevels.
ClientWidth is the client area width from the widgetset. The bevels
are custom drawn by TPanel and therefore not in the ClientWidth of
TPanel.
>>
>>> Problem arises when using autosize on TPanel. The bevels are not
>>> accounted for when size is calculated, the panel's size is the same as
>>
>> BevelSize is used to calculate the ClientRect in
>> TCustomPanel.AdjustClientRect.
>
> Yes, that function recalculates the rectangle correctly, but it seems
> it's somehow not propagated to the auto size algorithm or to the
> stored client rectangle.
The autosize algorithm uses AdjustClientRect.
>>> Is this a bug?
>>
>> If it does not work then yes.
>
> I'll post it to Mantis. Still don't know if it's LCL issue or
> widgetsets, but I observed it on LCLGTK2 and LCLQT so far.
Please add an example to demonstrate the problem.
Mattias
More information about the Lazarus
mailing list