> Has there been any thought to regularizing the patchwork of layout properties 
> in Pivot?  

I don't consider it a "patchwork". A lot of thought went into the design of 
Pivot's layout system. And for the record, insulting the design of a system 
that has been developed entirely by volunteers in their spare time is not the 
most effective way to ask for help.

> Suppose I want to display a photo centered in a pane, and put a paragraph of 
> text under it.  I want the photo to display in a 150x150 square, no matter 
> what its original size or shape was:
> 
> <BoxPane orientation="vertical" styles="{fill:true}">  
>   <ImageView bxml:id="imgPhoto" 
>     preferredWidth="150" preferredHeight="150" 
>     styles="{fill:true, horizontalAlignment:'center'}" />
>   <Label styles="{wrapText:true}" text="...Some long paragraph..." />
> </BoxPane>
> 
> So far, so good.  Now I decide I'd like the photo to have a nice border 
> around it, so I try:
...
> <BoxPane orientation="vertical" styles="{fill:true}">  
>   <BoxPane styles="{horizontalAlignment:'center'}">
>     <Border preferredWidth="150" preferredHeight="150" 
>       styles="{color:'gray', thickness:4, cornerRadii:10}">
>       <ImageView bxml:id="imgPhoto" styles="{fill:true}" />
>     </Border>
>   </BoxPane>  
>   <Label styles="{wrapText:true}" text="...Some long paragraph..." />
> </BoxPane>
...
> Am I missing something?  Is there an easier way?

I might put the BoxPane in the Border rather than the other way around. You 
might also consider using TablePane as your outer container instead of BoxPane.

> This is an area where WPF seems much more organized to me.  Instead of 
> Pivot's incomplete set of choices of which components have alignment 
> properties, and how you specify that a component should fill the available 
> space, *all* visual components have HorizontalAlignment and VerticalAlignment 
> properties.  

We chose not to add such properties to Pivot's Component class because they do 
not apply to all containers and because they would add complexity to those 
layout containers that could theoretically support them. We chose instead to 
create a small set of focused layout containers that could be combined in 
various ways to achieve a wide variety of layouts.

> This is an area where WPF seems much more organized to me.  Instead of 
> Pivot's incomplete set of choices...

Again, insulting. And for what it's worth, I'm not sure I'd hold up WPF as an 
example of good design. Sure, there are a lot of great ideas in there, but 
WPF/XAML is an enormous beast that, in my opinion, is far more difficult to 
master than Pivot/BXML.

G


Reply via email to