Skip to main content
rechmbrs
Inspiring
March 3, 2020
Answered

How does one make a Scriptui dialog or palette resizeable?

  • March 3, 2020
  • 2 replies
  • 12073 views

I would like to make a Scriptui window user resizeable.  I've tried by adding ,{resizeable: true} into the new window line as well as trying dialog.resizeable = true;

 

See my attempts:

// DIALOG
// ======
var dialog = new Window("dialog"); // , {resizeable:true}
dialog.text = "TABS test";
dialog.orientation = "column";
dialog.alignChildren = ["center", "top"];
dialog.spacing = 0;
dialog.margins = 2;
dialog.resizeable = true;

// TPANEL1
// =======
var tpanel1 = dialog.add("tabbedpanel", undefined, undefined, { name: "tpanel1" });
tpanel1.alignChildren = "fill";
tpanel1.preferredSize.width = 240;
tpanel1.spacing = 10;
tpanel1.margins = 0;

// TAB1
// ====
var tab1 = tpanel1.add("tab", undefined, undefined, { name: "tab1" });
tab1.text = "Tab1";
tab1.orientation = "row";
tab1.alignChildren = ["left", "top"];
tab1.spacing = 0;
tab1.margins = 0;

var button1 = tab1.add("button", undefined, undefined, { name: "button1" });
button1.text = "Button1";

var button2 = tab1.add("button", undefined, undefined, { name: "button2" });
button2.text = "Button2";

// TAB2
// ====
var tab2 = tpanel1.add("tab", undefined, undefined, { name: "tab2" });
tab2.text = "Tab2";
tab2.orientation = "column";
tab2.alignChildren = ["left", "top"];
tab2.spacing = 0;
tab2.margins = 0;

var button3 = tab2.add("button", undefined, undefined, { name: "button3" });
button3.text = "Button3";

var button4 = tab2.add("button", undefined, undefined, { name: "button4" });
button4.text = "Button4";

// TPANEL1
// =======
tpanel1.selection = tab1;

dialog.show();

 

I don't see the little dotted triangle at the lower right corner as one does in windows 10.

 

RONC 

This topic has been closed for replies.
Correct answer r-bin

Guys,

 

I spend a great deal of my time reading the documents as well as Googling what I'm looking for.  I wouldn't waste your time if I had found an answer.  My question in this thread does not have an answer available in the docs.  I'm aware that ExtendScript is dead but it is the only way at present to fit the needs I have.  It was poorly documented in the first place and the snippets are full of problems.  Another problem is that so much of the code that might have an answer is covered with extra undocumented things that really don't pertain to the topic.  This is why I have placed two examples in the this place.

 

I appreciate your time and especially your responses but you guys go off topic before a solution is made so often.

 

RONC


// DIALOG
// ======
var dialog = new Window("dialog", "", undefined, {resizeable: true} );
dialog.text = "TABS test";
dialog.orientation = "column";
//dialog.alignChildren = ["fill", "top"];
dialog.alignChildren = ["fill", "fill"];
dialog.spacing = 0;
dialog.margins = 2;

// TPANEL1
// =======
var tpanel1 = dialog.add("tabbedpanel", undefined, undefined, { name: "tpanel1" });
tpanel1.alignChildren = "fill";
tpanel1.preferredSize.width = 240;
tpanel1.spacing = 10;
tpanel1.margins = 0;

// TAB1
// ====
var tab1 = tpanel1.add("tab", undefined, undefined, { name: "tab1" });
tab1.text = "Tab1";
tab1.orientation = "row";
tab1.alignChildren = ["left", "top"];
tab1.spacing = 0;
tab1.margins = 0;

var button1 = tab1.add("button", undefined, undefined, { name: "button1" });
button1.text = "Button1";

var button2 = tab1.add("button", undefined, undefined, { name: "button2" });
button2.text = "Button2";

// TAB2
// ====
var tab2 = tpanel1.add("tab", undefined, undefined, { name: "tab2" });
tab2.text = "Tab2";
tab2.orientation = "column";
tab2.alignChildren = ["left", "top"];
tab2.spacing = 0;
tab2.margins = 0;

var button3 = tab2.add("button", undefined, undefined, { name: "button3" });
button3.text = "Button3";

var button4 = tab2.add("button", undefined, undefined, { name: "button4" });
button4.text = "Button4";

// TPANEL1
// =======
tpanel1.selection = tab1;

dialog.onResizing = function() { this.layout.resize(); }

dialog.show();

2 replies

Brainiac
March 3, 2020

var d = new Window("dialog", "", undefined, {resizeable: true} );

var d = new Window("palette", "", undefined, {resizeable: true} );

var d = new Window("window", "", undefined, {resizeable: true} );

 

rechmbrs
rechmbrsAuthor
Inspiring
March 3, 2020

r-bin,

I didn't have the   "", undefined,   includedIt works now but only resizes the window not the contents (buttons, panels, etc).   Can it be made to resize everything?   There is no way for the user to know that the window is resizeable unless they move the cursor over the right or bottom edge.

Thanks, 

RONC

Kukurykus
Brainiac
March 4, 2020

d.b3.onDraw = function() { try { this.graphics.drawImage (this.image, 0, 0, this.size.width, this.size.height); } catch(e) { alert(e); } }

 

 

UPD:

For some reason, on PS2020 it does not make the image smaller than the original, it only enlarges. On CS6 works both ways.
Also supports jpg.  It is not clear what is the matter.
 
UPD2:
the problem can be solved by setting in advance
d.b3.preferredSize = [10,10];
 
 

 

It works for me in CS6, but not in CC2019/20. In the latest relases it doesn't show image at all.

 

An interesting thing is when you play it with ESTK you have nice blury effect, while in CS6 pixelated. I wonder which one is correct?

Chuck Uebele
Community Expert
March 3, 2020

You might have to use the Resource Specification method of creating your UI. See the Javascript Tool Guide for how to do this. I've never had much luck with it.