According to the FastScript specs: https://www.fast-report.com/public_download/fs_en.pdf, then there's a "OnCanResize" and a "OnResize" events available.
The OnResize" works, but is fired too late for my use.
According to web documentation, then "OnCanResize" works like this: "Use OnCanResize to adjust the way a control is resized. If necessary, change the new width and height of the control in the OnCanResize event handler. The OnCanResize event handler also allows applications to indicate that the entire resize should be aborted."
this is exactly what I need, but when I implement it Webuilder crashes with this exception message: List index out of bounds (1). (Doesn't matter if there's no action performed in the callback function. It always crashes.)
- Code: Select all
var PSForm = new TForm(WeBuilder);
PSForm.ClientHeight = 200;
PSForm.ClientWidth = 220;
PSForm.Position = poScreenCenter;
PSForm.BorderStyle = bsSizeable;
PSForm.BorderIcons = biSystemMenu;;
PSForm.OnCanResize = "OnCanResize";
function OnCanResize(Sender) {
// This callback function makes Webuilder crash.
// Even if there's no actions performed here!
//Sender.Width = max(Sender.Width, 600);
//Sender.Height = max(Sender.Height, 600);
}
Edit: Got it working. Callback handler needed 3 more parameters besides Sender.
http://docwiki.embarcadero.com/Librarie ... esizeEvent