home *** CD-ROM | disk | FTP | other *** search
- property ancestor
- global gTxtScrSprsBeg
-
- on birth me, pSliderMin, pSliderMax, pSlideAction, pChan, pTop, pBottom, pBarChan, pBTop, pBBottom, pStartVal, pRestoreToStart
- set vHalfKnobSize to (pBottom - pTop + 0.0) / 2
- set vScrnMin to pBTop + vHalfKnobSize
- set vScrnMax to pBBottom - vHalfKnobSize
- set vScale to vScrnMax - vScrnMin + 0.0
- set ancestor to birth(script "SliderManagerAncestor", pSliderMin, pSliderMax, vScrnMin, vScrnMax, pChan, pBarChan, vScale, vHalfKnobSize, pSlideAction, pStartVal, pRestoreToStart)
- return me
- end
-
- on mShiftSlider me
- set vloc to the mouseV
- if (vloc >= the iScreenMin of me) and (vloc <= the iScreenMax of me) then
- set the locV of sprite the iSliderChan of me to vloc
- else
- if vloc < the iScreenMin of me then
- set the locV of sprite the iSliderChan of me to the iScreenMin of me
- else
- set the locV of sprite the iSliderChan of me to the iScreenMax of me
- end if
- end if
- end
-
- on mVoiCallPage me, pDir
- global oIndexScroller
- set Ldist to the iPageHeightK of oIndexScroller * pDir
- mNudgeSlider(me, Ldist)
- mEndIndexToLine(oIndexScroller)
- end
-
- on mRestoreSlider me, pDoScript
- if not (the puppet of sprite the iSliderChan of me) then
- puppetSprite(the iSliderChan of me, 1)
- end if
- set the locV of sprite the iSliderChan of me to mSliderValToLoc(me)
- if pDoScript then
- do(the iSliderScript of me)
- end if
- end
-
- on mSliderBarPage me, pDist
- if the mouseV > the bottom of sprite the iSliderChan of me then
- mNudgeSlider(me, pDist)
- repeat while the stillDown
- if the mouseV > the bottom of sprite the iSliderChan of me then
- mNudgeSlider(me, pDist)
- end if
- end repeat
- else
- mNudgeSlider(me, -1 * pDist)
- repeat while the stillDown
- if the mouseV < the top of sprite the iSliderChan of me then
- mNudgeSlider(me, -1 * pDist)
- end if
- end repeat
- end if
- end
-
- on mCalcSliderVal me
- set vSliderLoc to the locV of sprite the iSliderChan of me - the iScreenMin of me
- set the iSliderVal of me to the iSliderMin of me + integer(vSliderLoc / the iIncrements of me)
- if the iSliderVal of me > the iSliderMax of me then
- set the iSliderVal of me to the iSliderMax of me
- end if
- end
-
- on mSliderValToLoc me
- return the iScreenMin of me + ((the iSliderVal of me - the iSliderMin of me) * the iIncrements of me)
- end
-