Page 1 of 1

VLF-ONE Vertical Scrolling

Posted: Thu Mar 16, 2017 4:17 am
by jyoung
This is related to this post http://vlforum.lansa.com.au/viewtopic.php?f=3&t=1204 but focused on VLF-ONE.

In short, I am really struggling with getting the correct combination of Row(Content, Proportion, Pixel) and Size (ContentHeight, ContentWidthAndHeight) to get the handler to render correctly. Its kinda frustrating as I am spending more time struggling with LayoutItems then writing the actual code for the command. :cry:

If the "nested panels" are all ContentHeightFitWidth what should the Row and Column Units and Size be of parent item to get the command to render and scroll properly?

For example, I have a 3x1 Main Layout for a Command Handler in VLF-ONE.

At (1,1) I have some audit information and is fixed at 30 pixels. At (3,1) I have a save button and is fixed at 30 pixels.

The middle row is what causes me problems, it contains a "container panel" at (2,1) that contains all of my other nested panels.
I put it in a container panel because I swap layouts according to design changes, but the audit and save button is always in the same spot.
The container panel has a 3x4 Layout. All of the panels in the container panel are set to ContentHeightFitToWidth and the container panel itself is set to ContentHeightFitToWidth.

My problem is with the middle row.

If I specify "Content" for the middle row, the last row (save button) goes up to the top and has a height of 10.
content.png
content.png (19.15 KiB) Viewed 6240 times
If I specify "Proportion", the designer looks ok, but when rendered the last row floats over the container panel.
proportion.png
proportion.png (20.53 KiB) Viewed 6240 times
It seems the only way I can get it to display properly is to use exact pixels.
pixels.png
pixels.png (18.96 KiB) Viewed 6240 times
The "size" of the Main Layout is another variable that I don't understand If I set it to none and and the rows are pixels it seems to do okay. If I set to the ContentHeight any the bottom row (3,1) floats over the container panel. If I set to to ContentWidthAndHeight the whole thing collapses into an 80 pixel column.

Using exact pixels does not seem to be the "LANSA" thing to do. I am trying to figure out what the "best practice" is and it seems like using pixels is the only way to get consistent results. Perhaps that's just how it is and I need to deal with it. That's ok as long as I know.

Re: VLF-ONE Vertical Scrolling

Posted: Thu Mar 16, 2017 10:53 am
by Stewart Marshall
Hi Joe

It looks as though you've stumbled up on a bug. There seems to be an issue with a content sized panel if one of the rows on the panel is sized based on its content. We'll have a look in to that.

Fortunately, I think there is simple work around.

The only control that's changing size is the center panel, and the only control that's moving is the save button. So, instead of making the center row get bigger to suit its content, you can use a single row and flow the controls down the page. As the center area gets bigger, the Save button will move because it's position is based on the controls above it.

Change the layout to a single row and column and set the 3 parts to align TopLeft and Flow down, and I think you have the result you're looking for.

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Height(481) Width(968) LayoutManager(#Layout1) Theme(#SYS_THEME<2015LightBlue>)
Define_Com Class(#PRIM_VS.Style) Name(#Style1) BorderTop(3) BorderBottom(0) BorderBrush(#Brush1) BorderLeft(0) BorderRight(0)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(255:11:49)

Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) DisplayPosition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) DisplayPosition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Column(#Column1) Manage(#Panel1) Parent(#Layout1) Row(#Row1) Alignment(TopCenter)

Define_Com Class(#PRIM_TBLO) Name(#Layout2)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutRow1) DisplayPosition(1) Parent(#Layout2)
Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutColumn1) DisplayPosition(1) Parent(#Layout2)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem2) Alignment(TopLeft) Column(#LayoutColumn1) Manage(#Label2) Parent(#Layout2) Row(#LayoutRow1) Sizing(None) Flow(Down) MarginLeft(4) MarginTop(4)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem3) Alignment(TopLeft) Column(#LayoutColumn1) Manage(#Center) Parent(#Layout2) Row(#LayoutRow1) Sizing(FitToWidth) Flow(Down) MarginLeft(4) MarginTop(4) MarginRight(4)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem4) Alignment(TopLeft) Column(#LayoutColumn1) Manage(#Button1) Parent(#Layout2) Row(#LayoutRow1) Sizing(None) Flow(Down) MarginLeft(4) MarginTop(4)

Define_Com Class(#PRIM_PANL) Name(#Panel1) DisplayPosition(1) Left(0) Parent(#COM_OWNER) TabPosition(1) TabStop(False) Top(0) Height(481) Width(968) ThemeDrawStyle('AlternateItem') VerticalScroll(True) LayoutManager(#Layout2)
Define_Com Class(#PRIM_LABL) Name(#Center) Caption('Big Fixed Size Center ') DisplayPosition(3) Ellipses(Word) Height(304) Left(4) Parent(#Panel1) TabPosition(1) TabStop(False) Top(49) VerticalAlignment(Center) Width(960) Alignment(Center) ThemeDrawStyle('MediumTitle+Title')
Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Save') DisplayPosition(4) Left(4) Parent(#Panel1) TabPosition(2) Top(357) Width(145)
Define_Com Class(#PRIM_LABL) Name(#Label2) Caption('Header Row') DisplayPosition(2) Ellipses(Word) Height(41) Left(4) Parent(#Panel1) TabPosition(3) TabStop(False) Top(4) VerticalAlignment(Center) Width(201) Alignment(Center) ThemeDrawStyle('Heading1+DarkTitle')
Define_Com Class(#xDemoNumber.SpinEdit) Name(#CenterHeight) DisplayPosition(1) Left(8) Parent(#Panel1) TabPosition(4) Top(56) Height(29) Caption('Center Height')

Evtroutine Handling(#Com_owner.CreateInstance)

#CenterHeight := #Center.Height

Endroutine

Evtroutine Handling(#CenterHeight.Changed)

#CenterHeight := #CenterHeight.Max( 0 )

#Center.Height := #CenterHeight

Endroutine

End_Com
Regards

Re: VLF-ONE Vertical Scrolling

Posted: Fri Mar 17, 2017 12:47 am
by jyoung
Stewart, that is why you are the man!

I did not even think of that. I spent the better part of the day working that layout and with your suggestion had it working an a few minutes.

Thanks for your continued help and support!

Joe

Re: VLF-ONE Vertical Scrolling

Posted: Fri Mar 17, 2017 11:05 am
by Stewart Marshall
Thanks Joe