2. This is because the size of the browser window is hardcoded in the plugin. I hadn't noticed this before and will see if there is some way to make the size dynamic, depending on what skin you use.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
namespace MediaPortal.Messaging.Core
{
/// <summary>
/// Simple webbrowser wrapper.
/// </summary>
public class GUIHTMLReader : GUIControl
{
WebBrowser HTMLReader;
public String Document
{
get { return HTMLReader.DocumentText; }
set { HTMLReader.DocumentText = value; }
}
public GUIHTMLReader(int dwParentID)
: base(dwParentID)
{
}
public GUIHTMLReader(int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight)
: base(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight)
{
}
public override void AllocResources()
{
base.AllocResources();
Log.Debug("GUIHTMLReader : AllocResources");
//Create the actual generic container
HTMLReader = new System.Windows.Forms.WebBrowser();
HTMLReader.SetBounds(XPosition, YPosition, Width, Height);
InitWebComponentOptions();
this.IsVisible = false;
GUIGraphicsContext.form.Controls.Add(HTMLReader);
}
void InitWebComponentOptions()
{
HTMLReader.AllowNavigation = false;
HTMLReader.AllowWebBrowserDrop = false;
HTMLReader.ScriptErrorsSuppressed = true;
HTMLReader.WebBrowserShortcutsEnabled = false;
HTMLReader.ScrollBarsEnabled = true;
}
public override void FreeResources()
{
base.FreeResources();
Log.Debug("GUIHTMLReader : Dispose");
HTMLReader.Dispose();
}
public override bool IsVisible
{
get
{
return base.IsVisible;
}
set
{
base.IsVisible = value;
if (value)
HTMLReader.Show();
else
HTMLReader.Hide();
}
}
}
}
//Pre-register the simplecontainer control class so that the factory knows how to create it
//It will be used as a container for the webbrowser component
GUIControlFactory.RegisterControl("htmlreader", typeof(GUIHTMLReader));
//Then load the GUI using the XML skin file
bool bResult = Load(GUIGraphicsContext.Skin + @"\mymessage.xml");
<control>
<description>HTML frame area</description>
<type>htmlreader</type>
<id>52</id>
<posX>260</posX>
<posY>222</posY>
<width>410</width>
<height>300</height>
</control>