VLF-ONE Vertical Scrolling

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE Vertical Scrolling

Post 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 6237 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 6237 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 6237 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.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: VLF-ONE Vertical Scrolling

Post 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
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE Vertical Scrolling

Post 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
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: VLF-ONE Vertical Scrolling

Post by Stewart Marshall »

Thanks Joe
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply