NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 15 16 17 18 19 … 93 Next »
How does @visible work?

 
  • 0 Vote(s) - 0 Average
How does @visible work?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#1
2011-05-15, 01:36 AM
Sub is there a trick to using @visible that I don't remember? I have this line in a skin

Code:
<Text text="@Album" visible="@noImage" location="65,38" size="20,52" font="Album_Default" align="Center" wrap="true"/>

and it displays with if it is not in the hash or if

args["@noImage"]=true;
args["@noImage"]=false;

The Hashtable() seems to be working because if I don't set args["@Album"]= I get the @Album showing on the screen.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#2
2011-05-15, 04:29 AM
At the time the skin goes to draw this element, if has this visible="@noImage" it'll check what @noImage is set to in the properties. If it's true then it is drawn. If it is false then it is not drawn.

Does it not seem to working for you? It could be related to other things going on - like are you using updating this image by changing parameters on UiStatic etc?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#3
2011-05-15, 05:17 AM
If looks basically like this. If I don't have the =""; lines the @Artist, @Album text is written

Code:
args = new Hashtable();
                args["@Artist"] = selectedMedia.Artist;
                args["@Album"] = selectedMedia.Album;
                ...
                MusicBox4.GetInstance().playlistDetails.Args = args;
                args = new Hashtable();
                if (selectedMedia.HasArt)
                {
                    args["@AlbumArt"] = selectedMedia.GetAlbumArtImage();
                    args["@Artist"] = "";
                    args["@Album"] = "";
                    args["@noImage"] = false;
                }
                else
                {
                    Image generic = Image.FromFile(SettingsHelper.GetInstance().GetSkinDirectory() + "MusicBox4\\generic.jpg");
                    args["@AlbumArt"] = generic;
                    args["@Artist"] = selectedMedia.Artist;
                    args["@Album"] = selectedMedia.Album;
                    args["@noImage"] = true;
                }
                args["@hash"] = selectedMedia.AlbumName;
                MusicBox4.GetInstance().albumArtScreen.Args = args;

Martin
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#4
2011-05-15, 06:07 AM
I think I understand my problem, in trying to test this since I found another path to this element. If you add either a true or false arg values it will always be visible, it is true whether you use @something or !@something in the skin I thought I could be more selective in using this but because of the default to true you can't use just the skin to control things.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#5
2011-05-15, 06:20 AM
mvallevand Wrote:If I don't have the =""; lines the @Artist, @Album text is written
This is intentional. Otherwise it was too hard for skinners to spot typo's in variable names etc. At least the tags were in their face and easily visible.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#6
2011-05-15, 06:23 AM
mvallevand Wrote:I think I understand my problem, in trying to test this since I found another path to this element. If you add either a true or false arg values it will always be visible, it is true whether you use @something or !@something in the skin I thought I could be more selective in using this but because of the default to true you can't use just the skin to control things.
I'm not really sure I follow you. If a skinner doesnt want to show something, they can explicitly do a visible="false", or just not list something. If they want to have something that the plugin is controlling the visibility of, then the plugin passes in either true or false in @variable and the skin file has visible="@variable" . This should cover everything we'd need.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#7
2011-05-15, 11:26 AM
I think for me logically they should be treated like the DEFINE statement in C and default to false. If the skin had a visible="@defined" this would only be shown up if the plugin had explicitly set args["@defined"]=true. If you want to display the values that aren't set you can still use visible="!@defined"

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#8
2011-05-15, 05:26 PM
Rather than a visible="@defined", it's more of a visible="@variableIsTrueOrFalse"

If your skin uses a visible="@variableIsTrueOrFalse", but your plugin doesnt pass in @variableIsTrueOrFalse, or it is spelt differently, then it defaults to being visible, to make it obvious to the skinner.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#9
2011-05-15, 06:58 PM
Yes but my comment is both ["@variableIsTrueOrFalse"] and ["!@variableIsTrueOrFalse"] appear to return true if it is null. I think the first one should return false.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#10
2011-05-15, 07:20 PM
mvallevand Wrote:Yes but my comment is both ["@variableIsTrueOrFalse"] and ["!@variableIsTrueOrFalse"] appear to return true if it is null. I think the first one should return false.
I understand where you're coming from, but it was a conscious decision to make things visible if the variable was present, since in most cases it'd be because of a typo or bug in the plugin. It'd probably break things to change it too, after having always done it this way in NPVR (and GBPVR before it).
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,472 2015-08-25, 10:21 AM
Last Post: puck64
  how does RecordingService.ArchiveRecording work exactly? reven 4 2,253 2012-11-30, 11:01 AM
Last Post: reven
  visible="!@hasImage & folder.jpg in Music not working Jaggy 0 1,249 2012-02-10, 10:29 PM
Last Post: Jaggy
  visible="@isFolderWithNoPreviewImage" Northpole 3 1,955 2011-08-07, 09:45 PM
Last Post: Northpole
  uiButtonStrip.Visible mvallevand 1 1,463 2011-03-16, 04:24 PM
Last Post: sub
  Skin question for "Visible" 7ore 14 5,486 2010-09-22, 09:04 PM
Last Post: sub
  1.0.8: LoadRecordingSchedule doesn't work anymore? Remco 4 2,092 2007-07-28, 08:27 AM
Last Post: Remco
  Make GBPVRPlugInSkeleton work? capone 4 1,966 2007-06-10, 09:16 PM
Last Post: capone
  Does .NET 2.0 work with GBPVR? mitcheloc 2 1,883 2005-10-07, 06:38 AM
Last Post: mitcheloc
  Weather Plugin - Some cities wont work 0 556 Less than 1 minute ago
Last Post:

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode