Page 1 of 1

GadgetPlugin

Posted: Tue Jun 10, 2003 7:32 pm
by El_Choni
Hi,

I think being able to use controls from userlibs like any other gadget would be very useful. But instead of, for example, putting UseCalendarGadget() at the beginning of the code, the third party gadget would register itself when called, let's say:

Code: Select all

CalendarGadget(0, xPos, yPos, #Current_Month)
Or maybe in an InitFunction (yes, maybe that would be better).

This CalendarGadget registers itself, and gives the GadgetPlugin lib the address for the common gadget functions, or 0 for the ones it doesn't support:

FreeGadget
GadgetHeight
GadgetID
GadgetItemID
GadgetToolTip
GadgetWidth
GadgetX
GadgetY
etc...

So the third party gadget can be programmed in PureBasic like any other gadget, with its index number, no matter if it's a COM control or whatever. Of course, third party gadgets shouldn't use the Gadget library. I think this could be very useful. If I haven't explained myself, please, tell me.

Note: I don't have any intention of coding a CalendarGadget, it's just an example (but I have others in mind).

Posted: Tue Jun 10, 2003 7:42 pm
by freak
This can allready be done quite easy.
Have a look in the "\Library SDK\LccWin32\SampleGadget\" Folder of
you 3.7 installation, there you see how.

For further Questions, you can ask Fred or me (because I probably have
asked Fred every possible question about that topic, and he answered
them all 8) )

Timo

Posted: Tue Jun 10, 2003 9:20 pm
by El_Choni
That is EXACTLY what I meant! Sorry, I hadn't checked that folder. It's cool to have my wishlist taken care of even before posting it :wink:

Posted: Tue Jun 10, 2003 10:05 pm
by Num3
Mental note to self: Start Learning C and ASM :D

Posted: Wed Jun 11, 2003 11:05 am
by Fred
Yes, Gadget lib has been rewritten some times ago to allow users expands the library exactly as native gadgets. Do you see another library which should benefit of this 'plugin' system ? Currently, Image, sound and gadget support it.

Posted: Wed Jun 11, 2003 5:18 pm
by fsw
Fred wrote:Yes, Gadget lib has been rewritten some times ago to allow users expands the library exactly as native gadgets. Do you see another library which should benefit of this 'plugin' system ? Currently, Image, sound and gadget support it.
Maybe Window :?:
This way the user could implement a own event system, or special skin window... or whatever

Posted: Wed Jun 11, 2003 5:21 pm
by fsw
freak wrote:For further Questions, you can ask Fred or me (because I probably have asked Fred every possible question about that topic, and he answered them all 8) )
Timo
Hmm, have you already packaged your question/answer list for us :?:
Just kidding :lol:
But maybe it's a good idea to wrap it up as faq in a text file or maybe in the PureBasic help file.
Thanks man.