plugin-rookie question! (1 Viewer)

waeberd

Portal Pro
August 16, 2004
314
1
Fribourg (CH)
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
 

snorre

Portal Member
April 23, 2004
44
1
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.
 

waeberd

Portal Pro
August 16, 2004
314
1
Fribourg (CH)
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

Portal Pro
August 16, 2004
314
1
Fribourg (CH)
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
 
A

Anonymous

Guest
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.
 

Users who are viewing this thread

Top Bottom