Providing default skin settings
#16
(2014-04-16, 20:21)Hitcher Wrote: Why not use a toggle button if there's only two values?

Because it's not the only place I'm using this approach. Other places have 3 or more values, so a toggle is not the way to go.
I'm trying to understand how (and if) this approach is supposed to be used.

Do you nave any idea why the Skin.Reset() doesn't seem to work?
Code:
Skin.Reset(value)

...later:
condition="IsEmpty(Skin.String(value))"...

This doesn't work, as I've explained. Could it be that Skin.Reset() is meant only for boolean-type variables?
Reply
#17
If it's a boolean then it's sets to false; if it's a string it's set to empty so I've no idea why it's not loading for you.

I use a list for these type of controls.

ie

PHP Code:
<!-- Home -->
<!-- 
Movies sub menu -->
<
control type="list" id="1100">
    <
width>1200</width>
    <
height>66</height>
    <
itemgap>0</itemgap>
    <
onleft>9</onleft>
    <
onright>noop</onright>
    <
onup>noop</onup>
    <
ondown>noop</ondown>
    <
orientation>vertical</orientation>
    <
usecontrolcoords>true</usecontrolcoords>
    <
visible>ControlGroup(9).HasFocus(11)</visible>
    <
scrolltime tween="sine" easing="out">240</scrolltime>

    <
itemlayout width="1200" height="66">
    </
itemlayout>
    <
focusedlayout width="1200" height="66">
        <
control type="label">
            <
width>1120</width>
            <
height>66</height>
            <
label>$INFO[ListItem.Label]</label>
            <
textcolor>DialogColor2</textcolor>
            <
visible>!Control.HasFocus(1100)</visible>
        </
control>
        <
control type="image">
            <
right>0</right>
            <
width>35</width>
            <
height>66</height>
            <
texture>common\ArrowDownNF.png</texture>
            <
visible>!Control.HasFocus(1100)</visible>
        </
control>
        <
control type="label">
            <
width>1120</width>
            <
height>66</height>
            <
label>$INFO[ListItem.Label]</label>
            <
visible>Control.HasFocus(1100)</visible>
        </
control>
        <
control type="image">
            <
right>0</right>
            <
width>35</width>
            <
height>66</height>
            <
texture>common\ArrowDownFO.png</texture>
            <
visible>Control.HasFocus(1100)</visible>
        </
control>
    </
focusedlayout>

    <
content>
        <!-- 
Off -->
        <
item>
            <
label>Movies sub menu Off</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentUnwatchedMovies)</onclick>
            <
visible>IsEmpty(Skin.String(MovieSubMenu))</visible>
        </
item>
        <!-- 
Recent unwatched movies -->
        <
item>
            <
label>Movies sub menu Recent Unwatched Movies</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentMovies)</onclick>
            <
visible>StringCompare(Skin.String(MovieSubMenu),RecentUnwatchedMovies)</visible>
        </
item>
        <!-- 
Recent movies -->
        <
item>
            <
label>Movies sub menu Recent Movies</label>
            <
onclick>Skin.SetString(MovieSubMenu,InProgressMovies)</onclick>
            <
visible>StringCompare(Skin.String(MovieSubMenu),RecentMovies)</visible>
        </
item>
        <!-- 
In progress movies -->
        <
item>
            <
label>Movies sub menu In Progress Movies</label>
            <
onclick>Skin.Reset(MovieSubMenu)</onclick>
            <
visible>StringCompare(Skin.String(MovieSubMenu),InProgressMovies)</visible>
        </
item>
    </
content>
    
</
control
Reply
#18
(2014-04-16, 22:36)Hitcher Wrote: I use a list for these type of controls.

ie

PHP Code:
<content>
        <
item>
            <
label>Movies sub menu Off</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentUnwatchedMovies)</onclick>
            <
visible>IsEmpty(Skin.String(MovieSubMenu))</visible>
        </
item>
        <
item>
            <
label>Movies sub menu Recent Unwatched Movies</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentMovies)</onclick>
            <
visible>StringCompare(Skin.String(MovieSubMenu),RecentUnwatchedMovies)</visible>
        </
item>
</
content

I notice you use IsEmpty(Skin.String()) and StringCompare(Skin.String()) with <visible> tags. Have you used it somewhere with <include> tags?
To take your example, change it to something like this:

PHP Code:
SomeFile.xml
<content>
    <include 
condition="IsEmpty(Skin.String(MovieSubMenu))">MoviesSubMenu</include>
    <include 
condition="StringCompare(Skin.String(MovieSubMenu),RecentUnwatchedMovies)">RecentUnwatchedMovies</include>
</
content>

Includes.xml
<include name="MoviesSubMenu">
        <
item>
            <
label>Movies sub menu Off</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentUnwatchedMovies)</onclick>
        </
item>
</include>
<include 
name="RecentUnwatchedMovies">
        <
item>
            <
label>Movies sub menu Recent Unwatched Movies</label>
            <
onclick>Skin.SetString(MovieSubMenu,RecentMovies)</onclick>
        </
item>
</include> 
Reply
#19
Not in this skin, I use the following -

PHP Code:
<include condition="StringCompare(Skin.String(MovieSubMenu),RecentUnwatchedMovies)">RecentUnwatchedMovies</include>
<include 
condition="StringCompare(Skin.String(MovieSubMenu),RecentMovies)">RecentMovies</include>
<include 
condition="StringCompare(Skin.String(MovieSubMenu),InProgressMovies)">InProgressMovies</include> 
Reply
#20
(2014-04-17, 19:02)Hitcher Wrote: Not in this skin, I use the following -

PHP Code:
<include condition="StringCompare(Skin.String(MovieSubMenu),RecentUnwatchedMovies)">RecentUnwatchedMovies</include>
<include 
condition="StringCompare(Skin.String(MovieSubMenu),RecentMovies)">RecentMovies</include>
<include 
condition="StringCompare(Skin.String(MovieSubMenu),InProgressMovies)">InProgressMovies</include> 

This is exactly what I'm using, but it doesn't work Huh
How do you set this String? With the <visible> technique you posted before?
Reply
#21
Yes.
Reply

Logout Mark Read Team Forum Stats Members Help
Providing default skin settings0