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
MediaPortal 1 Plugins
processing button click in a 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="patrick" data-source="post: 59976" data-attributes="member: 12502"><p><strong>Re: what's the correct way to do this?</strong></p><p></p><p></p><p></p><p>I am not sure about correct or better but </p><p>they way I have usually seen it done is to put it into </p><p>the override of OnClicked and check the control. </p><p>(If you are changing code in an existing plugin the override is probably already there)</p><p></p><p>So after you add the button to the skin.xml file</p><p>something like the code below should work.</p><p></p><p></p><p>[code]</p><p>[SkinControlAttribute(5555)] protected GUIButtonControl btnRunMyProcessPlugin = null;</p><p></p><p>protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)</p><p>{</p><p> base.OnClicked(controlId, control, actionType);</p><p> </p><p> if (control == btnSomeOtherButton)</p><p> {</p><p> // </p><p> }</p><p> else if (control == btnRunMyProcessPlugin)</p><p> {</p><p> // Insert code here</p><p> }</p><p>}</p><p></p><p>[/code]</p><p></p><p>HTH</p><p>patrick</p></blockquote><p></p>
[QUOTE="patrick, post: 59976, member: 12502"] [b]Re: what's the correct way to do this?[/b] I am not sure about correct or better but they way I have usually seen it done is to put it into the override of OnClicked and check the control. (If you are changing code in an existing plugin the override is probably already there) So after you add the button to the skin.xml file something like the code below should work. [code] [SkinControlAttribute(5555)] protected GUIButtonControl btnRunMyProcessPlugin = null; protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) { base.OnClicked(controlId, control, actionType); if (control == btnSomeOtherButton) { // } else if (control == btnRunMyProcessPlugin) { // Insert code here } } [/code] HTH patrick [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
processing button click in a plugin
Contact us
RSS
Top
Bottom