Copy link to clipboard
Copied
It's definitely a pity: it is not possible to have long label text for buttons, radio buttons or check boxes:
// UI_multiline_labels.jsx
// 2021-02-01
var w = new Window("dialog", "Appearance of multiline labels", undefined);
w.t1 = w.add("statictext", undefined, "Some longer text in this label", {multiline: true});
w.t1.preferredSize = [100, 35];
w.rb1 = w.add("radiobutton", undefined, "This does not work at all", {multiline: true});
w.rb1.preferredSize = [100, 35];
w.cb1 = w.add("checkbox", undefined, "Some longer text in this label", {multiline: true});
w.cb1.preferredSize = [100, 40];
w.btn1 = w.add("button", undefined, "Some longer textin this label", {multiline: true});
w.btn1.preferredSize = [100, 40];
w.show();
This is a requirement for dialogues filled not only with short running English text, but with French - not to speak of Finnish ...
The only solution to the problem seems to be a nasty crunch: https://community.adobe.com/t5/animate/need-radio-button-component-labels-multiline/m-p/1064285
This again reminds me of the age of the whole ExtendScript stuff.
Copy link to clipboard
Copied
While I mange to create a long label for the Radio button and the Check box I do not see how I could achieve it for an ordinary button:
var w = new Window("dialog", "Multiline labels", undefined);
var NL = String.fromCharCode(10);
w.p2 = w.add ("panel", undefined, undefined);
w.p2.t1 = w.p2.add("statictext", undefined, "Some longer text in this statictext", {multiline: true});
w.p2.t1.preferredSize = [100, 35];
w.p2.g1 = w.p2.add ("group", undefined, undefined);
w.p2.g1.rb1 = w.p2.g1.add("radiobutton", undefined, "");
w.p2.g1.t1 = w.p2.g1.add("statictext", undefined, "Some longer text in this RB label", {multiline: true});
w.p2.g1.t1.preferredSize = [100, 35];
w.p2.g2 = w.p2.add ("group", undefined, undefined);
w.p2.g2.chk1 = w.p2.g2.add("checkbox", undefined, "");
w.p2.g2.t1 = w.p2.g2.add("statictext", undefined, "Some longer text in this CB label", {multiline: true});
w.p2.g2.t1.preferredSize = [100, 35];
w.p2.g3 = w.p2.add ("group", undefined, undefined);
w.p2.g3.btn1 = w.p2.g3.add("button", undefined, "NL does not" + NL + "work at all");
w.p2.g3.btn1.preferredSize = [100, 50];
w.show();
Copy link to clipboard
Copied
Sometimes creation properties that don't work as an object in the last arg do work if you include them in the string of the first arg.
So try this and it may work:
w.btn1 = w.add("button {multiline: true}", undefined, "Some longer textin this label");
Copy link to clipboard
Copied
Thanks ReedError for this idea, however, it does not work for Radio buttons, Check boxes and Buttons:
// UI_multiline_labels.jsx
// 2021-02-08
var w = new Window("dialog", "Multiline labels", undefined);
var NL = String.fromCharCode(10); // 13 or 10,13 also not working
w.orientation = "row";
w.p1 = w.add ("panel", undefined, undefined);
w.p1.t1 = w.p1.add("statictext", undefined, "Multiline labels simulated by statictext", {multiline: true});
w.p1.t1.preferredSize = [120, 35];
w.p1.g1 = w.p1.add ("group", undefined, undefined);
w.p1.g1.rb1 = w.p1.g1.add("radiobutton", undefined, "");
w.p1.g1.t1 = w.p1.g1.add("statictext", undefined, "Some longer text in this RB label", {multiline: true});
w.p1.g1.t1.preferredSize = [100, 35];
w.p1.g2 = w.p1.add ("group", undefined, undefined);
w.p1.g2.chk1 = w.p1.g2.add("checkbox", undefined, "");
w.p1.g2.t1 = w.p1.g2.add("statictext", undefined, "Some longer text in this CB label", {multiline: true});
w.p1.g2.t1.preferredSize = [100, 35];
w.p1.g3 = w.p1.add ("group", undefined, undefined);
w.p1.g3.btn1 = w.p1.g3.add("button", undefined, "NL does not" + NL + "work at all");
w.p1.g3.btn1.preferredSize = [100, 50];
w.p2 = w.add ("panel", undefined, undefined);
w.p2.t1 = w.p2.add("statictext", undefined, "Miltiline according to forum user ReedError", {multiline: true});
w.p2.t1.preferredSize = [120, 35];
w.p2.rb1 = w.p2.add("radiobutton {multiline: true}", undefined, "Some longer text in this RB label", );
w.p2.rb1.preferredSize = [100, 35];
w.p2.chk1 = w.p2.add("checkbox {multiline: true}", undefined, "Some longer text in this CB label");
w.p2.chk1.preferredSize = [100, 35];
w.p2.btn1 = w.p2.add("button {multiline: true}", undefined, "Does this really work?");
w.p2.btn1.preferredSize = [100, 50];
w.show();
Copy link to clipboard
Copied
Hi Klaus,
it doesn't work, because multiline is not a valid/defined/documented property.(JavascriptTools Guide).
It is only defined for edittext and statictext.