Hi
Just wanted to ask what is the best way to handle multiple widgets in script skinshortucts?
For now, I'm trying to do something like so.
Have button with id 406, which opens a new window. There I have a list and buttons.
List shows, list of widgets. Buttons allow to configure them.
In new window, there is a custom button with id 402 which sendClick to button 312, which should allow to set widgetPath but it does not...
The only solution for set widgetPath is use only button with id 312 without this hassle I'm trying to do but this will set widgetPath only once.
Here is a sample of code from script-skinshortcuts.xml
and the template to show widgets
Probably I don't understand this well ^^
Thanks for your help!
Just wanted to ask what is the best way to handle multiple widgets in script skinshortucts?
For now, I'm trying to do something like so.
Have button with id 406, which opens a new window. There I have a list and buttons.
List shows, list of widgets. Buttons allow to configure them.
In new window, there is a custom button with id 402 which sendClick to button 312, which should allow to set widgetPath but it does not...
The only solution for set widgetPath is use only button with id 312 without this hassle I'm trying to do but this will set widgetPath only once.
Here is a sample of code from script-skinshortcuts.xml
<?xml version="1.0" encoding="UTF-8"?>
<window>
<defaultcontrol always="true">313</defaultcontrol>
<controls>
<control type="group">
<centerleft>50%</centerleft>
<centertop>50%</centertop>
<height>880</height>
<width>1800</width>
<animation effect="fade" time="200">VisibleChange</animation>
<include content="DialogBackgroundCommons">
<param name="width" value="1800" />
<param name="height" value="880" />
<param name="header_label" value="Customize main menu items" />
</include>
<control type="list" id="211">
<description>Rules List Control</description>
<left>0</left>
<top>80</top>
<width>550</width>
<height>880</height>
<onup>211</onup>
<onleft>noop</onleft>
<onright>10000</onright>
<ondown>211</ondown>
<scrolltime>0</scrolltime>
<itemlayout width="550" height="70">
<control type="label">
<left>30</left>
<top>12</top>
<right>30</right>
<info>ListItem.Label</info>
<animation effect="fade" start="100" end="50" condition="String.IsEqual(ListItem.Property(skinshortcuts-disabled),True)">Conditional</animation>
<animation effect="slide" end="48" condition="!String.IsEqual(Window.Property(groupname),powermenu)">Conditional</animation>
</control>
<control type="image">
<bordersize>10</bordersize>
<width>70</width>
<height>70</height>
<texture>$INFO[ListItem.Icon]</texture>
<visible>String.Contains(ListItem.Icon,special://skin/extras/icons)</visible>
<visible>!String.IsEqual(Window.Property(groupname),powermenu)</visible>
</control>
<control type="image">
<bordersize>10</bordersize>
<width>70</width>
<height>70</height>
<texture>$INFO[ListItem.Icon]</texture>
<visible>!String.Contains(ListItem.Icon,special://skin/extras/icons)</visible>
<visible>!String.IsEqual(Window.Property(groupname),powermenu)</visible>
</control>
</itemlayout>
<focusedlayout width="550" height="70">
<control type="image">
<texture border="5" colordiffuse="button_focus">common/white.png</texture>
</control>
<control type="label">
<left>30</left>
<top>12</top>
<right>260</right>
<scroll>false</scroll>
<info>ListItem.Label</info>
<textcolor>red</textcolor>
<animation effect="fade" start="100" end="50" condition="String.IsEqual(ListItem.Property(skinshortcuts-disabled),True)">Conditional</animation>
<animation effect="slide" end="48" condition="!String.IsEqual(Window.Property(groupname),powermenu)">Conditional</animation>
</control>
<control type="image">
<bordersize>10</bordersize>
<width>70</width>
<height>70</height>
<texture>$INFO[ListItem.Icon]</texture>
<visible>!String.IsEqual(Window.Property(groupname),powermenu)</visible>
</control>
</focusedlayout>
</control>
<control type="grouplist" id="10000">
<left>0</left>
<top>98</top>
<width>527</width>
<align>right</align>
<itemgap>10</itemgap>
<onright>13100</onright>
<onleft>211</onleft>
<onup>Control.Move(211,-1)</onup>
<ondown>Control.Move(211,1)</ondown>
<orientation>horizontal</orientation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,0)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,1)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,2)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,3)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,4)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,5)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,6)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,7)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,8)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,9)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,10)">Conditional</animation>
<animation effect="slide" end="0,70" condition="Integer.IsGreater(Container(211).Position,11)">Conditional</animation>
<control type="button" id="302" description="Delete">
<width>32</width>
<height>32</height>
<font/>
<texturenofocus>buttons/cross.png</texturenofocus>
<texturefocus colordiffuse="red">buttons/cross.png</texturefocus>
</control>
<control type="button" id="301" description="Add">
<width>32</width>
<height>32</height>
<font/>
<texturenofocus>buttons/plus.png</texturenofocus>
<texturefocus colordiffuse="red">buttons/plus.png</texturefocus>
</control>
<control type="button" id="303" description="Up">
<width>32</width>
<height>32</height>
<font/>
<texturenofocus flipy="true">buttons/down.png</texturenofocus>
<texturefocus colordiffuse="red" flipy="true">buttons/down.png</texturefocus>
</control>
<control type="button" id="304" description="Down">
<width>32</width>
<height>32</height>
<font/>
<texturenofocus>buttons/down.png</texturenofocus>
<texturefocus colordiffuse="red">buttons/down.png</texturefocus>
</control>
</control>
<control type="group" id="11000">
<left>550</left>
<top>80</top>
<control type="grouplist" id="13100">
<onleft>10000</onleft>
<onright>211</onright>
<width>1250</width>
<height>880</height>
<itemgap>0</itemgap>
<orientation>vertical</orientation>
<control type="togglebutton" id="313" description="Enable/Disable">
<label>$LOCALIZE[24022]</label>
<altlabel>$LOCALIZE[24021]</altlabel>
<include>DialogSettingButton</include>
</control>
<control type="button" id="401" description="Choose Shortcut">
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="402" description="Choose Widget">
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<label>$LOCALIZE[31175]</label>
<label2>$INFO[Container(211).ListItem.Property(widgetPath)]</label2>
<onclick>SendClick(312)</onclick>
<include>DialogSettingButton</include>
<visible>String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="307" description="Action">
<label>$LOCALIZE[31267]</label>
<label2>$INFO[Container(211).ListItem.Property(Path)]</label2>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="305" description="Label">
<label>$LOCALIZE[31268]</label>
<label2>$INFO[Container(211).ListItem.Label]</label2>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
</control>
<control type="button" id="306" description="Icon">
<label>$LOCALIZE[31173]</label>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.IsEqual(Window.Property(groupname),powermenu)</visible>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="312" description="Widget Path">
<include>DialogSettingButton</include>
<visible>false</visible>
</control>
<control type="button" id="406" description="Widgets">
<label>$LOCALIZE[31172]</label>
<visible>String.IsEqual(Window.Property(groupname),mainmenu)</visible>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="405" description="Submenu">
<label>$LOCALIZE[31170]</label>
<visible>String.IsEqual(Window.Property(groupname),mainmenu)</visible>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="310" description="Background">
<label>$LOCALIZE[31171]</label>
<label2>$INFO[Container(211).ListItem.Property(background)]</label2>
<visible>String.IsEqual(Window.Property(groupname),mainmenu)</visible>
<visible>!String.IsEqual(Container(211).ListItem.Property(skinshortcuts-disabled),True)</visible>
<include>DialogSettingButton</include>
<visible>!String.EndsWith(Window.Property(groupname),.1)</visible>
</control>
<control type="button" id="308">
<include>DialogSettingButton</include>
<label>$LOCALIZE[31176]</label>
</control>
</control>
</control>
</control>
</controls>
</window>
and the template to show widgets
<other include="widgets">
<!-- We're going to use this template for all widgets with a widgetPath element -->
<condition tag="property" attribute="name|widgetPath" />
<!-- Retrieve the widgetPath and widgetTarget properties -->
<property name="content" tag="property" attribute="name|widgetPath" />
<property name="target" tag="property" attribute="name|widgetTarget" />
<!-- For TV Shows, we want to specify the artwork as the tv show poster, otherwise we'll use the icon -->
<property name="artwork" tag="property" attribute="name|widgetType" value="tvshows">$INFO[ListItem.Art(tvshow.poster)]</property>
<property name="artwork">$INFO[ListItem.Art(poster)]</property>
<controls>
<control type="fixedlist" id="9002">
<orientation>horizontal</orientation>
<top>412.5</top>
<onup>9001</onup>
<onleft>9000</onleft>
<itemlayout width="300" height="400">
<control type="image">
<!-- <include>widgetPosterLayout</include> -->
<texture>$SKINSHORTCUTS[artwork]</texture>
</control>
</itemlayout>
<focusedlayout width="300" height="400">
<control type="image">
<!-- <include>widgetPosterLayout</include> -->
<texture>$SKINSHORTCUTS[artwork]</texture>
</control>
</focusedlayout>
<content target="$SKINSHORTCUTS[target]">$SKINSHORTCUTS[content]</content>
<skinshortcuts>visibility</skinshortcuts>
</control>
</controls>
</other>
Probably I don't understand this well ^^
Thanks for your help!