2012-02-18, 12:29
Hi
I would like to modified DialogOK.xml to DialogWarning.xml and DialogError.xml. I've created xml files (add warning and error icon), but I have no idea how connect it to python code.
The DialogWarning.xml:
If you see I'm using modified DialogOK.xml (I added only icon).
The framework of window is:
Could any of you tell me how I can write a code to using this class as xbmcgui.ok("tittle", "text1", text2", text3")? I would like to use as msg.Warn("title", "text1", text2", text3").
I tried to find answer for my problem by searching of net, but I didn't find any simple examples (understanding for me) to use windowxml/windowxmldialog (get/set id).
Thanks for help
Plesken
I would like to modified DialogOK.xml to DialogWarning.xml and DialogError.xml. I've created xml files (add warning and error icon), but I have no idea how connect it to python code.
The DialogWarning.xml:
Code:
<window>
<defaultcontrol always="true">10</defaultcontrol>
<coordinates>
<system>1</system>
<posx>335</posx>
<posy>230</posy>
</coordinates>
<!--<include>dialogeffect</include>-->
<controls>
<control type="image">
<posx>0</posx>
<posy>0</posy>
<width>610</width>
<height>240</height>
<texture border="40">DialogBack.png</texture>
</control>
<control type="image">
<description>Dialog Header image</description>
<posx>40</posx>
<posy>16</posy>
<width>530</width>
<height>40</height>
<texture>dialogheader.png</texture>
</control>
<control type="image">
<description>Dialog Warning image</description>
<posx>40</posx>
<posy>80</posy>
<width>64</width>
<height>64</height>
<texture>DefaultIconWarning.png</texture>
</control>
<control type="label" id="1">
<description>header label</description>
<posx>40</posx>
<posy>20</posy>
<width>530</width>
<height>30</height>
<font>font13_title</font>
<!--<label>$LOCALIZE[13406]</label>-->
<label></label>
<align>center</align>
<aligny>center</aligny>
<textcolor>selected</textcolor>
<shadowcolor>black</shadowcolor>
</control>
<control type="button">
<description>Close Window button</description>
<posx>520</posx>
<posy>15</posy>
<width>64</width>
<height>32</height>
<label>-</label>
<font>-</font>
<onclick>PreviousMenu</onclick>
<texturefocus>DialogCloseButton-focus.png</texturefocus>
<texturenofocus>DialogCloseButton.png</texturenofocus>
<onleft>10</onleft>
<onright>10</onright>
<onup>10</onup>
<ondown>10</ondown>
<visible>system.getbool(input.enablemouse)</visible>
</control>
<control type="label" id="2">
<description>dialog line 1</description>
<posx>120</posx>
<posy>60</posy>
<width>550</width>
<height>30</height>
<align>left</align>
<aligny>center</aligny>
<label>-</label>
<font>font13</font>
</control>
<control type="label" id="3">
<description>dialog line 2</description>
<posx>120</posx>
<posy>85</posy>
<width>550</width>
<height>30</height>
<align>left</align>
<aligny>center</aligny>
<label>-</label>
<font>font13</font>
</control>
<control type="label" id="4">
<description>dialog line 3</description>
<posx>120</posx>
<posy>110</posy>
<width>550</width>
<height>30</height>
<align>left</align>
<aligny>center</aligny>
<label>-</label>
<font>font13</font>
</control>
<control type="button" id="10">
<description>OK button</description>
<posx>205</posx>
<posy>175</posy>
<width>200</width>
<height>40</height>
<label>186</label>
<font>font12_title</font>
<textcolor>white</textcolor>
<focusedcolor>white</focusedcolor>
<align>center</align>
<onleft>10</onleft>
<onright>10</onright>
<onup>10</onup>
<ondown>10</ondown>
</control>
</controls>
</window>
If you see I'm using modified DialogOK.xml (I added only icon).
The framework of window is:
Code:
class MessageDialog(xbmcgui.WindowXMLDialog):
def __init__(self, strXMLname, strFallbackPath, strDefaultName, forceFallback = 0):
pass
def onInit(self):
pass
def onAction(self, action):
pass
def onClick(self, controlID):
pass
def onFocus(self, controlID):
pass
Could any of you tell me how I can write a code to using this class as xbmcgui.ok("tittle", "text1", text2", text3")? I would like to use as msg.Warn("title", "text1", text2", text3").
I tried to find answer for my problem by searching of net, but I didn't find any simple examples (understanding for me) to use windowxml/windowxmldialog (get/set id).
Thanks for help
Plesken