Adding new gadget to Visual Designer or PureForm

Just starting out? Need help? Post your questions and find answers here.
humungus
User
User
Posts: 14
Joined: Sat Jan 22, 2011 10:01 am

Adding new gadget to Visual Designer or PureForm

Post by humungus »

Hi to all,

sorry for this kind of question but I`m newbie, not good in programming but trying to learn... :oops:

I found this code for TaskMeterGadget:
http://www.purebasic.fr/english/viewtop ... 6&start=15

I would like to add it to any of designers but simply do not know to do it :?

I reading this but do not understand
http://gnozal.ucoz.com/PureFORM/CustomGadgetsWindow.htm

Please, if it`s possible can You explain me step by step how to do it (it`s not shame to ask)

Thanx!
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Adding new gadget to Visual Designer or PureForm

Post by IdeasVacuum »

Save the code as a .pbi file e.g. C:\MyPbCode\TaskMeterGadget.pbi

PureForm:
Setup/Configuration/Custom gadgets/New

New custom gadget form:

Name: TaskMeterGadget
Init code: XIncludeFile C:\MyPbCode\TaskMeterGadget.pbi
Create code: TaskMeterGadget(%id%,%x%,%y%,%w%,%h%,%text%,%p$%)
Free code: FreeTaskMeterGadget(%id%)
Flags:
Comment: %text% and %p$% used to hold the RGB functions


The only way to accommodate the RGB sections of the TaskMeterGadget definition is to have them as strings (%text% and %p$%) in PureForm. Once you have the code in PB, you can simply remove the speech marks.

Having set-up the custom gadget, you can access it from the PureForm Gadgets window:
Image
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
humungus
User
User
Posts: 14
Joined: Sat Jan 22, 2011 10:01 am

Re: Adding new gadget to Visual Designer or PureForm

Post by humungus »

Thank You! 8)
Post Reply