SkinSetting for color? (1 Viewer)

mbuzina

Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Another question for debugging: Is there a way to find the id of the currently focused control and display that in a label?
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,621
    10,625
    Königstein (Taunus)
    Home Country
    Germany Germany
    Proper use could be: <visible>skin.hassetting(#skin.ShowTouchControls,True)</visible> or <visible>skin.hassetting(#skin.ShowTouchControls,False)</visible> or <visible>!skin.hassetting(#skin.ShowTouchControls,True)</visible>
    If you ommit the true/false and only leave the comma, it´s reversed ;)
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    According to wiki & code hassetting does not have a second parameter. I used just hassetting which returns the bool I entered into SkinSettings.xml.

    Right now I am battling focus ;-)
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    11-22-57.png
    11-23-04.png
    11-25-12.png
    OK, now I am really playing. I want to programmatically move the focus, we can do this because of skin.setfocus. There is a but though: it does not work correctly if executed on <onfocus>. The focus in that case is "halved". The original button stays in focus, while the new button is also a bit in focus (both show their focus colors, the old one still has control, its onleft/right/etc methods are executed). Sample screenshots:
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Only problems today...

    I try to use a comparison to decide if a control is visible.
    * I have 10 skin settings, each named #BasicHome.Bx.Overlay.WW (x is 0-9). It contains either r0, r1, r2 or r3.
    * I have a skin setting name #BasicHome.Current.ID which is from 0-12
    * I want to hide a control if the correct numbered Overlay.WW setting is r0 or the number is 10,11 or 12. What I did is:
    XML:
    <label>#(neq('r0',choose(cint(#BasicHome.Current.ID),#BasicHome.B0.Overlay.WW,#BasicHome.B1.Overlay.WW,#BasicHome.B2.Overlay.WW,#BasicHome.B3.Overlay.WW,#BasicHome.B4.Overlay.WW,#BasicHome.B5.Overlay.WW,#BasicHome.B6.Overlay.WW,#BasicHome.B7.Overlay.WW,#BasicHome.B8.Overlay.WW,#BasicHome.B9.Overlay.WW,'r0','r0','r0')))</label>

    And yes, this works great!!! The label shows False if the corresponding overlay setting contains r0 and True for everything else.

    And now comes the problem: I can not use this as a visibility constraint. I tried using it as is. I tried using string.equals instead of eq. I tried setting a text to a label if true and use control.hastext (that one seems broken no matter how I try). I tried with # in front and without.

    I am frustrated :cry:

    Other things that did not work today:
    -> Moving Focus from onfocus handler
    -> Setting the Action of a button using a SkinSetting (succeeded in hanging/crashing MP with this)
    -> Setting onleft/onright/... using a SkinSetting

    So I guess I have to stop here for now.
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    I am getting desperate, digging into the code of guilib ;-)

    I found something strange, why is false not recognized as a false value:
    Code:
    	private static object ConvertXmlStringToObject(string valueName, string valueText, Type type)
    	{
    	  if (type == typeof (bool))
    	  {
    		if (string.Compare(valueText, "off", true) == 0 ||
    			string.Compare(valueText, "no", true) == 0 ||
    			string.Compare(valueText, "disabled", true) == 0)
    		{
    		  return false;
    		}
     
     
    		return true;
    	  }
    With this snippet of code, false translates to true :cautious:
     

    Users who are viewing this thread

    Top Bottom