Finally I found a way to solve this problem:
1. when the user presses the pushbutton (pendownevent), call function
UInt32 start = TimGetTicks();
2. when the user release the pushbutton (penupevent), call that function again:
UInt32 end = TimGetTicks();
3. calculate the how many ticks in the interval:
UInt32 ticks = start-end;
4. check how long is the interval:
if(ticks>=SysTicksPerSecond()) then .... //interval is longer than 1sec
else .... //interval is shorter than 1sec
you can use CtlSetValue(GetObjectPtr(PushButtonID), 0) or
CtlSetValue(GetObjectPtr(PushButtonID), 1) to set the pushbutton's value (on or off).
I tried it. It seems fine. any comments?
eric
*********** REPLY SEPARATOR ***********
On 16/04/2004 at 2:08 PM Ornstein, Adam wrote:
>There are 3 events generated that relate to a user interacting with a
>button
>on the screen.
>
>a ctlEnterEvent is generated when the user puts the pen down within the
>bounds of the button
>a ctlExitEvent is generated after a ctlEnterEvent if the user pulls the pen
>up outside of the bounds of a button
>a ctlSelectEvent is generated after a ctlEnterEvent if the user pulls the
>pen up within the bounds of the button
>
>probably use a timer with those events for a typical button object, so long
>as you can change its color.......
>
>
>
>-----Original Message-----
>From: Eric Yun [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 16, 2004 12:32 PM
>To: Palm Developer Forum
>Subject: pushbutton or button?
>
>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/
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/