Hi. I'm writing a simple front-end to some video files
> and using the _multimedia foundational class. I'm trying to
> implement some quick fast forward and rewind buttons, and I'd
> like to press and hold to advance. Something like move 1
> second of video every 100ms you hold the button(something
> tunable, preferably). I have the advancing down, and I'm
> looking for a simple way to implement the press and hold
> functionality. I'm thinking I probably can't do this without
> a timer and using the mousedown and mouseup events? Any quick
> advice? Thanks.
> --
> Derek
Derek, I don't have this packaged or anything, but I think I've got the
relevant code copied below. IIRC it came from a Drew Speedie demo. I
like that it speeds up as the mouse button is held down.
If I missed anything, let me know.
Bill
MOUSEDOWN event code added to 1st navigation (e.g. forward) button
-------------------------------------------------------------------
LPARAMETERS nButton, nShift, nXCoord, nYCoord
*
* abstract this code in a "Continuous Click" button
* class -- add a custom property for the Interval
* and use that property value below for the Interval
* setting:
* THIS.oCCTimer.Interval = THIS.TimerInterval
* so that all that has to be done at the instance
* level is set THIS.TimerInterval
*
*
* add a base VFP Timer control
* (if we've been here before, the existing THIS.oCCTimer
* is simply overwritten)
*
THIS.AddProperty("oCCTimer")
THIS.oCCTimer = CREATEOBJECT("Timer")
THIS.oCCTimer.Enabled = .f.
THIS.oCCTimer.Interval = 400
*
* every time THIS.oCCTimer.Timer() fires, fire
* THIS.Click()
*
BINDEVENT(THIS.oCCTimer,"Timer",THIS,"Click")
*
* start it up
*
THIS.oCCTimer.Enabled = .t.
MOUSEUP event code for same button
--------------------------------------
LPARAMETERS nButton, nShift, nXCoord, nYCoord
*
* abstract this code in a "Continuous Click" button
* class -- nothing to set at the instance level
*
*
* turn off the timer when the mouse is let up
*
IF VARTYPE(THIS.oCCTimer) = "O"
THIS.oCCTimer.Reset()
THIS.oCCTimer.Enabled = .f.
THIS.oCCTimer = .NULL.
ENDIF
Do the same for the other direction navigation button
--------------------------------------------------------
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.