- September 8, 2007
- 380
- 48
- Home Country
- Germany
Hi,
i need help by coding my first plugin (Motion Interpolation). I only want to open a DialogMenu in a fullscreen Video Window. (I used the wiki lesson)
But i get the Main Window of the plugin when i click on the button.
Look at the pictures
Here is the code but i dont know what to change to get what i want
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
using MediaPortal.Dialogs;
using MediaPortal.Common.Utils;
[assembly: CompatibleVersion("1.1.7.0")]
[assembly: UsesSubsystem("MP.SkinEngine")]
[assembly: UsesSubsystem("MP.Config")]
namespace Motion_Interpolation
{
public class Class1 : GUIWindow, ISetupForm
{
[SkinControlAttribute(2)]
protected GUIButtonControl buttonOne = null;
[DllImport("User32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
int dwExtraInfo);
public const byte VK_LSHIFT = 0xA0; // left shift key
public const byte VK_CONTROL = 0x11;
public const byte VK_P = 0x50;
public const int KEYEVENTF_EXTENDEDKEY = 0x01;
public const int KEYEVENTF_KEYUP = 0x02;
public Class1()
{
}
#region ISetupForm Members
// Returns the name of the plugin which is shown in the plugin menu
public string PluginName()
{
return "Motion Interpolation";
}
// Returns the description of the plugin is shown in the plugin menu
public string Description()
{
return "Motion Interpolation";
}
// Returns the author of the plugin which is shown in the plugin menu
public string Author()
{
return "MaxMan23";
}
// show the setup dialog
public void ShowPlugin()
{
MessageBox.Show("Nothing to configure, this is just an example");
}
// Indicates whether plugin can be enabled/disabled
public bool CanEnable()
{
return true;
}
// Get Windows-ID
public int GetWindowId()
{
// WindowID of windowplugin belonging to this setup
// enter your own unique code
return 6785;
}
// Indicates if plugin is enabled by default;
public bool DefaultEnabled()
{
return true;
}
// indicates if a plugin has it's own setup screen
public bool HasSetup()
{
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;
}
// With GetID it will be an window-plugin / otherwise a process-plugin
// Enter the id number here again
public override int GetID
{
get
{
return 6785;
}
set
{
}
}
#endregion
public override bool Init()
{
return Load(GUIGraphicsContext.Skin + @"\Motion_Interpolation.xml");
}
protected override void OnClicked(int controlId, GUIControl control,MediaPortal.GUI.Library.Action.ActionType actionType)
//protected override void OnPageLoad()
{
GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
if (dlgMenu != null)
{
dlgMenu.Reset();
dlgMenu.SetHeading("Header");
dlgMenu.Add("Off");
dlgMenu.Add("Normal");
dlgMenu.Add("Motion Interpolation");
dlgMenu.DoModal(GetID);
switch (dlgMenu.SelectedLabel)
...
After click on the Button Motion Interpolation the
GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
should opens. I hope someone can explain me what to do. I am a totally beginner in c# but i want to learn it.
i need help by coding my first plugin (Motion Interpolation). I only want to open a DialogMenu in a fullscreen Video Window. (I used the wiki lesson)
But i get the Main Window of the plugin when i click on the button.
Look at the pictures
Here is the code but i dont know what to change to get what i want
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
using MediaPortal.Dialogs;
using MediaPortal.Common.Utils;
[assembly: CompatibleVersion("1.1.7.0")]
[assembly: UsesSubsystem("MP.SkinEngine")]
[assembly: UsesSubsystem("MP.Config")]
namespace Motion_Interpolation
{
public class Class1 : GUIWindow, ISetupForm
{
[SkinControlAttribute(2)]
protected GUIButtonControl buttonOne = null;
[DllImport("User32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,
int dwExtraInfo);
public const byte VK_LSHIFT = 0xA0; // left shift key
public const byte VK_CONTROL = 0x11;
public const byte VK_P = 0x50;
public const int KEYEVENTF_EXTENDEDKEY = 0x01;
public const int KEYEVENTF_KEYUP = 0x02;
public Class1()
{
}
#region ISetupForm Members
// Returns the name of the plugin which is shown in the plugin menu
public string PluginName()
{
return "Motion Interpolation";
}
// Returns the description of the plugin is shown in the plugin menu
public string Description()
{
return "Motion Interpolation";
}
// Returns the author of the plugin which is shown in the plugin menu
public string Author()
{
return "MaxMan23";
}
// show the setup dialog
public void ShowPlugin()
{
MessageBox.Show("Nothing to configure, this is just an example");
}
// Indicates whether plugin can be enabled/disabled
public bool CanEnable()
{
return true;
}
// Get Windows-ID
public int GetWindowId()
{
// WindowID of windowplugin belonging to this setup
// enter your own unique code
return 6785;
}
// Indicates if plugin is enabled by default;
public bool DefaultEnabled()
{
return true;
}
// indicates if a plugin has it's own setup screen
public bool HasSetup()
{
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;
}
// With GetID it will be an window-plugin / otherwise a process-plugin
// Enter the id number here again
public override int GetID
{
get
{
return 6785;
}
set
{
}
}
#endregion
public override bool Init()
{
return Load(GUIGraphicsContext.Skin + @"\Motion_Interpolation.xml");
}
protected override void OnClicked(int controlId, GUIControl control,MediaPortal.GUI.Library.Action.ActionType actionType)
//protected override void OnPageLoad()
{
GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
if (dlgMenu != null)
{
dlgMenu.Reset();
dlgMenu.SetHeading("Header");
dlgMenu.Add("Off");
dlgMenu.Add("Normal");
dlgMenu.Add("Motion Interpolation");
dlgMenu.DoModal(GetID);
switch (dlgMenu.SelectedLabel)
...
After click on the Button Motion Interpolation the
GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
should opens. I hope someone can explain me what to do. I am a totally beginner in c# but i want to learn it.