Modifying Slider-Controls ???

Malte Brill malte.brill at t-online.de
Mon Jun 9 08:10:00 EDT 2003


>1.  Use a GIF, JPEG, BMP, PNG image in place of the
>standard thumb (which appears as an
>      'aqua' object in the standard slider.

>2.  Replace the grey slider track with something else (an
>image, a different colour ?).

>Any ideas ???

Hi Richmond,

here´s what I did for writing a custom QT-controller.
It´s a little math, though. ;-)

Make sure you have two controls, one for the Thumb, one for the bar the
thumb moves on. (graphics in my case)

in the Thumb graphic (or image/btn) put the following script:

global flag
  on mouseDown
  set the uAllowDrag of me to true
end mouseDown

on mouseUp
  set the uAllowdrag of me to false
end mouseUp

on mouserelease
  set the uAllowDrag of me to false
end mouserelease

on mousemove x,y
  if not the uallowDrag of me then exit mouseMove
  switch
    case x>the right of grc "bar"
      set the currentTime of player "audio" to the duration of //
          player "audio"
      exit mousemove
    break
    case x<the left of grc "bar"
      set the currentTime of player "audio" to 0
      exit mousemove
    break
  end switch
  set the loc of me to x,item 2 of the loc of me
  set the currentTime of player 1 to round(the duration of player //
      "audio"/the width of grc "bar"*(x-(item 1 of the loc of grc "bar"- //
      the width of grc "bar"/2)))
-- mind linewrapping
end mousemove

If it´s too confusing, I can send you the stack off-list.

Hope that helps,


Malte




More information about the use-livecode mailing list