View Full Version : Fill remaining space in container with Commandbutton
lianjascottking
2016-12-16, 11:14
Suppose I have a container with a vertical layout and a number of controls. Finally, I add a Commandbutton to the container and would like the height and width of the CommandButton to fill the remaining space in the container. What settings do I need to use on the Commandbutton to get that to happen?
Thanks,
Scott
josipradnik
2016-12-16, 12:52
Hi Scott,
Something like this in custom section?
proc page1_section1
page1_section1 = createobject("page1_section1")
page1_section1.addobject("viewport","container")
viewport.layout ="V"
viewport.addObject('textbox1', 'textbox')
viewport.addObject('textbox2', 'textbox')
page1_section1.addobject("viewport2","container")
viewport2.addObject('mybutton', 'commandbutton')
mybutton.autosize = 1
mybutton.backcolor = "blue"
return page1_section1
Add a containter last, then commandbutton inside it, with autosize=1
See more info about containers: http://www.lianja.com/community/showthread.php?2749-Answers-Container
Josip
hmischel@diligentsystems.com
2016-12-17, 18:56
Hi Scott,
In some cases, I do what Josip mentioned, and in other cases, I use the grid layout.
See Barry's post here.
http://www.lianja.com/community/showthread.php?3611-Grid-layouts-in-Lianja-3-1&highlight=layout+%3D%27Grid%27
Herb
barrymavin
2016-12-17, 20:01
Hi Scott,
In some cases, I do what Josip mentioned, and in other cases, I use the grid layout.
See Barry's post here.
http://www.lianja.com/community/showthread.php?3611-Grid-layouts-in-Lianja-3-1&highlight=layout+%3D%27Grid%27
Herb
Hi Herb,
Indeed, custom grid layouts are extremely powerful and they work very well for web and mobile apps too. In Lianja 4.0 form sections will be able to be laid out using a grid layout. Basically, you check the "Custom Grid layout" section attribute then you specify the row, column, nrows and ncolumns for each formitem (field and gadget). This provides responsive formitem positioning and you can also specify fixedheight and fixedwidth for each individual formitem as well.
hmischel@diligentsystems.com
2016-12-18, 10:54
Wow - Thats fantastic Barry!
Yes, this is just what the "domain programmer" market needs: creating flexbox-type UI without the hassle and learning curve and inevitable edge cases that block progress. Since my clients are domain programmers, I am super-excited about this. It's the last piece of the Lianja puzzle for domain programmers that I needed.