Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a Javascript call
#6
Quote:1. In the first screenshot, I ran it with my browser window maximized.  Everything is properly centered.

Correct

Quote:2. In the second screenshot, I have resized my browser window to its minimum width (500 pixels).  IWRegion1 is still centered, but as you can see the left side is cut off even though the window is scrolled all the way to the left.  There is no way to scroll left to see that part of the IWRegion1, and so this obviously is useless.

This is questionable. It may not be the result that you expect but the region is definitely centered within the available browser window. The fact that you have a horizontal scrollbar gives you access to the right (hidden) part of the region, but not to the left, is because the scroll can't scroll to positions with negative coordinates.
Maybe that's not the result that you would expect, but that's how it is supposed to work.

Quote:So at this point I modified the CenterControlInParent procedure by adding the line "if x < 24 then x := 24;" prior to the AControl.SetBounds call.  Theoretically, this should set the left position of IWRegion1 to 24 any time the browser window is less than 848 pixels wide, but it does not do this at all.  Here is what happens:

This won't work on the server side because the server doesn't actually know that the IWRegion has been repositioned on the browser side.

Quote:3. If the initial size of the browser window is sufficiently large (848 pixels or wider), everything behaves exactly as in 1. and 2. above.  In other words, IWRegion1 will stay centered, but oddly, if the browser window is shrunk smaller than IWRegion1 (say, to 500 pixels), IWRegion1 does NOT anchor at left position 24, but instead gets cut off at the left with no way to scroll to it.

That's basically the same behavior as (2) above.

Quote:4. If the initial size of the browser window is sufficiently small (less that 848 pixels wide), we get the results shown in the third screenshot (500 pixels wide).  Clearly, IWRegion1 is NOT centered, nor is is positioned at the (expected) left position of 24 pixels.  If we then maximize the browser window as seen in the fourth screenshot, you can see that IWRegion1 moves even further right - obviously not centered, nor what we want or expect.

This is not what I'm getting here. I see from the first screen shot that you have an "/$/" in your URL, which shows me that you are using IW 14, not 15.

A gazillion of stuff changed in rendering from 14 to 15 and this is not how it behaves in 15.

However, in IW 15 you will get precisely the same behavior as (2) above.

Quote:The only thing I have been able to determine is that it looks to me like perhaps AControl.Parent.Width does NOT report the true width of the browser window itself, but rather the width that Delphi thinks the form should be.  So if IWRegion1 is 800 pixels wide and is sitting at left = 24 and the browser window then opens with a width of 500 pixels,  AControl.Parent.Width reports back a width of 824 instead of 500, which of course would throw off the centering math, yet even that doesn't match up with the observed behavior.

Again I think this is a difference in behavior of IW 14.

However, you must have in mind that IW reports the form width to be the document's ScrollWidth property which is not the same as the browser window width (similarly with the height).

So, whenever there is a scrollbar visible, the hidden region of the scroll area is also considered as being part of the form (otherwise it wouldn't know how to render outside the visible area).

See how IW 15 behaves when I start the application when the browser window is smaller than my region (attached). In that case I have some code at server size that resizes the region before rendering it.

   

I can see if we can slightly change the behavior in case (2), which I personally agree that is not optimal, but unfortunately nothing that we change can be back ported to IW 14 which has been discontinued. Is moving to IW 15 viable?
Reply


Messages In This Thread
How to make a Javascript call - by DEKETO - 05-09-2022, 05:05 PM
RE: How to make a Javascript call - by kudzu - 05-13-2022, 06:22 PM
RE: How to make a Javascript call - by DEKETO - 05-25-2022, 08:05 PM
RE: How to make a Javascript call - by Alexandre Machado - 05-27-2022, 02:34 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)