Setting Up Multiple Default Items
#1
Have a question, and this isn't complicated, although my english tends to make it complicated... lets see... here goes...

certain windows have a bunch of Controls which are Default controls (e.g. Control Area, Button, Spin Controlex, Radio button) with pre-defined ID numbers so the compiler can identify them. Examples of such windows are SettingsCategory.xml, VideoOSDSettings.xml and obviously Defaults.xml.

Now, what I'd like to know is how to create two Default controls of a certain type (e.g. Button) so that either shows up depending on a visible tag i insert in that control. For example, I want one button with white text and the other with black, and one of these two default controls show up depending on the visible tag.

I've tried creating two default controls with different ID numbers, doesn't work... so how do I go about doing thisHuh remember, these are default conrols with pre-defined id numbers...

Thanks for the help!
Reply
#2
no help around these partsHuh where are the legends that helped me before...
Reply
#3
Thinking?

First off, your concept of "Default Control" isn't quite what I'd call it, as we use <defaultcontrol> as the default focused control. You are actually meaning controls that are expected to be in the skin.

Some of these, if they are mutually exclusive <may> be able to got around using two controls with the same id, but this is not really a good piece of advice, as it's a hack at best, and may break at any point in time.

Ideally we'd just be more flexible. Perhaps you could detail exactly what you want to do, and where you want to do it, so that I can look to see whether or not there's a solution for that particular scenario?

Usually when you are changing font colours, it's because it works better with an underlying button colour, so you could consider theme'ing it, which has it's own color support.

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
#4
The controls defined in the Defaults.xml are there to save you time when coding the skin. Lets say you make the button control's width set to 100 in the Defaults.xml you will not have to set a <width> tag for any button throughout the skin as long as you want it to be a 100 pixels wide. You should define the attributes that will be used the most for that control type throughout the skin.

The controls you are speaking of in these windows are the controls you will want to be placed in the control area of that window. If you want any of these controls to use the attributes you set for controls of the same type defined in the Defaults.xml you will not have to set them. Those controls don't have defaults cause they may need to be different throughout the skin(most likely). Since these control areas are filled with these preset controls you would not be able to use 2 different buttons cause the control area wouls not know where to be able to place the 2 different buttons.
Reply
#5
Thanks for the help guys... i understand what both of u two (legendary Wink guys mean... it doesn't seem that what i'm trying to do is possible... but here's the scenario in case there is the way...

In SettingsCategory.xml... there's a button defined by id="10" which i believe to be the default settings category button... now, text colors are the name of the day... i have two different scenarios where the panel behind the category buttons is either white or black, and thus a different color text for that category button would be best suited...

now dude to that button being expected by xbmc, there is no way of using visibility tags to show different buttons based on whether the background is black or white...

I hope that makes more sense now... and that there is a solution... i'm stuck with a textcolor which fits in with both, but it doesn't compilment the rest of the skin... so please, if there is a solution, thanks a lot... i really appreciate it a lot... if not, thanks for thinking about it... that's a lot of work for all you hard working guys...

anyways... look forward to hearing from you!
Reply
#6
If you are changing the image behind it, why can't you change the text as well?

One way would be to have 2 separate label controls that fit on to where the button would be. The button that actually appears onscreen will have id 30 and higher (31 for the next etc.). Have the label control use the Control.GetLabel(30) etc, and use a different textcolor for both. Make the button with no text (use no <font> perhaps?)

Should definitely be doable though Smile

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
#7
jmarshall Wrote:If you are changing the image behind it, why can't you change the text as well?

One way would be to have 2 separate label controls that fit on to where the button would be. The button that actually appears onscreen will have id 30 and higher (31 for the next etc.). Have the label control use the Control.GetLabel(30) etc, and use a different textcolor for both. Make the button with no text (use no <font> perhaps?)

Should definitely be doable though Smile

Cheers,
Jonathan

never heard of the Control.getLabel function... have to give that one a look... how can one use two getlabel functions in the id="10" default button control... hmmm... or do u mean, that id="10" button, can be left out completely and the other label controls will use that function to do the same as the default button controlHuh still a bit hazzy to me...
Reply
#8
I think he means that you code the button as usual but with no label in it. Then you make 2 separate label controls that go where the button would be and use that buttons label with the Control.GetLabel tag that use your required visibility conditions.
Reply
#9
Indeed.
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
ok, i get yah... i'll take a look at this possibility... it sounds feasible... i hope i can get this to work...

thanks so much for the help guys...
Reply

Logout Mark Read Team Forum Stats Members Help
Setting Up Multiple Default Items0