State Button Library

derez

Expert
Licensed User
Longtime User
Here is my first (meaning I shall continue) library, which is not much of use but something I thought of as suitable for the first time, because it is a button and I thought it will be simple (it is not !!, at least for me).

The idea is that in many cases you have a button that when clicked has to change its text and to do something according to its label. There can be several or many states like these, and to do it you have to use a flag and to change its value together with the button's text.

So this button is doing it for you, all you need to do is to create an array with the text labels and to define the actions in the click sub.

The argument "State" defines the start element, the "MaxState" - the number of elements in the array that participate. There is no protection in the code for invalid arguments.

Attached - a demo program, the Dll and the source file (put it in the libraries directory and the dll will be included in the compiled program).

It works for CF 2, Where can I get CF 1 SDK ?

I am looking forward to hear comments and advice to improve. :)

Edit: - updated for autoscale.
 

Attachments

  • StateButton.zip
    5.1 KB · Views: 43
Last edited:

agraham

Expert
Licensed User
Longtime User
It works for CF 2, Where can I get CF 1 SDK ?
I wouldn't bother with CF1. I only compile my libraries for CF2 now and no-one has complained yet. The optimising compiler can only target CF2.0 devices so there is little point in continuing with CF1.0. Erel has already hinted of dropping support for CF1.0 in Basic4ppc.
 
Top