A Question about a WebContainers width and height

Does the width of the WebContainer grow as you embed WebControls in it?
I know it gets scroll bars automatically, but does the width change from that which was set within the ide when you put it on the WebPage?

I’m embeding WebContainers in a WebContainer.
The Parent Container is given a size in the ide and has locks to the webpage its on.
If you embed a control whose position is outside the viewable area then scroll bars appear.
However the Width and Height of the Control do not change.
So how do you know the ‘bounding box’ of all the objects within that control?
Must you keep track of it yourself?
Am I missing a property?

When you embed a WebContainer at runtime you set Width and Height properties of the container with the EmbedWithin method.
Prior to embed the container you can set the locks on the container itself as required and the ScrollbarsVisible property lets you control the scrollbars behaviour.

For example you if create a WebContainer with only a WebButton in it with all sides locked you have a WebButton that you can resize at runtime using the WebContainer size indicated to the EmbedWithin method.

Usually you use scrollbars and set them enabled when the WebContainer is larger than the available space and/or you wanna have a scrollable area within a view (WebPage or another WebContainer).

All of my webapps are made of a single empty WebPage with WebContainers embedded and removed at runtime.
To me this workflow it’s the fastest and flexible.

Best regards.

Thanks, but perhaps I wasn’t clear.
I am embedding controls at run time within the control.
I could at that time keep track of the rightmost, bottom most control and knowing its width and height know the bounds of the control. i.e. what are the co-ordinates of the container controls bottom right pixel …
I can keep track of this if I must, but must I? Is there a property? If there isn’t then how does the container control know how to operate scroll bars such as to stop them at the right bottom?

The scroll bars are added by the browser itself if the width/height of the contents overflow the size of the container in any way. This is not a function of the Xojo framework, so there is no “knowledge” to be had.

But if you ask for the width and height of the container you get the size of the viewable portion.
but when there are objects out of that area you don’t get the right size.
If you set the size to bound all embedded objects the scroll bars disappear.
So what ARE the dimensions when the scoll bars are enabled?

Maybe the size of the container as defined when created in the IDE?
dim dc As MyContainer = new Mycontainer
dc.height and dc.width are the size of the container as when created.
You can change these values when using EmbedWithin.

[quote=195758:@Brian O’Brien]But if you ask for the width and height of the container you get the size of the viewable portion.
but when there are objects out of that area you don’t get the right size.
If you set the size to bound all embedded objects the scroll bars disappear.
So what ARE the dimensions when the scoll bars are enabled?[/quote]

ContainerControl1.Width, ContainerControl1.Height. Like any other control…

No. Not if the scroll bars are visible.

I see. You want the width without the scroll bar. This is not available even in JavaScript. The JavaScript element is a whole, and has no notion of bound or innerwidth. Would it not be sufficient to simply subtract the width of the scrollbar of 15 px ?

lol… No! :slight_smile: I need the position of the rightmost, bottom most embedded objects bottom right corner! :slight_smile:

Let me understand. You are not talking about the size of the instance, but about the position of controls you have placed onto the WebContainer ?

You know they say a picture paints a thousand words well if this doesn’t do it… nothing will! :slight_smile:

[quote=196084:@Brian O’Brien]https://cvws.icloud-content.com/B/AQaJr_fC32dbYuGBwAF8uOfXvZBJAdYXmuhEhNe08cZAMQ16BN38V0M3/WebContainerSizeQuestion.png?o=Aj7V3L9WZ0O7bIqdS4ObgO3SvDoKGSNw_PGUdN4a_8bI&v=1&x=3&a=BSD2HSC3A4PzA2DsKw&e=1435017594&k=IeFu8n2gfc07QgU3EmxNGg&fl=&r=18f8bc91-13de-efc0-dd04-9a5648e7e227-2&ckc=com.apple.clouddocs&ckz=com.apple.CloudDocs&z=https%3A%2F%2Fp01-content.icloud.com%3A443&s=epcGLziFB4vL0vWkhyI71j082pg&cd=i

You know they say a picture paints a thousand words well if this doesn’t do it… nothing will! :)[/quote]

Your picture does not show. I tried to copy the very long URL that is under your image link but all I get in the browser is “gone”.

You are the one asking for assistance. If you make it impossible to help, one might as well tend to something else. Good luck. (LOL)