Highlighted

Multiline Listbox (ExtendScript) not scrolling

Explorer ,
Aug 06, 2020

Copy link to clipboard

Copied

I'm trying to make a multi selection listbox, but the scroll bar wont show up. According to the ScriptUI Guide it should be generated automatically when I force the list in a container that's too small for its number of elements. But even with a forced "scrolling: true", nothing appears. Scrolling with the mousewheel works, but Id like to have clickable arrows or a small scrollbar.

 

Initially I had this element layouted as dropdown list, but as I moved to the possibility to select more than one item the listbox was my next step:

 

Corvin0_0-1596708728787.png

 

Additionaly, the elements are not exactly centered vertically in the box, but should be. It's not by much, but you can see the text in the last element is a little bit higher than the first one:

 

Corvin0_1-1596708782404.png

 

And here is the code:

 

myPanel = new Window ('dialog {orientation:"row"}'); 

var selectableTypes = ["Test 1","Test 2","Test 3","Test 4","Test 5"];
var myGrp = myPanel.add('group {orientation:"row", alignChildren:"fill"}');
var myDropdownLabel = myGrp.add('statictext {text:"Filter: "}');

var myDropdown = myGrp.add("listbox", [0,0,200,20], selectableTypes, {scrolling: true, multiselect: true});
var InverterCheck = myGrp.add('checkbox {text:"Invert"}');
var myButton = myGrp.add("button",[0,0,100,20],"Select Layer");
var creditsButton = myGrp.add("button",[0,0,20,20],"?");

myPanel.center();
myPanel.show();

 

Found the answer this morning by myself: the problem was

alignChildren:"fill"

 in the group. Changed that to "left" and there it was, a beautiful scrollbar.

TOPICS
Error or problem, How to, Scripting

Views

33

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Multiline Listbox (ExtendScript) not scrolling

Explorer ,
Aug 06, 2020

Copy link to clipboard

Copied

I'm trying to make a multi selection listbox, but the scroll bar wont show up. According to the ScriptUI Guide it should be generated automatically when I force the list in a container that's too small for its number of elements. But even with a forced "scrolling: true", nothing appears. Scrolling with the mousewheel works, but Id like to have clickable arrows or a small scrollbar.

 

Initially I had this element layouted as dropdown list, but as I moved to the possibility to select more than one item the listbox was my next step:

 

Corvin0_0-1596708728787.png

 

Additionaly, the elements are not exactly centered vertically in the box, but should be. It's not by much, but you can see the text in the last element is a little bit higher than the first one:

 

Corvin0_1-1596708782404.png

 

And here is the code:

 

myPanel = new Window ('dialog {orientation:"row"}'); 

var selectableTypes = ["Test 1","Test 2","Test 3","Test 4","Test 5"];
var myGrp = myPanel.add('group {orientation:"row", alignChildren:"fill"}');
var myDropdownLabel = myGrp.add('statictext {text:"Filter: "}');

var myDropdown = myGrp.add("listbox", [0,0,200,20], selectableTypes, {scrolling: true, multiselect: true});
var InverterCheck = myGrp.add('checkbox {text:"Invert"}');
var myButton = myGrp.add("button",[0,0,100,20],"Select Layer");
var creditsButton = myGrp.add("button",[0,0,20,20],"?");

myPanel.center();
myPanel.show();

 

Found the answer this morning by myself: the problem was

alignChildren:"fill"

 in the group. Changed that to "left" and there it was, a beautiful scrollbar.

TOPICS
Error or problem, How to, Scripting

Views

34

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 06, 2020 0
Explorer ,
Aug 07, 2020

Copy link to clipboard

Copied

Found the answer this morning by myself: the problem was

alignChildren:"fill"

 in the group. Changed that to "left" and there it was, a beautiful scrollbar.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2020 0