setVisibleCondition() & setAnimations()

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #1
Two new methods have been introduced to python.

Allows XBMC to control visibility of your controls.

Code:
setVisibleCondition(visible[,allowHiddenFocus]) -- Set's the control's visible condition.
    Allows XBMC to control the visible status of the control.

visible          : string - Visible condition.
allowHiddenFocus : bool - True=gains focus even if hidden.

List of Conditions - [url]http://www.xboxmediacenter.com/wiki/index.php?title=List_of_Boolean_Conditions[/url]

example:
  - self.button.setVisibleCondition('[System.KaiEnabled + !Skin.String(KAI)]', True)

Allows XBMC to animate your controls:

Code:
setAnimations([(event, attr,)*]) -- Set's the control's animations.

[(event,attr,)*] : list - A list of tuples consisting of event and attributes pairs.
  - event        : string - The event to animate.
  - attr         : string - The whole attribute string separated by spaces.

Animating your skin - [url]http://www.xboxmediacenter.com/wiki/index.php?title=Animating_Your_Skin[/url]

example:
  - self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0')])


A big thanks to Asteron who made setAnimations() work properly. Also a thank you to cptspiff and nano-. Smile

You need SVN revision 8035 or newer.

GuiBuilder.py has been updated to support these methods. For an example script and the updated guibuilder.py.

http://xbmc-scripting.googlecode.com/svn/trunk/Kaid%20Control%20Pad

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
(This post was last modified: 2007-03-07 21:05 by Nuka1195.)
find quote
matthuisman Offline
Skilled Python Coder
Posts: 600
Joined: Sep 2006
Reputation: 5
Location: Chch, New Zealand
Post: #2
Woot
find quote
matthuisman Offline
Skilled Python Coder
Posts: 600
Joined: Sep 2006
Reputation: 5
Location: Chch, New Zealand
Post: #3
ok, i have updated to the new guibuilder and abit confused using Visible with it.
I used to do:
<visible>MusicPartyMode.Enabled</visible>
But using conditions like this within the skin.xml no longer works, only setting it to False or true seems to work.

Do all visible conditions now have to be set via the script?
find quote
matthuisman Offline
Skilled Python Coder
Posts: 600
Joined: Sep 2006
Reputation: 5
Location: Chch, New Zealand
Post: #4
oh, this is also causing problems in XbmcLyrics with the playlist pos and the Party Mode Enabled buttons that needs to be fixed :-D as at present they both overlay each other
find quote
matthuisman Offline
Skilled Python Coder
Posts: 600
Joined: Sep 2006
Reputation: 5
Location: Chch, New Zealand
Post: #5
DW! updated XBMC and that fixed my problem and the problem i thought was in xbmc lyrics :-D ALL GRAVY!
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #6
i'm glad i didn't read this until you solved your issue, cuz i was lost. Smile

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
matthuisman Offline
Skilled Python Coder
Posts: 600
Joined: Sep 2006
Reputation: 5
Location: Chch, New Zealand
Post: #7
yeh, with using an old build of xbmc and the new guibuilder, it caused issues with skin.xml using visibile conditions, if anything apart from false is used, the control is always shown. Updating xbmc fixes this.
find quote