Page 1 of 1

Adding new gadget to Visual Designer or PureForm

Posted: Thu Jun 28, 2012 6:19 pm
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!

Re: Adding new gadget to Visual Designer or PureForm

Posted: Thu Jun 28, 2012 11:23 pm
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

Re: Adding new gadget to Visual Designer or PureForm

Posted: Fri Jun 29, 2012 7:40 pm
by humungus
Thank You! 8)