Please help, calling all MP skinners, allowhiddenfocus (6 Viewers)

VdR

MP Donator
  • Premium Supporter
  • October 17, 2006
    612
    16
    Belgium
    Home Country
    Netherlands Netherlands
    Calling all MP skinners.

    Some-one must have used (or try to use) this before. Please help me.

    Thx.

    This message relates to: How to - hide a sort button when not focussed

    I want to hide part of menu stack and show it only if it becomes focussed. I'm trying to do that by splitting the menu into two groups, one of which is hidden unless focussed. Splitting the menu in two groups works fine and to hide one group unless focussed I found the text below in the wiki:

    One thing you will notice, is that when a control is hidden, it can't be focused. This means you can't move to a control and have it automatically become visible (eg even if it had Control.HasFocus(myID) it wouldn't come back on, as MP wouldn't allow navigation to the hidden control). To solve this issue, you can use:

    <visible allowhiddenfocus="true">Control.HasFocus(21)</visible>

    on a control of <id> 21. This will allow the control to be focusable even when it's hidden. When the user moves to the hidden control, it will automatically unhide itself, due to the Control.HasFocus(21) visibility condition.


    That is excactly what I need.

    But is does't work, the group is hidden but I can't navigate there, it cannot be focussed, it doesn't become visible.

    If I change the Control.HasFocus id to the id of a control that is already visible and I navigate there then the hidden control becomes visible, so that part is working. I have tried it for one control instead of a group and have the same problem.

    Does this 'allowhiddenfocus' function work?

    VdR
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Personally I have tried for days and weeks to get allowhiddenfocus to work, but I think it's broken. So much in the Wiki is incorrect or outdated that I stopped using it...
     

    VdR

    MP Donator
  • Premium Supporter
  • October 17, 2006
    612
    16
    Belgium
    Home Country
    Netherlands Netherlands
    Thank you for the reply. That at least confirms that there is no point for me to keep trying.

    Indeed quite a few things in the skin functionality seem to be broken, which is a pity.

    VdR
     

    VdR

    MP Donator
  • Premium Supporter
  • October 17, 2006
    612
    16
    Belgium
    Home Country
    Netherlands Netherlands
    I found a work around

    It's a bit elaborate, but I found a work around. :D

    I defined a 'dummy' button for all buttons in the menu stack that I want to hide unless you actually navigate there. The dummy button is visible only if one of the other hidden buttons has focus. That way all hidden buttons show together.

    Screen one shows the menu with the bottom three buttons hidden. Screen2 shows the hidden buttons showing up together if one is selected.

    The dummy button has to be defined before the real button, else the real button again doesn't gain focus. The dummy button gets id 0, this does however mean that f.i. a sort button does not always show the current sorting if not focused (very minor issue).

    Part of the xml file:

    <!--VdR: defined dummy buttons to show all hidden buttons together, can't use visibilty control to hide buttons because then they never get focus, allow.hiddenfocus function does not work-->
    <control>
    <type>button</type>
    <description>DUMMY Switch view</description>
    <id>0</id>
    <label>457</label>
    <posY>399</posY>
    <visible>control.hasfocus(3)|control.hasfocus(2) </visible>
    </control>
    <control>
    <type>button</type>
    <description>Switch view</description>
    <id>6</id>
    <label>457</label>
    <posY>399</posY>
    <!--VdR: hide when not selected-->
    <textureNoFocus>-</textureNoFocus>
    <textcolorNoFocus>00ffffff</textcolorNoFocus>
    <onleft>6</onleft>
    <onright>50</onright>
    <onup>12</onup>
    <ondown>3</ondown>
    </control>
    <control>
    <type>sortbutton</type>
    <description>DUMMY Sort</description>
    <id>0</id>
    <label>103</label>
    <posY>444</posY>
    <textureDescending>-</textureDescending>
    <textureAscending>-</textureAscending>
    <visible>control.hasfocus(6)|control.hasfocus(2) </visible>
    </control>
    <control>
    <type>sortbutton</type>
    <description>Sort</description>
    <id>3</id>
    <label>103</label>
    <!--VdR: added position-->
    <posY>444</posY>
    <!--VdR: hide when not selected-->
    <textureNoFocus>-</textureNoFocus>
    <textcolorNoFocus>00ffffff</textcolorNoFocus>
    <textureDescending>-</textureDescending>
    <textureAscending>-</textureAscending>
    <onleft>3</onleft>
    <onright>50</onright>
    <onup>6</onup>
    <ondown>2</ondown>
    </control>
    <control>
    <type>button</type>
    <description>DUMMY layout</description>
    <id>0</id>
    <label>100</label>
    <posY>489</posY>
    <visible>control.hasfocus(3)|control.hasfocus(6) </visible>
    </control>
    <control>
    <type>button</type>
    <description>layout</description>
    <id>2</id>
    <label>100</label>
    <!--VdR: added position-->
    <posY>489</posY>
    <!--VdR: hide when not selected-->
    <textureNoFocus>-</textureNoFocus>
    <textcolorNoFocus>00ffffff</textcolorNoFocus>
    <onleft>2</onleft>
    <onright>50</onright>
    <onup>3</onup>
    <ondown>2</ondown>
    </control>
     

    Attachments

    • screen1.jpg
      screen1.jpg
      74.4 KB
    • screen2.jpg
      screen2.jpg
      77.7 KB

    Users who are viewing this thread

    Top Bottom