<onup> conditionals?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Question  <onup> conditionals?
Post: #1
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!
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #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>
(This post was last modified: 2009-06-25 13:11 by andyblac.)
find quote
Jezz_X Online
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #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>
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #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>
find quote
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #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.
find quote
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #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.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #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: badge.gif]
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #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>
(This post was last modified: 2009-07-01 00:44 by andyblac.)
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #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: badge.gif]
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #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>
(This post was last modified: 2009-07-01 01:15 by andyblac.)
find quote
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #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: screenshot000mpg.jpg]
find quote
andyblac Offline
Posting Freak
Posts: 768
Joined: Feb 2009
Reputation: 0
Post: #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: screenshot000mpg.jpg]

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.
find quote
filigran Offline
Senior Member
Posts: 192
Joined: Oct 2009
Reputation: 0
Post: #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?
find quote
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #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.
find quote
filigran Offline
Senior Member
Posts: 192
Joined: Oct 2009
Reputation: 0
Post: #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
find quote
Post Reply