[Lazarus] Shrink-fitting a form around its content
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Mon Jan 21 22:38:16 CET 2013
Mattias Gaertner wrote:
> On Mon, 21 Jan 2013 20:49:25 +0000
> Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:
>> Mattias Gaertner wrote:
>>> On Mon, 21 Jan 2013 19:19:24 +0000
>>> Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:
>>>> If I have something like a frame containing a wizard-style notebook, or
>>>> for that matter something like a DB-aware grid tailored to its content,
>>>> is there a portable way to fit a form or some other container around it?
>>> Put frame on a form and set the form's AutoSize to true.
>> Thanks, I'll experiment. Is that specifically a form property or is it
>> possible to do the same for e.g. a page control or a panel?
> TPanel, yes.
> TPageControl, no.
Thanks. Panel and form are probably the major cases. [Pokes IDE] I
suppose the length of a bevel as well but I presume that everything
reasonable can be handled by alignment.
>>>> The problem seems to be that each OS or widget set has a different
>>>> amount of "furniture" between its declared dimensions and its client space.
>>> Note: A TFrame does not have any furniture. Window size is Client size
>>> on all platforms.
>> In the case of a TFrame, yes. But I was thinking of the form case where
>> there are- if my experience is reliable- significant differences between
>> the Windows and X way of doing things.
> Yes. I guess there are still some window managers, where form.autosize
> does not work well.
> But the other way round - autosizing the content - works always.
Yes, that I'm used to. But I've asked about "shrink-fitting" a form a
couple of times over the last two or three years without a definite
response- presumably the implementation's improving.
If it works well with gtk and adequately with Windows I'll be entirely
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the Lazarus