Hi All,
I have Several scrollbars and two buttons(Re-size and original) ) in my stack. When I press re-size button the size of the scrollbar is increased and when I press the original button the size of the scrollbar is back to the original position, my problem is when I press Re-size button not only changes the position of the scrollbar but also changes the potion of controls near by scrollbar(both position of the scrollbar and the potion of controls near by scrollbar should change). How can I solve this problem. Please see the below attached zip
Thanks
Shalu
How to Change the potion of controls near by scrollbar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to Change the potion of controls near by scrollbar
- Attachments
-
- RESIZE.zip
- (1.53 KiB) Downloaded 216 times
--
Thanks
Shalu S
Thanks
Shalu S
Re: How to Change the potion of controls near by scrollbar
Hello Shalu
I tried the following with only one scrollbar on your example:
I got a longer scrollbar, the positon of the thumb are still the same, as you can see on the variables tProcentOld and tProcentNew.
The size if the thumb is also growing.
Is you problem solved but this?
Best regards Jens
I tried the following with only one scrollbar on your example:
Code: Select all
on mouseUp
-- set start and end values
put "SA3" into tScrollbarName
put 65535 into tEnd -- MaxValue of Scrollbars
-- get the old information
put the width of control tScrollbarName into tWidthOld
put the thumbPosition of control tScrollbarName into tPositionOld
put the thumbsize of control tScrollbarName into tSizeOld
put tPositionOld / tEnd into tProcentOld
put tSizeOld / tWidthOld into tThumbPercent
-- new Width
put 500 into tWidthNew
-- resize
set the width of control tScrollbarName to tWidthNew
set the thumbsize of control tScrollbarName to (tThumbPercent * tWidthNew)
-- new position of thumb
put the thumbPosition of control tScrollbarName into tPositionNew
put tPositionNew / tEnd into tProcentNew
end mouseUp
The size if the thumb is also growing.
Is you problem solved but this?
Best regards Jens
Re: How to Change the potion of controls near by scrollbar
Hi shalu,
Sorry, really not sure what your problem is?
Hint:
Setting the thumbsize to any ridiculous (= invalid!) value (2030?) has no effect really, as you can see!
Please look up "thumbsize" in the dictionary!
Hint 2: Here a slimmed down "RESIZE" script:
sb = short for scrollbar
sbs = short for scrollbars
Best
Klaus
the positions of all the fields do NOT change! You did not script thisshalu wrote:... my problem is when I press Re-size button not only changes the position of the scrollbar but also changes the potion of controls near by scrollbar

Sorry, really not sure what your problem is?
Hint:
Setting the thumbsize to any ridiculous (= invalid!) value (2030?) has no effect really, as you can see!
Please look up "thumbsize" in the dictionary!
Hint 2: Here a slimmed down "RESIZE" script:
Code: Select all
on mouseUp
LOCK SCREEN
repeat with i = 1 to the num of sbs
set the height of Scrollbar i to 16
set the width of Scrollbar i to 500
set the thumbsize of scrollbar i to 2030
end repeat
UNLOCK SCREEN
end mouseUp
sbs = short for scrollbars
Best
Klaus