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
 
Thread Tools Display Modes
Old 2004-09-19, 09:26   #1 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Fribourg (CH)
Posts: 314
Thanks: 0
Thanked 1 Time in 1 Post


Default plugin-rookie question!

Hi,

Try to do my first plugin (called "myGames" btw :-) ).

I'm able to get the configuration and my own MainMenu button (thanks to Joe for the great tutorial).

What I don't get is:
How can I catch the "clicked" event of "my" MainMenu button?

I understand that I need a class that implements GUIWINDOW and override the OnMessage handler, but nothing happens if I click my button...

Can anyone help me getting to the right trail?
Maybe just a "read file x and see part y" :-)
Thanks!

Cheers,

Daniel
__________________
waeberd is offline   Reply With Quote
Old 2004-09-19, 09:43   #2 (permalink)
Portal Member
 
Join Date: Apr 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts


Default

I have a suggestion for you. When I wrote my first plugin I simply looked in the cvs source, picked a plugin, in my case My Recepies, and started to change it inoto the plugin I wanted to make. In that way you're sure that you're going to get a working plugin. Then when you change something, test it often so that when it stops working you know exactly what changes made it stop working. Anyway, this worked for me, maybe it could for you too.
snorre is offline   Reply With Quote
Old 2004-09-19, 09:53   #3 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Fribourg (CH)
Posts: 314
Thanks: 0
Thanked 1 Time in 1 Post


Default

Thanks snorre,

That's what I'm trying to do, but I wanted to do a own plugin, so I started a project and copied some MyPrograms files into it.
As I'm a C# rookie (but a hopefully decent Delphi/SQL coder ) I need to do some "heavy copy-pastin'" to get things going....

Maybe somebody can show me a minimal plugin that handles the onClick event of the main menu button?

But maybe I'll "morph" myRecipies into a prototype plugin to make tests.... this should be a bit easier!

Cheers,

Daniel
__________________
waeberd is offline   Reply With Quote
Old 2004-09-19, 21:05   #4 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Fribourg (CH)
Posts: 314
Thanks: 0
Thanked 1 Time in 1 Post


Default

ok guys, found out how to do it!! GREAT!

in case there are other coders that look for this:
1) add a new constant to the "Window" enumeration - (file GUIWindow.cs)
2) use this constant as an ID in the SetupForm and in the GUIWindow implementation of the plugin (see GetID in GUIPrograms constructor for an example).

So I went a small step forward..... cool!

Cheers,

Daniel
__________________
waeberd is offline   Reply With Quote
Old 2004-12-06, 00:43   #5 (permalink)
Anonymous
Guest
 
Posts: n/a


Default

It is probably a better solution to overide the GetID function in GUIWindow. I altered the code below for my plugin:

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

You have probably worked this out but will be helpful for other prospective developers.
  Reply With Quote
Reply

Bookmarks

Tags
pluginrookie, question

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 Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTV@UT Plugin moiristo Plugins 116 2008-10-06 22:32
Gathering topical infos about plugins (To: authors & use tomtom21000 Plugins 2 2006-02-05 00:20
noob question - writing a plugin in VB ghackett Plugins 3 2005-12-02 18:01
Plugin example doesnt show in list Anonymous Plugins 5 2005-08-13 12:12


All times are GMT +1. The time now is 04:59.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden