GadgetPlugin

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

GadgetPlugin

Post 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).
El_Choni
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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:
El_Choni
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Mental note to self: Start Learning C and ASM :D
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post 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

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

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

I am to provide the public with beneficial shocks.
Alfred Hitshock
Post Reply