Sign in Join

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

Mailing lists / lazarus / 2022-06

Lazarus 2.2 and FormResize

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Luca Olivetti

With Lazarus 2.0.12 the OnResize event for a form was fired while resizing, but in 2.2.2 it's fired only when the resizing is done (only under windows, under linux it behaves the same as before). However, if I put, say, a panel with top,left,bottom,right anchoring, its OnResize event is fired while resizing.
Is there a way to restore the previous behaviour for a form?

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007

Reply by email

R.Smith
to Luca Olivetti

Amazing coincidence, I just ran into this yesterday and contemplated posting about it.

The behaviour now seems as if for a "OnAfterResize" type of event - and it's great to have - but on occasion you really want to resize form internals during a resize operation by the user.

In my case, I have a form with 2 panels [alLeft, alClient] on it that I resize to 50% (by changing the width of the alLeft-aligned panel) when the form resizes. If the form was quite large and thus the panels are both large, then the user grabs the form-edge and drag it smaller, the alClient-aligned panel will resize into nothingness and the other panel become partly hidden (when the form becomes smaller than its original size, until the user releases the mouse at which point the event fire and they jump back to size.

To be clear - it's a fantastic feature to have, I've often wished for an OnAfterResize type event, and will mostly use it so, but in some cases would want the old behaviour. Perhaps if there was some way to change that for a form? A new property perhaps, or even a programmatically selectable variable or such.

I'm happy to say in the form's OnCreate() event for the form, or even application-wide if need be:
? formContinuousResize := True;

or whatever sounds feasible.

Luca Olivetti wrote 8 lines
With Lazarus 2.0.12 the OnResize event for a form was fired while resizing, but in 2.2.2 it's fired only when the resizing is done (only under windows, under linux it behaves the same as before). However, if I put, say, a panel with top,left,bottom,right anchoring, its OnResize event is fired while resizing. Is there a way to restore the previous behaviour for a form? Bye

Reply by email

Bart
to Luca Olivetti: With Lazarus 2.0.12 the OnResize event for a form was fired while resizing, but in 2.2.2…
AM Luca Olivetti wrote 5 lines
With Lazarus 2.0.12 the OnResize event for a form was fired while resizing, but in 2.2.2 it's fired only when the resizing is done (only under windows, under linux it behaves the same as before). However, if I put, say, a panel with top,left,bottom,right anchoring, its OnResize event is fired while resizing.

IIRC then this was fixed in main (and hopefully merged to fixes).

Bart

Reply by email