GUI Questions
#1
Hey guys,

I've been trying to get a perfect build of XBMC for my parents for a while now and the one thing I wanted was a script/addon which would allow them to browse some of IMDB and then automatically fetch links to download said movies (decent quality).

Anyway, that aside, as I have never touched python before I found an addon I liked the look of and started ripping it to shreds and modifying it. Over the last 3 days I finally got a grasp on the basics of WindowXML and python so started coding it (still using the other addon as a base template). I'm using onmytv as a guide.

Strike question 1, solved it as I was posting.

Question 2:
Code:
        <control type="list" id="20">
            <description>Show Listing</description>
            <posx>230</posx>
            <posy>55</posy>
            <width>410</width>
            <height>495</height>
            <orientation>vertical</orientation>
            <visible>true</visible>
            <onleft>15</onleft>

            <itemlayout width="720" height="70">
                <control type="image">
                    <posx>0</posx>
                    <posy>0</posy>
                    <width>400</width>
                    <height>50</height>
                                        <textcolor>60ffffff</textcolor>
                    <texture>list-bg.png</texture>
                </control>
                <control type="label">
                    <posx>10</posx>
                    <posy>0</posy>
                    <width>400</width>
                    <height>20</height>
                                        <textcolor>60ffffff</textcolor>
                    <info>ListItem.label</info>
                </control>
                <control type="label">
                    <posx>10</posx>
                    <posy>15</posy>
                    <width>400</width>
                    <height>20</height>
                    <font>font13</font>
                                        <textcolor>ffffffff</textcolor>
                    <info>ListItem.label2</info>
                </control>
            </itemlayout>

            <focusedlayout width="500" height="70">
                <control type="image">
                    <posx>0</posx>
                    <posy>0</posy>
                    <width>400</width>
                    <height>50</height>
                    <visible>Control.HasFocus(20)</visible>
                    <texture border="5">list-bg-2.png</texture>
                </control>
                <control type="label">
                    <posx>10</posx>
                    <posy>0</posy>
                    <width>400</width>
                    <height>20</height>
                    <info>ListItem.label</info>
                    <scroll>false</scroll>
                </control>
                <control type="label">
                    <posx>10</posx>
                    <posy>15</posy>
                    <width>400</width>
                    <height>20</height>
                    <font>font13</font>
                                        <textcolor>60ffffff</textcolor>
                    <info>ListItem.label2</info>
                </control>
            </focusedlayout>
        </control>

Now, this code may be way wrong, way messy. I don't know, it's almost pulled directly from the other addon (in fact I think it is almost word for word).

When I attempt to use it everything works fine EXCEPT when focus is removed from the list then all images are removed from that item.

So we have a list of:
Item 1
Item 2
Item 3

All items have an image called list-bg.png as their backgrounds. On focus they'll receive list-bg-2.png which is great but if I then hit an arrow key (say left or right) and move to a different list then neither list-bg.png or list-bg-2.png will apply.

My desire was to have list-bg-2.png apply until focus is set to another item in the list but I am not sure how to achieve this.

Can someone provide some assistance please? I've done quite a bit of searching and hit a brick wall.
Reply
#2
The reason is that when you move off the item, Control.HasFocus(20) is no longer true, so the focused item (which is still "focused" even though the control itself doesn't have focus) drops the only image it has. So remove the <visible> condition and list-bg-2.png will stay where it is. Note that you may still wish to actually change the layout a little when you move off the list so that it's clear that the list isn't focused.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Thanks a ton mate, so obvious yet I didn't notice it.
Reply

Logout Mark Read Team Forum Stats Members Help
GUI Questions0