Copy link to clipboard
Copied
Hi,
I am creating the UI for the photoshop through Javascript (see below screenshot). I am dynamically add the storename on the UI, it may be "n" numbe of store. So I would like to add the scrollbar on that panel.
I have attached my script, can you please help me to get it done.
Thanks
Asuvath
Try
1)
// scrollbar
var sbar = myStrPnl.add ("scrollbar"); //added
sbar.preferredSize.width = 20;
sbar.preferredSize.height = 200;
sbar.maxvalue = 1;
sbar.minvalue = 1;
....
function add_btn () {
add_row();
sbar.maxvalue = i;
}
2)
sbar.onChanging = sbar.onChange = function () {
group2.location.y = -5 * this.value;
}
Copy link to clipboard
Copied
I don’t understand your description, please explain again.
And your Script does not seem to have been attached.
Copy link to clipboard
Copied
Hi @c.pfaffenbichler ,
Thanks for checking. Sorry for unclear.
I would like to add the scrollbar in scriptUI in Photoshop.
I am attached my script, but I not sure where is it gone. I here placed my code,
My expectation is I would like to get it real scrollbar like the "bar" will increase or decrease while add or remove the "Item". Currently this code that bar size is same in all time.
Additionally the script is not working for scroll the mouse up and down, instead of that we need to forcely click the bar and pull down to view the items.
Can you please do the needful to get the below,
1. The bar size will be increased when the items are added and the bar size will be reduced when the items are removed like scrollbar nature.
2. While scroll the mouse bar will be move up and down.
Thanks
Asuvath
Copy link to clipboard
Copied
Try
1)
// scrollbar
var sbar = myStrPnl.add ("scrollbar"); //added
sbar.preferredSize.width = 20;
sbar.preferredSize.height = 200;
sbar.maxvalue = 1;
sbar.minvalue = 1;
....
function add_btn () {
add_row();
sbar.maxvalue = i;
}
2)
sbar.onChanging = sbar.onChange = function () {
group2.location.y = -5 * this.value;
}
Copy link to clipboard
Copied
Hi @r-bin ,
Thanks for the response.
Your suggestions works, but my expectation is to get it, like recent scroll bar (less amount for entries the bar size will be large, and more amount for entries the bar size will be decrease).
Additionally while mover the scroll ball in mouse the bar will be move up and down like what we currently used in other application.
Can you please advise to get it that?
Thanks
Asuvath
Copy link to clipboard
Copied