pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: How to wrap text and other form problems
Date Fri, 19 Nov 2010 02:58:42 GMT
> Ah, so the problem with my original example is that a vertical BoxPane thinks that it
is infinitely wide until I give it the fill:true style?  No, it can't be that simple, because
even in its absence, BoxPane is able to center- or right-align its contents within the actual
width of its parent.  Or are those independent?  Is there any reason I wouldn't want to always
say fill:true?

A BoxPane will align its contents within the width it is given by its own parent. If "fill"
is set to true, then it will justify rather than align the contents. However, the preferred
size of a BoxPane is independent of either the alignment or "fill" styles. If you want a Label
to wrap in a BoxPane, something must apply a width constraint. This is often the parent of
the BoxPane, but an explicit preferred width can also be set on the BoxPane itself (though
again, in this case, the box pane's parent must be a container that respects preferred size).

>  There are a couple of ways to handle this. Generally, you'd override close(boolean)
and execute your login code if the result is true. In this case, you wouldn't call the superclass
close() method, since you want to prevent the dialog from closing. Once the login succeeds,
you'll call close() again, but call the superclass method to actually close the dialog. 
> Thanks, overriding close is a reasonable approach.  Not quite as simple as you suggest
-- if I just call super.close() when the login succeeds, I seem to get into an infinite close
loop.  I had to add a private flag to set in the login finished code and test in the close

That seems like a reasonable solution. Only your code would know when it is OK to call super.close(),
so a flag is appropriate.

>>> * How do I space the buttons nicely?  . . .
> Not sure exactly what you're envisioning, but maybe you could use a horizontal BoxPane
with "horizontalAlignment='center'"? You can use the "spacing" style to control how much space
is allocated between the buttons.
> Ah, I somehow missed seeing that in the BoxPaneSkin.  That will do.  It will take some
getting used to, this dichotomy between properties and style attributes.

Though Pivot currently provides only one theme, it is designed to support multiple themes
(or "look-and-feels"). Each L&F may provide its own set of styles - however, the properties
of a component (vs. styles) are generally meant to be respected by any skin implementation
for that component. Unfortunately, for components that aren't generally "themeable", like
layout containers, the line between properties and styles is a bit blurry. You might reasonably
argue that the "horizontalAlignment" style of a BoxPane should simply be a property, for example.


View raw message