2016-06-25, 19:08
I've read for weeks now and this is as far as ive gotten. i dont understand the wiki or any of the links i've seen
I've created this gui but i dont understand how to link the button controls to another window. or to even make another window. would i change the code to a class or make multiple py files?
default.py
home.xml
if you can help its greatly appreciated. i dont understand the wiki so even if someone would point me in the direction to begin to comprehend the wiki id be greatful.
(ive searched for bout two weeks before i posted seen a few but couldnt comprehend)
I've created this gui but i dont understand how to link the button controls to another window. or to even make another window. would i change the code to a class or make multiple py files?
default.py
Code:
if __name__ == '__main__':
print __scriptname__
import os, sys, xbmcaddon
scriptDir = xbmcaddon.Addon('script.tronwizard').getAddonInfo('path')
sys.path.insert(0, os.path.join(scriptDir, 'resources', 'src'))
import xbmcgui
import xbmc
splash = None
splash = xbmcgui.WindowXML('home.xml', scriptDir)
splash.doModal()
if __name__ == '__build__':
class build(xbmcgui.WindowXMLDialog):
def __init__(self,strXMLname, strFallbackPath, strDefaultName, forceFallback):
# Changing the three varibles passed won't change, anything
# Doing strXMLname = "bah.xml" will not change anything.
# don't put GUI sensitive stuff here (as the xml hasn't been read yet
# Idea to initialize your variables here
pass
def onInit(self):
# Put your List Populating code/ and GUI startup stuff here
pass
def onAction(self, action):
# Same as normal python Windows.
pass
def onClick(self, controlID):
"""
Notice: onClick not onControl
Notice: it gives the ID of the control not the control object
"""
pass
def onFocus(self, controlID):
pass
Code:
<window>
<id>3003</id>
<defaultcontrol>250</defaultcontrol>
<type>window</type>
<coordinates>
<system>1</system>
<posx>0</posx>
<posy>0</posy>
</coordinates>
<controls>
<!-- ============================================= -->
<!-- S C R E E N B A C K G R O U N D -->
<!-- ============================================= -->
<control type="image">
<description>background image</description>
<posx>0</posx>
<posy>0</posy>
<width>1280</width>
<height>720</height>
<texture>bg.png</texture>
</control>
<control type="group">
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<animation effect="fade" time="500" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="fade" time="500" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<control type="image">
<description>Thumbnail BG</description>
<posx>0</posx>
<posy>420</posy>
<width>285</width>
<height>285</height>
<zorder>0</zorder>
<texture>button_nofocus.png</texture>
</control>
</control>
<control type="group">
<description>Content Group</description>
<!-- Copy Window_OpenClose_Right_Panel_Animation -->
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<animation effect="slide" start="1030,0" end="0,0" time="300" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="slide" end="1030,0" start="0,0" time="300" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<!-- ============================================= -->
<!-- C O N T E N T B A C K G R O U N D -->
<!-- ============================================= -->
<!-- Copy of ContentPanel -->
<control type="image">
<posx>285</posx>
<posy>110</posy>
<width>980</width>
<height>580</height>
<texture border="50,0,0,45">vpanel1.png</texture>
</control>
<control type="group">
<posx>305</posx>
<posy>140</posy>
<control type="group">
<visible>true</visible>
<posx>0</posx>
<posy>300</posy>
<!-- ============================================= -->
<!-- Header -->
<!-- ============================================= -->
<control type="image">
<description>table header</description>
<posx>0</posx>
<posy>0</posy>
<width>900</width>
<height>40</height>
<texture flipx="true">mb-header.png</texture>
</control>
</control>
<control type="group">
<visible>true</visible>
<posx>0</posx>
<posy>410</posy>
<!-- ============================================= -->
<!-- Jobs Table Header -->
<!-- ============================================= -->
<control type="image">
<description>jobs table header</description>
<posx>0</posx>
<posy>0</posy>
<width>900</width>
<height>40</height>
<texture flipx="true">mb-header.png</texture>
</control>
</control>
</control>
</control>
<!-- ============================================= -->
<!-- H E A D E R -->
<!-- ============================================= -->
<control type="image">
<description>Header Panel</description>
<posx>0</posx>
<posy>0</posy>
<width>1280</width>
<height>128</height>
<texture>mb-header.png</texture>
</control>
<control type="image">
<posx>40</posx>
<posy>20</posy>
<width>492</width>
<height>90</height>
<texture>logo.png</texture>
<aspectratio align="left">keep</aspectratio>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
</control>
<control type="label">
<description>date/time label</description>
<posx>70r</posx>
<posy>65</posy>
<width>450</width>
<height>35</height>
<align>right</align>
<aligny>center</aligny>
<font>font12</font>
<textcolor>ffffffff</textcolor>
<label>$INFO[System.Date] [COLOR=88FFFFFF] | $INFO[System.Time][/COLOR]</label>
<animation effect="fade" time="200">WindowOpen</animation>
<animation effect="fade" time="200">WindowClose</animation>
</control>
<!-- ============================================= -->
<!-- N A V B U T T O N S -->
<!-- ============================================= -->
<control type="grouplist" id="2000">
<description>Buttons</description>
<posx>0</posx>
<posy>122</posy>
<itemgap>1</itemgap>
<onup>2000</onup>
<ondown>2000</ondown>
<onleft>499</onleft>
<onright>499</onright>
<!-- Copy of include Window_OpenClose_Left_Panel_Animation -->
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="fade" time="200" condition="Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<animation effect="slide" start="-400,0" end="0,0" time="300" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowOpen</animation>
<animation effect="slide" end="-400,0" start="0,0" time="300" tween="quadratic" easing="out" condition="!Skin.HasSetting(Animate_Skin)">WindowClose</animation>
<control type="button" id="250" >
<description>Current Build</description>
<label>Current Build</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<enabled>true</enabled>
<thumb>bg.png</thumb>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="251">
<description>Builds</description>
<label>Builds</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<onclick>splash.doModal()</onclick>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="252">
<description>Addons</description>
<label>Addons</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="253">
<description>Tools</description>
<label>Tools</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="254">
<description>Maintenance</description>
<label>Maintenance</label>
<width>285</width>
<align>left</align>
<textoffsetx>32</textoffsetx> <!-- scrolls if > 32 -->
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="256">
<description>Settings</description>
<label>Settings</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
<control type="button" id="255">
<description>Check For Updates</description>
<label>Check For Updates</label>
<width>285</width>
<align>left</align>
<textoffsetx>33</textoffsetx>
<texturefocus>button_focus.png</texturefocus>
<texturenofocus>button_nofocus.png</texturenofocus>
<pulseonselect>true</pulseonselect>
<enable>!substring(Window.Property(busy),true)</enable>
</control>
</control>
</controls>
</window>
if you can help its greatly appreciated. i dont understand the wiki so even if someone would point me in the direction to begin to comprehend the wiki id be greatful.
(ive searched for bout two weeks before i posted seen a few but couldnt comprehend)