home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
General Support
Need help to create my first plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MaxMan23" data-source="post: 846331" data-attributes="member: 56215"><p>Hi,</p><p> </p><p>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)</p><p>But i get the Main Window of the plugin when i click on the button.</p><p> </p><p>Look at the pictures</p><p> </p><p> </p><p>Here is the code but i dont know what to change to get what i want</p><p>using System;</p><p>using System.Collections.Generic;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.IO;</p><p>using System.Runtime.InteropServices;</p><p>using System.Diagnostics;</p><p>using System.Windows.Forms;</p><p>using MediaPortal.GUI.Library;</p><p>using MediaPortal.Dialogs;</p><p>using MediaPortal.Common.Utils;</p><p>[assembly: CompatibleVersion("1.1.7.0")]</p><p>[assembly: UsesSubsystem("MP.SkinEngine")]</p><p>[assembly: UsesSubsystem("MP.Config")]</p><p> </p><p>namespace Motion_Interpolation</p><p>{</p><p>public class Class1 : GUIWindow, ISetupForm</p><p>{</p><p>[SkinControlAttribute(2)]</p><p>protected GUIButtonControl buttonOne = null;</p><p> </p><p>[DllImport("User32.dll")]</p><p>public static extern bool SetForegroundWindow(IntPtr hWnd);</p><p>[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]</p><p>public static extern IntPtr FindWindow(string lpClassName,</p><p>string lpWindowName);</p><p>[DllImport("user32.dll")]</p><p>static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,</p><p>int dwExtraInfo);</p><p>public const byte VK_LSHIFT = 0xA0; // left shift key</p><p>public const byte VK_CONTROL = 0x11;</p><p>public const byte VK_P = 0x50;</p><p>public const int KEYEVENTF_EXTENDEDKEY = 0x01;</p><p>public const int KEYEVENTF_KEYUP = 0x02;</p><p> </p><p> </p><p>public Class1()</p><p>{</p><p> </p><p>}</p><p> </p><p>#region ISetupForm Members</p><p> </p><p>// Returns the name of the plugin which is shown in the plugin menu</p><p>public string PluginName()</p><p>{</p><p>return "Motion Interpolation";</p><p>}</p><p> </p><p>// Returns the description of the plugin is shown in the plugin menu</p><p>public string Description()</p><p>{</p><p>return "Motion Interpolation";</p><p>}</p><p> </p><p>// Returns the author of the plugin which is shown in the plugin menu</p><p>public string Author()</p><p>{</p><p>return "MaxMan23";</p><p>}</p><p> </p><p>// show the setup dialog</p><p>public void ShowPlugin()</p><p>{</p><p>MessageBox.Show("Nothing to configure, this is just an example");</p><p>}</p><p> </p><p>// Indicates whether plugin can be enabled/disabled</p><p>public bool CanEnable()</p><p>{</p><p>return true;</p><p>}</p><p> </p><p>// Get Windows-ID</p><p>public int GetWindowId()</p><p>{</p><p>// WindowID of windowplugin belonging to this setup</p><p>// enter your own unique code</p><p>return 6785;</p><p>}</p><p> </p><p>// Indicates if plugin is enabled by default;</p><p>public bool DefaultEnabled()</p><p>{</p><p>return true;</p><p>}</p><p> </p><p>// indicates if a plugin has it's own setup screen</p><p>public bool HasSetup()</p><p>{</p><p>return true;</p><p>}</p><p> </p><p>public bool GetHome(out string strButtonText, out string strButtonImage,</p><p>out string strButtonImageFocus, out string strPictureImage)</p><p>{</p><p>strButtonText = PluginName();</p><p>strButtonImage = String.Empty;</p><p>strButtonImageFocus = String.Empty;</p><p>strPictureImage = String.Empty;</p><p>return true;</p><p>}</p><p> </p><p>// With GetID it will be an window-plugin / otherwise a process-plugin</p><p>// Enter the id number here again</p><p>public override int GetID</p><p>{</p><p>get</p><p>{</p><p>return 6785;</p><p>}</p><p> </p><p>set</p><p>{</p><p>}</p><p>}</p><p> </p><p>#endregion</p><p> </p><p>public override bool Init()</p><p>{</p><p>return Load(GUIGraphicsContext.Skin + @"\Motion_Interpolation.xml");</p><p>}</p><p> </p><p> </p><p>protected override void OnClicked(int controlId, GUIControl control,MediaPortal.GUI.Library.Action.ActionType actionType)</p><p>//protected override void OnPageLoad()</p><p> </p><p>{</p><p>GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);</p><p>if (dlgMenu != null)</p><p>{</p><p> </p><p>dlgMenu.Reset();</p><p>dlgMenu.SetHeading("Header");</p><p>dlgMenu.Add("Off");</p><p>dlgMenu.Add("Normal");</p><p>dlgMenu.Add("Motion Interpolation");</p><p>dlgMenu.DoModal(GetID);</p><p> </p><p>switch (dlgMenu.SelectedLabel)</p><p>...</p><p> </p><p> </p><p> </p><p>After click on the Button Motion Interpolation the</p><p> </p><p>GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);</p><p></p><p>should opens. I hope someone can explain me what to do. I am a totally beginner in c# but i want to learn it.</p></blockquote><p></p>
[QUOTE="MaxMan23, post: 846331, member: 56215"] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
General Support
Need help to create my first plugin
Contact us
RSS
Top
Bottom