Sie sind nicht angemeldet.

1

Samstag, 26. Februar 2011, 17:38

Action to switch interface on/off depending on the starting state

Hi,

I'm trying to make an action to switch on/off the whole interface. The problem is that some elements of the interface (only "banner", in this case) can already be either on or off and I want to keep them in an "off" state when switching everything on/off or to switch them on/off along with all the elements when they start in an "on" state.
"nadirlogo", "panobar", "controlbar" are not a problem because they all start in the same state, that is "visible,true".

Is this possible?
So I started from here but obviously it's only partially working:

Quellcode

1
	<plugin name="switch" keep="true" zorder="1" align="bottomleft" x="20"  y="20" style="options"  crop=  "0|0|20|20" onovercrop=  "0|20|20|20" ondowncrop=  "0|40|20|20" onhover="showtext(get(Switch));" onclick="action(switchoff);" />


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    <action name="switchon">

        set(plugin[banner].visible,true);

        set(plugin[nadirlogo].visible,true);
        set(plugin[panobar].visible,true);
        set(plugin[controlbar].visible,true);

        set(plugin[switch].onclick,action(switchoff););

    </action>
    <action name="switchoff">

        set(plugin[banner].visible,false);

        set(plugin[nadirlogo].visible,false);
        set(plugin[panobar].visible,false);
        set(plugin[controlbar].visible,false);

        set(plugin[switch].onclick,action(switchon););

    </action>


Regards,
Marco
Marco

2

Samstag, 26. Februar 2011, 18:26

make an action using IF statements to check whether the plugin is already visible or not.

3

Samstag, 26. Februar 2011, 18:56

I already tried using the IF statements but wasn't successful because the problem is not "whether the plugin is already visible or not", rather "whether the plugin was already visible or not" before changing the state.

I mean, if the banner plugin starts in "off" state, I don't want it to turn on/off when switching all the elements already "on". I just want to keep it "off" in this case.
While, if the banner plugin starts in "on" state, I want it to turn on/off along with all the elements.

And, when I say starts in "on" or "off" state it is not necessarily after loading the pano for the first time.

Is this possible?
*confused*
Regards,
Marco
Marco

4

Freitag, 4. März 2011, 09:39

Hi,

you could add any custom attributes to the <plugin> tags and then check for them or change them as you want,

e.g. here a custom attribute "state":

Quellcode

1
2
3
<plugin ... state="on" ... />
...
if(plugin[...].state == on, set(plugin[...].state,off); ... );


best regards,
Klaus