Skin dont show Reaction (newbe Question) (1 Viewer)

Zarra

Portal Member
March 24, 2008
26
0
Home Country
Germany Germany
Hello all

this is my first PlugIn and I have some question about the PlugINs and Skins , Please if someon have any Idea
i m writing a PulgIN with 2 Skins,
the second Skin GUI2 dont dont show any Reaktion if i Compile the 2 Class in the same dll Cyber.dll.
BUt if i make every class in a seperate dll then GUI2 (Skin2) Show Reaktion.

My Quetion must i for every Class.cs with his Skin to make a seperate dll?? But i dont find that Logik,
Have some on any Idea
Please help me
and Thankss

this is my Code maybe it give you Idea what i mean

Code:
class GUI1 : GUIWindow, ISetupForm, IShowPlugin 

        /*public GUI1()
        {
            GetID = 1081;
        }*/
        #region ISetupForm Members


        public string PluginName()
        {
            return "MyFirstPlugin";
        }


        public string Description()
        {
            return "My First plugin tutorial";
        }

        public string Author()
        {
            return "......";
        }

        // show the setup dialog
        public void ShowPlugin()
        {
            
        }


        public bool CanEnable()
        {
            return true;
        }

        public override int GetID
        {
            get { return 1081; }
            set { base.GetID = value; }
        }
        public int GetWindowId()
        {
            return 1081;
            //return 5678;
        }


        public bool DefaultEnabled()
        {
            return true;
        }


        public bool HasSetup()
        {
            return true;
        }


        public bool ShowDefaultHome()
        {
            return true;
        }


        public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
        {
            strButtonText = PluginName();
            strButtonImage = String.Empty;
            strButtonImageFocus = String.Empty;
            strPictureImage = String.Empty;
            return true;
        }

        #endregion
    }
        public override bool Init()
        {
            return Load(GUIGraphicsContext.Skin + @"\Oberflaeche.xml");

        }

       public override int GetID
        {
            get { return 1081; }
            set { base.GetID = value; }
        }

      protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
      if (control == initial)
               {

[COLOR="black"][COLOR="Red"]                      Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
                       Restore();
                       LoadSkin();[/COLOR][/COLOR]
}}
}


the Second Code for the Second class GUI2.cs:


Code:
    class GUI2 : GUIWindow
    {

        public GUI2()
        {
            // ID festlegen für das Plugin, diese gehört zum setup und 
            // ist ein einzigartiger beliebiger festgelegter Code
            //GetID = 5678;

            //GetID = 8110;
        }

        // hier der Button Aktualisieren mit der id 4
        [SkinControlAttribute(400000)]
        protected GUIButtonControl testen = null;

        [SkinControlAttribute(2)]
        protected GUIButtonControl initialisieren = null;
        [SkinControlAttribute(1201)]
        public GUIFacadeControl testlist = null;

        #region ISetupForm Members


        public string PluginName()
        {
            return "MyFirstPlugin";
        }


        public string Description()
        {
            return "My First plugin tutorial";
        }

        public string Author()
        {
            return "..";
        }

        // show the setup dialog
        public Boolean ShowPlugin()
        {
            
            MessageBox.Show("Nothing to configure, this is just an example");
            return true;
        }


        public bool CanEnable()
        {
            return true;
        }


        public int GetWindowId()
        {
            return 8110;
        }


        public bool DefaultEnabled()
        {
            return true;
        }


        public bool HasSetup()
        {
            return true;
        }


        public override int GetID
        {
            get { return 8110; }
            set { base.GetID = value; }
        }




       /* public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
        {
            strButtonText = PluginName();
            strButtonImage = String.Empty;
            strButtonImageFocus = String.Empty;
            strPictureImage = String.Empty;
            return true;
        }*/

        #endregion



        public override bool Init()
        {
            return Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
        }

        protected override void OnPageLoad()
        {
            MessageBox.Show("Oberflaeche2 " );
            GUITextControl.SetControlLabel(8110, 33, "!!!!!!!!!!!!!11111 cm");
            GUITextControl.SetControlLabel(8110, 32, " kg");
            base.OnPageLoad();
        }

      /*  protected override void OnPageDestroy(int new_windowId)
        {
            Load(GUIGraphicsContext.Skin + @"\Oberflaeche.xml");
            Restore();
            LoadSkin();
            base.OnPageDestroy(new_windowId);
        }*/

        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {

            if (control == testen)
            {
                MessageBox.Show("Nothing to configure, this is just an example");
                // GUITextControl.SetControlLabel(1081, 31, s);
                GUITextControl.SetControlLabel(8110, 33, "!!!!!!!!!!!!!11111 cm");
                GUITextControl.SetControlLabel(8110, 32, " kg");

            }
            base.OnClicked(controlId, control, actionType);
        }

        public override bool OnMessage(GUIMessage message)
        {
            if (message.Message == GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS || message.Message == GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED)
            {

            }
            return base.OnMessage(message);
        }
    }


}

The Skin2 (GUI2.XML2)

HTML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
  <id>8110</id>
  <defaultcontrol>400000</defaultcontrol>
  <allowoverlay>yes</allowoverlay>
  <controls>
    <control>
      <description>BackGround</description>
      <type>image</type>
      <id>1</id>
      <posX>0</posX>
      <posY>0</posY>
      <width>720</width>
      <height>576</height>
      <texture>background.png</texture>
    </control>

    <!-- Button zum Aktualisieren der Daten-->
    <control>
      <description>Button zum Aktualisieren der Daten</description>
      <type>button</type>
      <id>400000</id>
      <posX>461</posX>
      <posY>544</posY>
      <width>103</width>
      <height>20</height>
      <textYOff>0</textYOff>
      <label>Testnennnnn</label>
      <font>font12</font>
      <onleft>5</onleft>
      <onright>6</onright>
      <onup>3</onup>
      <ondown>7</ondown>
    </control>

    <!-- Button zum Hauptmenü-->
    <control>
      <description>Hauptmenü</description>
      <type>button</type>
      <id>6</id>
      <posX>590</posX>
      <posY>544</posY>
      <width>125</width>
      <height>20</height>
      <font>font12</font>
      <textYOff>0</textYOff>
      <label>zum Hauptmenu</label>
      <font>font12</font>
      <onleft>4</onleft>
      <onright>2</onright>
      <onup>8</onup>
      <ondown>7</ondown>
    </control>

  </controls>
</window>
 

Users who are viewing this thread

Top Bottom