Hi Alex,
Alex Back schrieb:
> calling setAppearance() resets those properties to its defaultValue which are
> defined in the original appearance but not in the new appearance.
> Let me explain this mechanism with your label example.
>
> The original "label"-appearance in the Classic appearance-theme defines wrap
> as "false". Your new "link-ref" appearance does not define the wrap property.
> The defaultValue for the "wrap"-property is "true".
>
> In this case the call of "setAppearance" leads to following behaviour:
> 1. get the property values from the new appearance (->"link-ref")
> 2. if an original appearance exists, get also the original values (-> "label")
> 3. reset all properties to their default value which are defined in the
> original appearance ("label"), but not defined in the new appearance
> ("link-ref")
> 4. set the properties defined in the new appearance
>
> The third step is important in your case. You did not define any value
> for "wrap" in your appearance, so the widget gets resetted to its
> defaultValue.
>
> I hope this explanation did answer your question ;-)
Yes, indeed, but it raises two other ones ;-)
First, there is also an appearance "label" in our appearance theme, that
sets "wrap" to false in the "initial" part. This does not explain why
wrap is set to true - or am I again missing something?
Our theme is a modified copy from qooxdoo that inherits from
qx.renderer.theme.AppearanceTheme.
Second, what is the reason for this strategy? It appears to contradict
my intuition for two reasons:
1. By defining a new appearance in the appearance theme, I expect to
start from zero, otherwise I could inherit properties using
vTheme.initialFrom("label")
2. By calling a method named "setAppearance", I expect to overwrite the
old property, hence also the old behavior, otherwise the method should
be called "mergeAppearance".
But maybe I just don't understand the appearance concept completely...
Thanks a lot,
Ralf
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel