GUIFacadeControl newbie problem (1 Viewer)

MrBacardi

Portal Member
September 23, 2006
12
6
Home Country
Norway Norway
Hello,

I'm currently developing my first MediaPortal-plugin and I'm having some very basic problems with the GUIFacadeControl.

No matter what I try I can't get any items in the list to show up on the screen.

this is my XML:

Code:
<window>
  <id>7654</id>
  <defaultcontrol>50</defaultcontrol>
  <allowoverlay>yes</allowoverlay>
  <controls>
    <import>common.window.xml</import>
    <import>common.facade.xml</import>
  </controls>
</window>

I'm trying to use the default facade-control. Is this correct?

And a snippet from my code:

Code:
            [SkinControlAttribute(50)]  protected GUIFacadeControl facadeView = null;

            facadeView = new GUIFacadeControl(GetID);
            facadeView.View = GUIFacadeControl.ViewMode.List;
            facadeView.Clear();

            facadeView.Add(new GUIListItem("item1"));
            facadeView.Add(new GUIListItem("item2"));

but the screen still turns up empty when I start my plugin.

I've tested adding some ButtonControls to the XML and they turn up OK on the screen.

But I can't get this facade to work. Can somebody please help me?
 

MrBacardi

Portal Member
September 23, 2006
12
6
Home Country
Norway Norway
I used the plugin-tutorial as a base for my plugin:

PluginDevelopersGuide - MediaPortal Wiki Documentation

and all that works great.

But when I try to add a GUIFacadeControl to the prosjekt nothing happens, I can't get the list displayed on screen.

If somebody could point out what code and what XML and code is necessary that would be great! because I can't seem to figure it out.

The GUIFacadeControl is not documented in:
SkinArchitecture - MediaPortal Wiki Documentation

and that makes it a bit hard to understand how to go forward.

any help is deeply appreciated! :)
 

panni

Portal Member
March 21, 2008
15
6
I've had the same problem.
It's working with the following:

Code:
<control>
        <description>composite control consisting of a list control and a thumbnail panel</description>
        <type>facadeview</type>
        <id>1201</id>
        <control>
          <description>listcontrol</description>
          <type>listcontrol</type>
          <id>1201</id>
          <scrollOffset>2</scrollOffset>
        </control>
</control>


# code
Code:
        [SkinControlAttribute(1201)]
              public GUIFacadeControl testlist = null;

# ... some function which is to fill the list:
            if (testlist == null)
            {
                testlist = new GUIFacadeControl(GetID);
            }

             testlist.View = GUIFacadeControl.ViewMode.List;

             testlist.Add(new GUIListItem("item1"));
 

Scrounger

Retired Team Member
  • Premium Supporter
  • January 21, 2009
    1,032
    514
    Stuttgart
    Home Country
    Germany Germany
    I tried these hints and it works.

    But i have another problem.
    In my plguin i have only the facade control and the "standard" hidden menu. If i use an additional layout (additional facecontrol - id:51) i get problems with the focus / control with the remote. That means if i use the facedcontrol with id 50 i can normaly switch contol between facadecontrol and hiddenmenu. If i use the second facadecontrol (different layouts) wit id 51, i cant switch between facadecontrol and hidden menu, i lost the focus after leaving hiddenmenu.

    Any one has an idea?
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    You can always set visibility and focus manually in your code but it is painfull :)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    It is hard to comment without seeing some code but

    GUIFacadeControl is in the wiki
    http://wiki.team-mediaportal.com/1_...s/Skin_Architecture/Skin_Controls/Facade_View

    but it is a wrapper for other views. This is the control that allows you to switch between list, thumbnail, coverflow ... views

    If you really do want just a list control then you can just define a list control
    http://wiki.team-mediaportal.com/1_...s/Skin_Architecture/Skin_Controls/Listcontrol

    You no not need to instantiate any skin elements
    Code:
    facadeView = new GUIFacadeControl(GetID);
    Is not what you need to do. You define the control in the code and the skin file and MP will create the object and and link it to to the definition in the skin file.

    I don't think this quite works with the latest version of MP but the code should be 99% of the way there.
    http://wiki.team-mediaportal.com/1_...ute/7_Skins/Skin_Architecture/GuiControlsDemo

    This gives examples of all the controls and the code behind them.

    The other option is to look at the source code / skin files for other plugins
     

    Users who are viewing this thread

    Top Bottom