Sorry, I honestly had no idea where to put this, as the difficulty ranges virtually anywhere based on the particular gadget.
A gadget is defined as a clever device designed for a specific practical use. Hence, a class of methods and functions designed for a specific use. Practical, well, we'll see.
Essentially, I was thinking about making a class (or many classes) of gadgets, such as a gadget for moving a sprite. The gadget would store what you want it to do in a variable in the class. Every gadget would perform a useful job that would be specific to a single class.
I won't be cramming hundreds and hundreds of gadgets into a single class, because that would multiply your file's size quite tremendously. I plan to put just 20 into a class, and you can trim out the ones you don't need to further reduce the size.
Any ideas are welcome, no matter how specific, strange, or difficult. I'm starting off with the gadget I just described.
The advantage of classes allows the programmer to re-use code. That code may be often used routines (like a math package) or often used functionality (like text input) so as to make the programmer's job a bit easier. Keep that in mind as you build your gadgets. They should be easy to use, with little impact on the programmer's main task of writing the program. As an example, I have attached a simple biorythm program that makes use of a Textbox class.
The class handles user input when called to do so, with just two lines of code required in the Main section (one line to place the textbox somewhere on the screen, and one line to get the user input). With minimal effort by the programmer, the program is able to dictate precisely where the textbox goes, and allows the user to enter text which the program can use. It also does not impose conditions on the program (like a program level variable, or other dependancy) which makes it self-contained. If or when Phrogram has an INCLUDE command, such a self-contained class could be held in a separate file and included in any program.
I just wanted to stress a single point - Gadgets should be easy to re-use with minimal impact on the program. With that in mind, go ahead and build a library of gadgets. I'm sure some will find them useful if you care to share what you create.....
Noted.