Sign in Join

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

Mailing lists / lazarus / 2013-09

Form size locked

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Mark Morgan Lloyd

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]

Reply by email

Mattias Gaertner
to Mark Morgan Lloyd
Show quoted text 27 lines
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.

Please create a bug report with a complete example.

Mattias

Reply by email

Mark Morgan Lloyd
to Mattias Gaertner
Mattias Gaertner wrote 32 lines
On Sun, 15 Sep 2013 13:17:42 +0000 Mark Morgan Lloyd wrote: > 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. Please create a bug report with a complete example.

Done, http://bugs.freepascal.org/view.php?id=25035

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email