MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
LinkBack Thread Tools Display Modes
Old 2008-04-02, 13:48   #1 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default activate a second window please help

i m writing a plugin and i have some question please help me because i m trying for two week and i dont find a

solution:

1. How can i Activate new window i use this Method

GUIWindowManager.ActivateWindow(8110, true);

but it didint work, i become a black window:

This is the code for the second window what i try to call from the first window

HTML Code:
  class Media2: GUIWindow
    {

        public Media2()
        {

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

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

        protected override void OnPageLoad()
        {
            MessageBox.Show("Oberflaeche2 " );
            base.OnPageLoad();
        }

        protected override void OnPageDestroy(int new_windowId)
        {

            base.OnPageDestroy(new_windowId);
        }

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

            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);
        }
    }
please help me and thank you

please havent sonme one any idea, i m waiting

Last edited by Zarra; 2008-04-02 at 16:20. Reason: Automerged Doublepost
Zarra is offline   Reply With Quote
Old 2008-04-03, 14:43   #2 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 664
Thanks: 117
Thanked 83 Times in 44 Posts

Country:

My System

Default

To activate a second window from another one, you would do something like this.

Media2 Media2 = new GUIWindowManager.GetWindow(8110)
GUIWindowManager.ActivateWindow(8110)

That should work for you. You may need to call Media2.Process in between those two as well, but I'm not positive if that's required. The syntax may be a bit off but you see what I'm getting at.

Last edited by jburnette; 2008-04-03 at 14:53.
jburnette is online now   Reply With Quote
Old 2008-04-03, 16:33   #3 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

i try but i come evry time back to the home Windows.
MP dont load the new XML
Zarra is offline   Reply With Quote
Old 2008-04-03, 16:40   #4 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 664
Thanks: 117
Thanked 83 Times in 44 Posts

Country:

My System

Default

Do you have a skin file for that window that has its window id set to <id>8110</id> at the top of the skin file?
jburnette is online now   Reply With Quote
Old 2008-04-03, 16:45   #5 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

yes i have a second XML Datei with the same ID


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
<id>8110</id>
<defaultcontrol>2</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>

<!-- anfang -->
<control>
<description>Header</description>
<type>image</type>
<id>1</id>
<posX>0</posX>
<posY>0</posY>
<width>720</width>
<height>70</height>
<texture>AGT_PluginHeader.png</texture>
</control>
<!-- Ende -->
<control>
<description>an Image</description>
<type>image</type>
<id>1</id>
<posX>75</posX>
<posY>370</posY>
<texture>hover_my videos.png</texture>
</controls>
</window>

that why i cant understand where are the mistake
Zarra is offline   Reply With Quote
Old 2008-04-03, 16:49   #6 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 664
Thanks: 117
Thanked 83 Times in 44 Posts

Country:

My System

Default

What's your code to call/activate the new window?
jburnette is online now   Reply With Quote
Old 2008-04-03, 16:51   #7 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

if (control == initial)
{
// go to the second GUI

BodyMedia2 bd = new BodyMedia2();
bd.Init();
//BodyMedia2 bd = new BodyMedia2();
//bd.OnPageLoad();

// GUIWindowManager.GetWindow(8110);
// GUIWindowManager.ActivateWindow(8110);
//this.Visible = false;
Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
ClearAll();

//ClearAll();
//GUIWindowManager.CloseCurrentWindow(); GUIWindowManager.ActivateWindow(0);
//GUIWindowManager.GetWindow(8110);

//MessageBox.Show( GUIWindowManager.IsOsdVisible());
//GUIWindowManager.ActivateWindow(8110, true);
//Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
//s.Init();
// ClearAll();
}


you see i use all Method : )
Zarra is offline   Reply With Quote
Old 2008-04-03, 16:56   #8 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 664
Thanks: 117
Thanked 83 Times in 44 Posts

Country:

My System

Default

How about

BodyMedia2 bd = new GUIWindowManager.GetWindow(8110);
GUIWindowManager.ActivateWindow(8110)

You're getting the black screen, I think, because of this call:

Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");

Which should be handled for you when you call GetWindow (since you're already loading it from your second class).
jburnette is online now   Reply With Quote
Old 2008-04-03, 17:04   #9 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

With this Sytax BodyMedia2 bd = new GUIWindowManager.GetWindow(8110);
i become a mistak
Without this Syntax Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
it jump to the Home window : (
Zarra is offline   Reply With Quote
Old 2008-04-03, 19:35   #10 (permalink)
Portal Developer
 
Join Date: May 2007
Posts: 498
Thanks: 1
Thanked 76 Times in 39 Posts

Country:


Default

Quote:
Originally Posted by Zarra View Post

<!-- Ende -->
<control>
<description>an Image</description>
<type>image</type>
<id>1</id>
<posX>75</posX>
<posY>370</posY>
<texture>hover_my videos.png</texture>
</controls>
</window>

that why i cant understand where are the mistake
Your skin file is bad!!!

You need a closing statement for each control statement... you are missing one at the end...

The section I quoted above should be....
Code:
     <!-- Ende -->  
     <control>
      <description>an Image</description>
       <type>image</type>
       <id>1</id>
       <posX>75</posX>
       <posY>370</posY>
       <texture>hover_my videos.png</texture>
      </control>
     </controls>
</window>




Quote:
Originally Posted by Zarra View Post

if (control == initial)
{
// go to the second GUI

BodyMedia2 bd = new BodyMedia2();
bd.Init();
//BodyMedia2 bd = new BodyMedia2();
//bd.OnPageLoad();

// GUIWindowManager.GetWindow(8110);
// GUIWindowManager.ActivateWindow(8110);
//this.Visible = false;
Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
ClearAll();

//ClearAll();
//GUIWindowManager.CloseCurrentWindow(); GUIWindowManager.ActivateWindow(0);
//GUIWindowManager.GetWindow(8110);

//MessageBox.Show( GUIWindowManager.IsOsdVisible());
//GUIWindowManager.ActivateWindow(8110, true);
//Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
//s.Init();
// ClearAll();
}


you see i use all Method : )
If you are loading a new skin into an existing window while you are using it... You will need to force the window manager to reload the page....

Code:
            Load(GUIGraphicsContext.Skin + @"\Oberflaeche2.xml");
            Restore();
            LoadSkin();
Without the two extra commands, the window manager will not actually load the new skin because the skin is window is already loaded... I found this out the hard way... (The CybrDisplay plugin uses dynamically generated skin files for the GUI setup).

Regards,
CybrMage

Last edited by cybrmage; 2008-04-03 at 19:45. Reason: Merged double post.
cybrmage is offline   Reply With Quote
Reply

Bookmarks

Tags
activate, window

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
activate the video wallpaper ? nissse General Support 18 2008-02-17 12:29
activate ts recording? parkuhr MediaPortal 1 Talk 3 2007-09-04 17:24
how to activate VRM9 novaman General Support 1 2006-10-09 15:38
how to activate OVERLAY novaman General Support 2 2006-09-27 15:12
How do i activate a plugin? :P Ca3 Plugins 2 2006-03-12 17:23


All times are GMT +1. The time now is 20:13.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress