Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-03

AdjustClientRect or GetLogicalClientRect: which one to override?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

For a component I'm building I need to let the subcomponents know that (for aligning) they cannot use the entire client space. (It is a panel descendant with asymmetrical bevels).

At first I tried AdjustClientRect but that did not work, so I tried GetLogicalClientRect.
It all seems to work as expected. Subcomponents align to the new "borders".

Then the compiler told me (well, it did before, but I didn't notice) that I forgot to add the override to AdjustClientRect. I fixed that (and got rid of the overridden GetLogicalClientRect), and this also works.

So, here's my question: which of these two methods is the "right" one to override in this example? And what is the other method intende for?

Bart

Reply by email

Mattias Gaertner
to Bart
Show quoted text 8 lines
[...] Then the compiler told me (well, it did before, but I didn't notice) that I forgot to add the override to AdjustClientRect. I fixed that (and got rid of the overridden GetLogicalClientRect), and this also works. So, here's my question: which of these two methods is the "right" one to override in this example? And what is the other method intende for?

The LCL uses the output of GetLogicalClientRect as input for AdjustClientRect.

AdjustClientRect:
http://wiki.freepascal.org/Autosize_/_Layout#AdjustClientRect

GetLogicalClientRect:
http://wiki.freepascal.org/Autosize_/_Layout#Scrolling

So, you can use either AdjustClientRect or the ChildSizing properties.

Mattias

Reply by email