<onup> conditionals?
#1
Question 
I was wondering if it is possible to add a conditional to <onup>

ie.
<onup>PlayMedia($INFO[ListItem.Trailer],1) condition="Skin.HasSetting(TrailerInfo)"</onup>

and then have another <onup>62</onup>

I am not sure of that would be the correct coding for it, but hopefully it give you an idea of what I am thinking. Any help would be appreciated. Thanks everyone!
Reply
#2
ekim232 Wrote:I was wondering if it is possible to add a conditional to <onup>

ie.
<onup>PlayMedia($INFO[ListItem.Trailer],1) condition="Skin.HasSetting(TrailerInfo)"</onup>

and then have another <onup>62</onup>

I am not sure of that would be the correct coding for it, but hopefully it give you an idea of what I am thinking. Any help would be appreciated. Thanks everyone!

use includes see example below:
Code:
<include name="Trailer">
     <ondown>PlayMedia($INFO[ListItem.Trailer],1)</ondown>
</include>
<include name="Scrollbar">
     <ondown>62</ondown>
</include>

then place this in your wraplist, fixedlist , etc
Code:
<include condition="Skin.HasSetting(TrailerInfo)">Trailer</include>
<include condition="!Skin.HasSetting(TrailerInfo)">Scrollbar</include>
Reply
#3
The problem with that way is the condition will only be true on window load
I personally would have 2 controls with the same id with the right <visible conditions> point the ondown to that id have one do <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus> and the other do <onfocus>Setfocus(62)</onfocus>
Reply
#4
Jezz_X Wrote:The problem with that way is the condition will only be true on window load
I personally would have 2 controls with the same id with the right <visible conditions> point the ondown to that id have one do <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus> and the other do <onfocus>Setfocus(62)</onfocus>

what type of ID should use control group ?, something like

<control type="group" id="61">
<visible>Skin.HasSetting(videomovies) + Skin.HasSetting(movietrailers)</visible>
<onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
</control>

<control type="group" id="61">
<visible>Skin.HasSetting(videotv) + Skin.HasSetting(tvpreview)</visible>
<onfocus>PlayMedia($INFO[listitem.path]$INFO[listitem.filename],1)</onfocus>
</control>

<control type="group" id="61">
<visible>!Skin.HasSetting(movietrailers) | !Skin.HasSetting(tvpreview)</visible>
<onfocus>Setfocus60</onfocus>
</control>


<ondown>61</ondown>
Reply
#5
I haven't had eany luck with either method. Here are my groups I made

<control type="group" id="72">
<visible>!Skin.HasSetting(TrailerInfo)</visible>
<onfocus>Setfocus(61)</onfocus>
</control>
<control type="group" id="72">
<visible>Skin.HasSetting(TrailerInfo)</visible>
<onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
</control>


The window id is 57 and the page control is 61. I placed this just outside of my itemlayout coding and put my ondown to 72. Any suggestions on what I am doing wrong? Thanks everyone.
Reply
#6
I don't really like to bump, but if anyone could help me out with this I would appreciate it. It is driving me crazy because I see what Jezz is saying, but I can't get it to work. I am not sure if I need to adjust my page control and the visibles for that id as well.

I just need a push in the right direction. Much thanks to anyone who can help.
Reply
#7
1. A single group that you can nav to.

2. Have 2 controls inside that group, each with different <onfocus> and <visible> lines.
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
#8
ekim232 Wrote:I don't really like to bump, but if anyone could help me out with this I would appreciate it. It is driving me crazy because I see what Jezz is saying, but I can't get it to work. I am not sure if I need to adjust my page control and the visibles for that id as well.

I just need a push in the right direction. Much thanks to anyone who can help.

finaly figure it out see code below, just bare in mined that when you press down you will be changing focus, so you will have to amend your visbles tag on any item that uses your original control ID to include that new ID's, (in my case it was 52, so i need to add 600 & 601), don't forget about your "MyVidoeNav.xml" as well.

For your info to get it work:
ID 7000 = is the ID of the popup menubar. Change this to your ID

Try this code below for your needs:

