ScriptUI: panel does not contain what it should

Advocate ,
Jun 18, 2018

Copy link to clipboard

Copied

Dear friends.

I want to have input-field and browse button in one row and framed by a named panel.

However, my script does not put the groups into the respective panels. What's wrong with it?

// Dialog_test.jsx

// #target framemaker

  sInfo = "• Line 1 of text\n• Line 2 of 3\n• Last line" ;

  wDlg  = new Window("dialog", "Project-analysis", undefined);

  wDlg.alignChildren = ['left',' '];

    wDlg.st1 = wDlg.add('statictext', undefined, sInfo, {multiline:true});

    wDlg.st1.preferredSize.width = 360;

    wDlg.st1.preferredSize.height = 60;

  wDlg.p1 = wDlg.add ('panel', undefined, "Script directory");

  wDlg.p1.g1 = wDlg.add('group',undefined,"");    // ---

    wDlg.p1.g1.sScriptFolder = wDlg.p1.g1.add('edittext',undefined,"");

    wDlg.p1.g1.sScriptFolder.preferredSize.width = 360;

    wDlg.p1.g1.sScriptFolder.preferredSize.height = 20;

    wDlg.p1.g1.btnBrowseScript = wDlg.p1.g1.add('button',undefined,"Browse");

  wDlg.p2 = wDlg.add ('panel', undefined, "Output directory");

  wDlg.p2.g2 = wDlg.add('group',undefined,"");    // ---

    wDlg.p2.g2.sOutFolder = wDlg.p2.g2.add('edittext',undefined,"");

    wDlg.p2.g2.sOutFolder.preferredSize.width = 360;

    wDlg.p2.g2.sOutFolder.preferredSize.height = 20;

    wDlg.p2.g2.btnBrowseOutput = wDlg.p2.g2.add('button',undefined,"Browse");

//wDlg.g3 = wDlg.add('group',undefined,"");    // ---

    wDlg.btnOK = wDlg.add('button',undefined,"Analyse modules");

  wDlg.show();

It jsut looks like this (both in ESTK and with FM targetted):

ESTK-dialog_test.png

TOPICS
Scripting

Views

350

Likes

Translate

Translate

Report

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

1 Correct Answer

Enthusiast , Jun 18, 2018
Ian Proudfoot Enthusiast , Jun 18, 2018
Hi Klaus,A small problem with lines 13 and 20 in your script. They should read respectively:wDlg.p1.g1 = wDlg.p1.add('group',undefined,"");andwDlg.p2.g2 = wDlg.p2.add('group',undefined,"");You were adding the groups to the dialog and not into the panels.Ian

Likes

Translate

Translate
Jump to answer Jump to answer
Enthusiast ,
Jun 18, 2018

Copy link to clipboard

Copied

Hi Klaus,

A small problem with lines 13 and 20 in your script. They should read respectively:

wDlg.p1.g1 = wDlg.p1.add('group',undefined,"");

and

wDlg.p2.g2 = wDlg.p2.add('group',undefined,"");

You were adding the groups to the dialog and not into the panels.

Ian

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
K.Daube AUTHOR LATEST
Advocate ,
Jun 18, 2018

Copy link to clipboard

Copied

Thank You, Ian,

After a break with some food I also discovered this - so there was 'just' my brain undernourished...

Klaus

Likes

Translate

Translate

Report

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