Going mad with conditionnal visibility
#1
Hi, I am trying to recreate a Play/pause button for the diaporama, and I get some trouble when I want pause or play icons to disapear

The "play" button must always be ON when we reach the page. And this page (slideshow.xml) is reached when clicking on a file, in the file brownser.
So, to try to "initialyse the value" ---- Visible_first_time ----, on the main page "Home.xml", I have added to the "Picture" menu button :
Code:
    <onclick>Skin.ToggleSetting(Visible_first_time)</onclick>
    <selected>!Skin.HasSetting(Visible_first_time)</selected>

Then, in the "Slideshow.xml" file, I have created two buttons :

Code:
            <control type="button" id="229">
                <description>Play button</description>
                <posx>1104</posx>
                <posy>602</posy>
                <onclick>Play</onclick>
                <visible>[Skin.HasSetting(Visible_first_time)] | [Skin.HasSetting(SlideShow_Paused)]</visible>
                <onclick>!Skin.ToggleSetting(Visible_first_time)</onclick>
                <selected>Skin.HasSetting(Visible_first_time)</selected>
                <onclick>Skin.ToggleSetting(SlideShow_Start)</onclick>
                <selected>!Skin.HasSetting(SlideShow_Start)</selected>
            </control>
            <control type="button" id="230">
                <description>pause button</description>
                <posx>1104</posx>
                <posy>602</posy>
                <onclick>Pause</onclick>
                <visible>!Control.IsVisible(229)</visible>
                <onclick>Skin.ToggleSetting(SlideShow_Paused)</onclick>
                <selected>!Skin.HasSetting(SlideShow_Paused)</selected>
                <onclick>!Skin.ToggleSetting(Visible_first_time)</onclick>
                <selected>Skin.HasSetting(Visible_first_time)</selected>
            </control>

But it does not work. And I do not understand what is wrong Sad Can someone help, please ?
Reply
#2
<onclick>!Skin.ToggleSetting(Visible_first_time)</onclick> isn't valid, try <onclick>Skin.Reset(Visible_first_time)</onclick> or <onclick>Skin.Bool(Visible_first_time)</onclick>
Reply
#3
Hitcher Wrote:<onclick>!Skin.ToggleSetting(Visible_first_time)</onclick> isn't valid, try <onclick>Skin.Reset(Visible_first_time)</onclick> or <onclick>Skin.Bool(Visible_first_time)</onclick>

This is more about chance than really knowing what I did but it works thanks to your precious advice (Skin.SetBool & Skin.Reset)

I'll post tomorrow the solution but it is time to sleep for me now Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Going mad with conditionnal visibility0