• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiline Listbox (ExtendScript) not scrolling

Participant ,
Aug 06, 2020 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();

 

TOPICS
Error or problem , How to , Scripting

Views

442

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
community guidelines

correct answers 1 Correct answer

Participant , Aug 07, 2020 Aug 07, 2020

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.

Votes

Translate

Translate
Participant ,
Aug 07, 2020 Aug 07, 2020

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines