[Lazarus] Form size locked
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Sun Sep 15 15:17:42 CEST 2013
It appears that a bsDialog form has its actual width and height locked
once it has been displayed by ShowModal. Components inside the form,
e.g. a PageControl with client alignment, see the dimensions that have
been set under program control but the actual form size can be
significantly different (larger or smaller).
What I've got is a form that displays either a single page if the
program is doing a simple login to a host computer, or multiple pages if
it's also offering facilities that the host can use; in the case of the
single page the pagecontrol tabs are disabled and the overall form
shrunk to fit. The first time the form is displayed it's always sized
correctly, but if the required login type changes the form size cannot
be adjusted.
I'm able to use this sort of thing as a workaround:
BorderStyle := bsSizeable;
Application.ProcessMessages;
Width := Tag div 1000;
Height := Tag mod 1000;
Application.ProcessMessages;
BorderStyle := bsDialog;
Application.ProcessMessages;
PageControl1.ShowTabs := true;
PageControl1.ActivePage := TabSheet1;
Gtk2, Lazarus 1.0, LCL 1.0.1.3.
--
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
mailing list