On 12/20/2009 1:49 PM, Allison and Chip Orange wrote:
can anyone give me an explanation as to the differences between the "align"
property and the "justify" property?  can't say that there's very much in
the help file, and what there is defines these terms in terms of themselves
(e.g. the justify controls justification).

"Align" applies to the children. When you say align="right", you are saying "place this control or group at the right edge of its containing group." (Note that that only makes sense if the containing group is oriented vertically, but we won't stop you from trying it in a horizontal group because at the time we parse the control we might not know the orientation of its parent group. When we attempt to place the control, though, we'll ignore alignment that's incompatible with the parent's orientation.)

There's also a "childalign" property, which applies to groups. Saying childalign="right" means "set the default alignment for all children of this group to right." Again, right/left alignment are valid for vertical groups, and top/bottom alignment are valid for horizontal groups. Center alignment is, of course, valid for both types. (In this case, we know that right alignment isn't compatible with horizontal groups, and we know that the group you're saying it in is so oriented, so we'll assume you meant to say "bottom".)

The best example of a dialog with right alignment I can think are the various tabs in the System control panel in Windows XP, where all of the buttons are aligned at the right edge of their containing groups.

Finally, there's "justify". "Justify" applies to groups, too, but it's subtly different. If you say justify="right" you are saying "if there's extra space in this group, put it at the left side so that all of the controls in this group pile up against the right edge." The important distinction is this: right/left justification applies to horizontal groups, unlike right/left alignment. Similarly, top/bottom justification applies to vertical groups, and center justification again applies to both. Note that there's a sixth option for justification: "full". That says "if there's extra space in this group, split it up between all of the controls so that the leftmost control is at the left side of the group and the rightmost control is at the right side of the group and everything else is spread out evenly in between. (or the equivalent for vertically-oriented groups.)"

You'd likely use right justification for the OK/Cancel buttons in a standard Windows dialog, which are typically oriented in a horizontal group at the bottom right corner of the dialog.

Reply via email to