Balance can range can be from -100 to 100 (-100 is full right, 0 is middle (normal mode) and 100 is full left).
Trackbar range from 0 - 10000
how do i get
TRACKBAR..
0---------------100-------------200
............................................^ Trackbar =100 in this positon
......................^ Trackbar =0 in this positon
^Trackbar =-100 in this positon
Trackbar range question
Trackbar range question
1.3AMD, 2x 256 sdr, 32 AGP
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Is this what you're asking?
Or did I miss the point completely? 
[EDIT]
Famous three rule?
Code: Select all
..
TrackBarGadget(#TrakGadget, xPos, yPos, wide, High, 1, 200)
..
repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case #TrakGadget
result = 100 - GetGadgetState(#Gadget)
if result < 0
.. do lefter stuff
elseif result > 0
.. righter stuff
else
.. do zerostuff
endif
EndSelect
EndSelect
until eventID = #PB_EventCloseWindow

[EDIT]
Famous three rule?
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Bong-Mong.
If trackbar understands range 0 to 10000 and you want to get -100 to 100, then you must to multiply by (2/100) what you get from trackbar position, and then substract 100 to the result.
What Danilo says is about to try to write a descriptive title for new TOPICS in the Forum. For example for this should be good: "How to get trackbar position relative...", because in that way it is easy to search and look a nice Forum

If trackbar understands range 0 to 10000 and you want to get -100 to 100, then you must to multiply by (2/100) what you get from trackbar position, and then substract 100 to the result.

What Danilo says is about to try to write a descriptive title for new TOPICS in the Forum. For example for this should be good: "How to get trackbar position relative...", because in that way it is easy to search and look a nice Forum


@Dare2,
Actually, shouldn't the math be:That way, the max trackbar value of 200 gives 100, 100 gives 0 , and 0 gives -100.
Eric
Actually, shouldn't the math be:
Code: Select all
result = GetGadgetState(#Gadget) - 100
Eric