TOPIC: Layout Manager Showdown
#1836
Layout Manager Showdown 7 Months ago
The layout bellow is an attempt to replicate this:

weblogs.java.net/blog/2006/10/11/layout-manager-showdown

Code:


Controller
{
Title: 'Address Book Demo'
New(@args)
{
super(@args)
.Window.ResizeToMin()
}
Controls: #(Border (
Horz
(Vert xmin:200 //xstretch:80
(List )
)
Skip
(Vert
(Grid (
((Static 'Last Name') (Field) Skip 
(Horz (Static 'First Name') Skip (Field xstretch:1) span:2))
((Static 'Phone') (Field) Skip 
(Horz (Static 'Email') Skip (Field  xstretch:1) span:2))
((Static 'Address1') (Field xstretch:1, span: 4))
((Static 'Address2') (Field xstretch:1, span: 4))
((Static 'City') (Field))
((Static 'State') (Field) Skip (Static 'Postal Code') (Field))
((Static 'Country') (Field))
)
//xstretch:1
)
Skip
(Center (Horz (Button 'New')
Skip (Button 'Delete')
Skip (Button 'Edit')
Skip (Button 'Save')
Skip (Button 'Cancel')
))
)
)
)
}

 
 
Last Edit: 2010/01/18 23:56 By mingodad.
 
#1837
Re:Layout Manager Showdown 7 Months ago
The picture !
 
 
Last Edit: 2010/01/19 00:00 By mingodad.
 
#1838
Re:Layout Manager Showdown 7 Months ago
The picture !
 
 
#1841
Re:Layout Manager Showdown 7 Months ago
Cool! Looks good!
 
 
#1844
Re:Layout Manager Showdown 7 Months ago
Should be able to get the middle column prompts right aligned the same as their example by using a FormControl although that won't stretch the way they describe.

Maybe someone at Axon can take a stab at this? (I would, but I'm on holidays)
 
 
Last Edit: 2010/01/20 19:07 By andrew.
 
andrew
 
#1852
Re:Layout Manager Showdown 7 Months ago
I'll take a look and see what I can come up with.

Jason
 
 
Jason Elias
Suneido Software
 
#1854
Re:Layout Manager Showdown 7 Months ago
I think I've managed to address two of the three things that, from the specs on the showdown page, were still not addressed in mingodad's code above. Specifically, I now have the text all right aligned against the text fields (w/ the use of PairControl), as well as the buttons are now "stuck" to the bottom of the text fields (ie. when resizing vertically, the list expands but the buttons stay put) by sticking both the text fields (Grid) and buttons within a Form.

(Ironically, it was the fact that Form doesn't handle stretching properly that helped this scenario, but hindered stretching both list/text fields simultaneously)

What I wasn't able to properly address, either with Form or GridControl, was handling the stretch of both the list and text fields simultaneously when resizing horizontally. I'm not sure what else could be done or if there was something I missed, besides actually making changes to the way either of those controls work to allow for this behaviour. Outside of either of these two controls, I can get the list and text fields resizing/stretching together to take the same amount of space, although then writing code to make the layout line up consistently becomes a nightmare.

Code:


Controller
{
Title: 'Address Book Demo'
New(@args)
{
super(@args)
.Window.ResizeToMin()
}
Controls: #(Border
(Horz
(Vert xmin:200
(List))
Skip
(Form (Vert
(Grid
(
((Pair (Static 'Last Name') (Field))
(Pair (Static 'First Name') (Field)))
((Pair (Static 'Phone') (Field))
(Pair (Static 'Email') (Field)))
((Pair (Static 'Address1') (Field xstretch:1) span:2))
((Pair (Static 'Address2') (Field xstretch:1) span:2))
((Pair (Static 'City') (Field)))
((Pair (Static 'State') (Field))
(Pair (Static 'Postal Code') (Field )))
((Pair (Static 'Country') (Field)))
))
Skip
(Center
(Horz (Button 'New')
Skip (Button 'Delete')
Skip (Button 'Edit')
Skip (Button 'Save')
Skip (Button 'Cancel')
)
)) xstretch:1
)
)
)
}

 
 
Last Edit: 2010/01/23 00:25 By jpe.
 
Jason Elias
Suneido Software