[Lazarus] Shrink-fitting a form around its content

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 21 20:26:41 CET 2013

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.
> 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.

> The particular case that I'm thinking of is a modal form I've knocked 
> together to get database login information. This is a notebook which 
> allows the server, port number, SSL mode, schema/table identifier etc. 
> to be collected, as well as the standard username and password. But it 
> would also be useful to be able to embed two of these into something 
> (i.e. one for a local database and one for an upstream one), which 
> suggests that redoing it as a frame would be a worthwhile approach 
> /provided/ that a container could be fitted trivially around it without 
> having to maintain conditional "fudge factors".


More information about the Lazarus mailing list