Marty's slider
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Marty's slider
Hi,
I'm using Marty's horizontal slider in 2 cards. After moving the slider knob "k" from 100 to i.e. 40 and going to card 2 the value is 40 but the knob is on position 100. What can I do to move the knob on card 2 to the pos of 40?
Thanks for helping.
I'm using Marty's horizontal slider in 2 cards. After moving the slider knob "k" from 100 to i.e. 40 and going to card 2 the value is 40 but the knob is on position 100. What can I do to move the knob on card 2 to the pos of 40?
Thanks for helping.
Re: Marty's slider
Hi conde,
what is "Marty's slider"?
Best
Klaus
EDIT:
Ah, found it, will take a look...
what is "Marty's slider"?
Best
Klaus
EDIT:
Ah, found it, will take a look...
-
- VIP Livecode Opensource Backer
- Posts: 9663
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Marty's slider
Whatever Marty's slider is, can you store the thumbPosition (or whatever so corresponds) in a custom property and reset it on opencard?
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Marty's slider
Hi,
It is possible using group to do that ( tested with Marty Slider)
1. Set the sharedText of fld "theValue_h" to true
2. Select btn "k", img "Hsliderbar", fld "theValue_h of the horizontal Slider
3. Clic at "Group" on the toolbar
4. Set the name of the group to "myScrollbar"
5. Set the behaviorBackground of group "myScrollbar" to true
6. Type "new cd" in the messagesBox, the new cd have the group "myScrollbar"
and it keep the value and position of the slider
Best regards
Jean-Marc
It is possible using group to do that ( tested with Marty Slider)
1. Set the sharedText of fld "theValue_h" to true
2. Select btn "k", img "Hsliderbar", fld "theValue_h of the horizontal Slider
3. Clic at "Group" on the toolbar
4. Set the name of the group to "myScrollbar"
5. Set the behaviorBackground of group "myScrollbar" to true
6. Type "new cd" in the messagesBox, the new cd have the group "myScrollbar"
and it keep the value and position of the slider
Best regards
Jean-Marc
https://alternatic.ch
Re: Marty's slider
Many, many thanks to Jean-Marc. As a newbie I would never have thought with the behaviorBackground.
Today my trial period is over and I'm going now to order Livecode. Then I will try Jean-Marc's suggestion.
This forum here is a nice comuntity with many helpful people. I hope that someday I can help others.
Kind regards,
Guera
Today my trial period is over and I'm going now to order Livecode. Then I will try Jean-Marc's suggestion.
This forum here is a nice comuntity with many helpful people. I hope that someday I can help others.
Kind regards,
Guera
Re: Marty's slider
Sorry - I'm too stupid for math.
The script of Marty’s horizontal slider:
Now I would like to see the BPMs in the fld "theValue_h" ???
Thanks for helping.
The script of Marty’s horizontal slider:
Code: Select all
on mouseDown
# INSERT YOUR MINIMUM (LEFT) VALUE
put 2000 into minValue --in my case = wait 2000 milliseconds (30 BPM)
# INSERT YOUR MAXIMUM (RIGHT) VALUE
put 200 into maxValue --in my case = wait 200 milliseconds (300 BPM)
# GET THE OFFSET OF THE CLICK SPOT AND CENTER OF THE BTN
# THIS WILL PREVENT THE BTN FROM JUMPING WHEN YOU START TO DRAG
put (the mouseH - item 1 of the loc of me) into cX
# the number you see added or subtracted at the end of the next 3 lines
# is to tweak the position of the slider button so it stops where you want
# THIS IS IN ADDITION TO ADDING THE VALUE OF cX
put (the left of image "BGSliderRate")+(the width of me/2)+cX -12 into Lstop
put (the right of image "BGSliderRate")-(the width of me/2)+cX +12 into Rstop
put item 2 of the loc of image "BGSliderRate" into yLoc
put (maxValue-minValue)/(Rstop-Lstop) into scaleFactor
put true into canMove
end mouseDown
on mouseMove x,y
if not canMove then exit mouseMove
put min(Rstop,max(Lstop,x)) into xLoc
set loc of me to xLoc-cX,yLoc
# you may need to add values to following: xLoc and yLoc
# to position the value fld where you want
set loc of fld "theValue_h" to xLoc-cX,yLoc+20
# The following line calculates the value which you would want to
# also put into use for the actual functioning of the slider
put round((xLoc-Lstop)*scaleFactor)+minValue into fld "theValue_h"
put round((xLoc-Lstop)*scaleFactor)+minValue into pBPM
end mouseMove
Thanks for helping.
Re: Marty's slider
It's a pity. No response? Or is this posting in the wrong category?
-
- VIP Livecode Opensource Backer
- Posts: 4002
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Marty's slider
Hi Conde,
I don't really understand what you want. Your script should work in the context of Marty's Slider.
Here is a version of the horizontal slider with min 200 and max 2000 that displays the value below the slider in field "theValue_h"
KInd regards
Bernd
I don't really understand what you want. Your script should work in the context of Marty's Slider.
Here is a version of the horizontal slider with min 200 and max 2000 that displays the value below the slider in field "theValue_h"
KInd regards
Bernd
Re: Marty's slider
Bernd - danke for your answer and stack.
My problem is: in the script I've modified (code see above) the minValue = 2000 and maxValue = 200. The variable pBPM goes to a wait command. Wait 2000 milliseconds (30 BeatsPerMinute - slider knob left = slow) and wait 200 milliseconds (300 bpm - slider knob on the right = fast). The slider works fine in the wait command. What I mean is that I can see in “the_Value_h“ the real beats per minute.
Danke für Deine Mühe.
Guera
My problem is: in the script I've modified (code see above) the minValue = 2000 and maxValue = 200. The variable pBPM goes to a wait command. Wait 2000 milliseconds (30 BeatsPerMinute - slider knob left = slow) and wait 200 milliseconds (300 bpm - slider knob on the right = fast). The slider works fine in the wait command. What I mean is that I can see in “the_Value_h“ the real beats per minute.
Danke für Deine Mühe.
Guera
-
- VIP Livecode Opensource Backer
- Posts: 4002
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Marty's slider
Hi Guera,
I did not get that you wanted the "real" beats to show up in the field.
try to replace the last lines of the mouseMove handler with this:
The beats should be in field "theValue_h"
Kind regards and greetings to Stuttgart
Bernd
I did not get that you wanted the "real" beats to show up in the field.
try to replace the last lines of the mouseMove handler with this:
Code: Select all
put round((xLoc-Lstop)*scaleFactor)+minValue into tRawValue
put round(60000/tRawValue) into fld "theValue_h"
put round((xLoc-Lstop)*scaleFactor)+minValue into pBPM
end mouseMove
Kind regards and greetings to Stuttgart
Bernd
Re: Marty's slider
Hi Bernd - YOU made my day! Thank you sooooo much.
Greetings to Bochum.
Guera
Greetings to Bochum.
Guera