Atozed Forums
on resize for regions? - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: on resize for regions? (/thread-1124.html)



on resize for regions? - pete@pdmagic.com - 07-07-2019

Standard HTML+JS only provides resize events for windows and frames. However Intraweb also resizes controls using the align functionality.  (e.g. when a splitter is used)

There are a couple of places where I've embedded content that needs to be notified of resize so they can redraw themselves. I've got the following code in one such place:

Code:
window.resize(function(){
          CurDgm.PanZoom.resize();
          CurDgm.PanZoom.fit();
          CurDgm.PanZoom.center();
    });


That code works as expected when the browser is resized.  However, when a splitter is used that causes the containing region to change size, that function will not be called.

Is there an IW event handler I can hook to to call this code when a region changes size?


Thanks!


RE: on resize for regions? - kudzu - 07-22-2019

Did you figure this out yet Pete?


RE: on resize for regions? - Alexandre Machado - 04-15-2022

You can resolve this using this update (or later version eventually):

https://downloads.atozed.com/intraweb/iw15.2.54_BETA2.exe

Then you can add code like this to any IW control which is aligned (and is resized by the splitter). In this case is IWRegion1 region:

procedure TIWForm1.IWAppFormRender(Sender: TObject);
var
js: string;
begin
js := 'var el = IW.$("IWREGION1");' +
'el.OnAfterResize = function (rect) {' +
'alert("IWREGION1 has been resized");' +
'}';
AddToInitProc(js);
end;