Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 16 of 16 total
Thread sticky elements and visual inheritance
Fri, Jun 22 2018 3:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< Sure I scroll the form. I'm amazed at how this is done internally in such a way that the browser does not even suspect that something is scrolling inside it. I need to dig into the sources to answer this, but I have no free time for the moment. >>

There are a *lot* of layers of scrolling in EWB. Smile

There's the browser viewport scrolling, controlled by this component:

https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2&comp=TViewport

via the Application.Viewport instance.

Under that you have the TSurface instance, which is effectively the body element for the application HTML, and that is controlled via the Application.Surface instance:

https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2&comp=TSurface

You can actually put controls directly on the surface at run-time, as well as control the size of the surface.  The size of the surface controls how the viewport behaves with respect to scrolling: if the size of the surface is larger than the viewport in any dimension, then the viewport will show scrollbars if the Overflow* properties are set accordingly.

Under that you have the forms and other controls, and each of those can have scrollbars and scrolling support.

Tim Young
Elevate Software
www.elevatesoft.com
Sat, Jun 23 2018 1:54 PMPermanent Link

ooptimum

Thank you for the explanations. I surprisingly learned a lot from these little pieces of code. These examples should definitely be distributed with the program.
Sat, Jun 23 2018 8:02 PMPermanent Link

ooptimum

Uli, I believe I did everything you suggested, but still I cannot make the embedded form scrolling. The bottom panel also was always visible at the bottom of browser viewport, so I removed it completely. Could you, please, check what I missed?


Uli Becker wrote:

Just put a menu bar, a BasicPanel (for the inner part) and the bottom panel on your main form.
Then

MyPageForm1.Parent := MainForm.InnerPanel
or
MyPageForm2.Parent := MainForm.InnerPanel;

Setting the inner panel's property Autosize.height will make sure there is enough space for the embedded form. (Don't forget to set the Layout.Consumption property of the embedded form.)
Using EWB's fantastic layout functionality will control the bottom panel's position.



Attachments: multiform.zip
Sun, Jun 24 2018 6:06 AMPermanent Link

Uli Becker

> Uli, I believe I did everything you suggested, but still I cannot make the embedded form scrolling. The bottom panel also was always visible at the bottom of browser viewport, so I removed it completely. Could you, please, check what I missed?

If you don't want the bottom panel to be always visible at the bottom, you have to work with layouts to make sure that the bottom panel sticks under the embedded form.

In you sample project you set the TemplatePage.Scrollbar property. That doesn't make sense, because you want to scroll the embedded form (HomePage), not the TemplatePageForm.

Looking at your sample I'd suggest to use a TScrollPanel component as container for the HomePageForm *and* the bottom Panel.

I modified your project:

1. ContentPanel: replaced TBasicPanel by TScrollPanel (ScrollBars=sbVertical)
2. HomePage: changed Layout.Stretch from lsBottomRight to lsRight (very important, otherwise scrolling does not work, because the size matches its container).
3. New BottomPanel with Parent = ContentPanel. Layout.Position = lpTopLeft (!)
4. Setting LayoutOrder of the EmbeddedForm = 0 after setting its parent to ContentPanel so that BottomPanel sticks under the embedded form.

Is that what you want?

Uli



Attachments: multiform_modified.zip
Sun, Jun 24 2018 7:09 AMPermanent Link

ooptimum

Yes, it is. Thank you very much.

Uli Becker wrote:

Is that what you want?
Mon, Jun 25 2018 3:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< Thank you for the explanations. I surprisingly learned a lot from these little pieces of code. These examples should definitely be distributed with the program. >>

You can find small examples like this here:

https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_demos

I'll put this one up there shortly, and I'm going to be moving more of these small examples into the standard examples with EWB 3.

I recently did a page transitions example that is posted there, also.  You can run it here:

https://www.elevatesoft.com/ewb2/pagetransitions/project1.html

You click on the tool icon to bring up a sub-panel using animation.

Tim Young
Elevate Software
www.elevatesoft.com
Previous PagePage 2 of 2
Jump to Page:  1 2
Image