Style attribute in a style element

  • Hi,

    I do find it's always annoying to apply several styles to a single element. Example :

    Code
    <hotspot name="whatever" style="style1|style2" ... />


    Especially as I have half my hotspots with 'style1|style2' and the other half with 'style1|style3'. (style1 is like some base style to apply to all my hotspots)


    Krpano documentation says it's possible to have a style in any xml element.

    Let's try inheritance of styles then :


    Code
    <style name="style1" ... />
    <style name="style2" style="style1" .../>

    I would expect that if I apply "style2" somewhere, both "style1" and "style2" would be applied, just like style1|style2.


    So I tested


    Code
    <style name="style1" ... />
    <style name="style2" style="style1" .../>
    <hotspot name="whatever" style="style2" .../>


    and ... it works! "style2" seems to be now working just like a "style1|style2"! => GREAT !


    However, when tracing the hotspot.style content with a simple "trace(hotspot[whatever].style)", it gives me "style1" !?!? it should give me style="style2" for things to be right, as it's what I entered in the xml.

    Is the kind of style inheritance I'm doing supported ? or is it just working "zum Glück"...it's what I suspect...


    Thanks
    PS: it's so close to working fine! just that trace(hotspot[].style) not working...

  • Thanks. I get the point, so it means what I'm doing is not supported.


    Else it should work differently for the style attribute itself, as we have some really weird stuff at the end:

    in the xml

    Code
    <hotspot name="whatever" style="style2"/>

    at the end:

    Code
    trace(hotspot[whatever].style) : "style1"

    (not really true is it?)

    I asked for a style2 hotspot and what I finally have is a style="style1" one (with attributes from style2 though). If I decide to loop on all style2 hotspots, I won't find any, only style1 everywhere!

    Would you have a way round to have at the end trace(ht.style) = "style2" as what I asked for in the xml ?

    Thanks
    (I could do a <hotspot name="whatever" style="sup" realstyle="sup"/>, and onxmlcomplete I could loop on all hotspots/layers and replace style by realstyle...but it looks dirty doesn't it?)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!