Hi Eric,

You can't do this with a generic button, as Dan mentions. You could use a frameless button with no text, therefore it's invisible on the screen, and then you could draw whatever you like on top of the position where the button is. What you draw would correspond with whatever state you want to assign to the button. Since it is a button, the image will invert while the user holds the stylus on it.

Another way to do it is to NOT use a button at all, and just look for a pendown events in a certain region on the screen, drawing the graphics at the right time, as above.

Regarding TimGetSeconds(),.... you probably want to use TimGetTicks() instead. It works in hundredths of seconds.

Bob.

Eric Yun wrote:

It is possible to do this with push button if I intercept ctlEnterEvent(or pendownevent) and penUpEvent, calculate their interval with function "TimGetSeconds", and use function "CtlSetValue" to set push button's value (on or off).

The problem is function "TimGetSeconds" only returns time in seconds "since 12:00 A.M. on January 1, 1904". This is not accurate enough. Plam OS does not provide functions to retrieve such a time in milliseconds. I did not find Palm OS have a Timer function either.

You proposed a feasible way, but I think I still need a Timer to calculate the intervals between two events (pendown and penup). Am I right?

Eric


*********** REPLY SEPARATOR ***********


On 16/04/2004 at 12:47 PM Dan Sandler wrote:



Eric,

There's no way to do this with the basic button/push button controls in Palm OS. You'll have to write a gadget (custom control) to create this behavior.

--
Dan Sandler
PalmSource, Inc.

Eric Yun wrote:



hello guys,

I need a button (or push button). It usually acts like a button, but if


the user presses and holds it for some time (say, 1 sec), it acts like a
push button and reverse its color. Is it possible to set button's or
pushbutton's attributes to make such a button?


thanks,

Eric




--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to