Place outside your wraplist
Code:
<control type="button" id="600">
            <visible>Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
            <onleft>57</onleft>
            <onright>57</onright>
            <onup>7000</onup>
            <ondown>601</ondown>
            <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
            </control>

        <control type="button" id="600">
        <visible>!Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
        <onfocus>Setfocus(61)</onfocus>
        </control>

        <control type="button" id="601">
            <texturefocus>-</texturefocus>
            <texturenofocus>-</texturenofocus>
            <onleft>57</onleft>
            <onright>57</onright>
            <onup>7000</onup>
            <ondown>600</ondown>
            <onfocus>PlayerControl(stop)</onfocus>
        </control>

place this inside your wraplist:
Code:
<ondown>600</ondown>
Reply
#9
Yuck. Please don't do multiple controls with the same id unless you absolutely have to.

This is what groups are for! Just have the 2 buttons (any id you like) inside the group with id 600 and it'll just work.

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
#10
jmarshall Wrote:Yuck. Please don't do multiple controls with the same id unless you absolutely have to.

This is what groups are for! Just have the 2 buttons (any id you like) inside the group with id 600 and it'll just work.

Cheers,
Jonathan

could you do me a quick example ?

EDIT: never mind got it work for my mod, ii have ameended it for you ekin232,

Code:
<control type="group" id="600">
     <control type="button" id="602">
         <visible>Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
         <onleft>57</onleft>
         <onright>57</onright>
         <onup>601</onup>
         <ondown>60</ondown>  <!-- this is aeon's scrollbar so change this to what you want -->
         <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
     </control>

     <control type="button" id="603">
         <visible>!Skin.HasSetting(TrailerInfo) + !Player.Playing</visible>
         <onfocus>Setfocus(61)</onfocus>
     </control>
</control>

<control type="button" id="601">
      <texturefocus>-</texturefocus>
      <texturenofocus>-</texturenofocus>
      <onleft>57</onleft>
      <onright>57</onright>
      <onup>600</onup>
      <ondown>60</ondown>
      <onfocus>PlayerControl(stop)</onfocus>
  </control>
Reply
#11
Ir really appreciate your help with this a lot. I got the code in place, but my problem comes now with this grey box that appears. It seems to be the button. You can see it just above the video window. Any suggestions on how to have that not show?

Image
Reply
#12
ekim232 Wrote:Ir really appreciate your help with this a lot. I got the code in place, but my problem comes now with this grey box that appears. It seems to be the button. You can see it just above the video window. Any suggestions on how to have that not show?

Image

button's don't have an image unless you tell it to have, i would look through your code. (i would start by doing a search for the image file name your using for your borders) based on your screen grab it should be around POSX = 300 POSY = 200

hope that helps.
Reply
#13
Was there any progress on this? Is it hard to add a condition to the on-events, just like the includes have, or just not a good solution? I posted a trac ticket but so far, no response. Smile

Any reason not to add this feature, except for the fact that there are lots of things to fix/add, now with dharma and all?
Reply
#14
I do not know of any progess on it. To solve issues you like this you can create multiple buttons with the same id except each one will have different visible conditions.

Then use <onfocus> with a setfocus(?) to control what it does.
Reply
#15
Yeah, I've used this approach, but IMO it's a tedious process, that could easily be solved with a few conditions.

Say I have a view, with posters in a list in the middle and plot/info at the bottom. I also have a menu at the top (id 900). The posters (id 50) have a scrollbar beneath to scroll through them (id 60), and the plot has one (id 600). Easy. <ondown>60</ondown> <onup>900</onup> in the poster list, then <ondown>600</ondown> <onup>50</onup> on the poster scrollbar, then <onleft>60</onleft><onright>60</onright> on the plot scrollbar.

Basically, this:
Code:
---TOP MENU (900)--- (no onup*, ondown* 50)
---POSTERS (50)--- (onup* 900, ondown* 60)
---SCROLLBAR (60)--- (onup* 50, ondown* 600)
---PLOT-PLOT SCROLLBAR (600)--- (onleft*/onright* 60)

Now, I have this setting to swap them, so that the posters are at the bottom, and the plot/info above it, which alters the events:

Code:
---TOP MENU (900)--- (no onup*, ondown* 600) *
---PLOT-PLOT SCROLLBAR (600)--- (onleft* 900, onright* 50)
---POSTERS (50)--- (onup* 600, ondown* 60)
---SCROLLBAR (60)--- (onup* 50, ondown* 900)

To get the navigation to make sense id 900 shouldn't go down to 50 anymore, it should go to 600.
The posters should go down to 60 either way, nothing to do there.
Scrollbar 60 should go down to 600 too, if posters are centered, 900 otherwise.
Then, the plot scrollbar 600 should go right to 60 if posters centered, and to 50 if bottom aligned.
That would equal four buttons with my logic:
PHP Code:
<control type="group" id="901">
    <
description>ondown/onright conditions</description>
    <
control type="button">
        <
description>Posters centered and down press from 900 OR posters bottom aligned and right press from 600</description>
        <
visible>[Control.HasFocus(900) + !Skin.HasSetting(Posters_Bottom)] | [Control.HasFocus(600) + Skin.HasSetting(Posters_Bottom)]</visible>
        <
onfocus>SetFocus(50)</onfocus>
    </
control>
    <
control type="button">
        <
description>Posters centered and right press from 600</description>
        <
visible>Control.HasFocus(600) + !Skin.HasSetting(Posters_Bottom)</visible>
        <
onfocus>SetFocus(60)</onfocus>
    </
control>
    <
control type="button">
        <
description>Posters bottom aligned and down press from 900 or posters center aligned and down press from 60</description>
        <
visible>[Control.HasFocus(900) + Skin.HasSetting(Posters_Bottom)] | [Control.HasFocus(60) + !Skin.HasSetting(Posters_Bottom)]</visible>
        <
onfocus>SetFocus(600)</onfocus>
    </
control>
    <
control type="button">
        <
description>Posters bottom aligned and down press from 60</description>
        <
visible>Control.HasFocus(60) + Skin.HasSetting(Posters_Bottom)</visible>
        <
onfocus>SetFocus(900)</onfocus>
    </
control>
</
control

But, I haven't even started with the onup/onleft conditions yet. This means, more buttons (only three though!):
PHP Code:
<control type="group" id="902">
    <
description>onup/onleft conditions</description>
    <
control type="button">
        <
description>Posters centered and up press from 50 OR posters bottom aligned and left press from 600</description>
        <
visible>[Control.HasFocus(50) + !Skin.HasSetting(Posters_Bottom)] | [Control.HasFocus(600) + Skin.HasSetting(Posters_Bottom)]</visible>
        <
onfocus>SetFocus(900)</onfocus>
    </
control>
    <
control type="button">
        <
description>Posters centered and left press from 600</description>
        <
visible>Control.HasFocus(600) + !Skin.HasSetting(Posters_Bottom)</visible>
        <
onfocus>SetFocus(60)</onfocus>
    </
control>
    <
control type="button">
        <
description>Posters bottom aligned and up press from 50</description>
        <
visible>Control.HasFocus(50) + Skin.HasSetting(Posters_Bottom)</visible>
        <
onfocus>SetFocus(600)</onfocus>
    </
control>
</
control

So, as far as I can tell, that would be seven buttons, just for a swap between bottom and center aligned posters.
Instead of just having this:
PHP Code:
<control type="scrollbar" id="60">
    ...
    <
onup>50</onup>
    <
ondown condition="!Skin.HasSetting(Posters_Bottom)">600</ondown>
    <
ondown condition="Skin.HasSetting(Posters_Bottom)">900</ondown>
    ...
</
control>
<
control type="list" id="50">
   ...
    <
ondown>60</ondown>
    <
onup condition="!Skin.HasSetting(Posters_Bottom)">900</onup>
    <
onup condition="Skin.HasSetting(Posters_Bottom)">600</onup>
    ...
</
control

Alot easier if you ask me!
If only my C++ skills werent so limited. Sad
Reply

Logout Mark Read Team Forum Stats Members Help
<onup> conditionals?0