Skip to main content
K.Daube
Community Expert
Community Expert
June 18, 2018
Answered

ScriptUI: panel does not contain what it should

  • June 18, 2018
  • 1 reply
  • 573 views

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):

This topic has been closed for replies.
Correct answer Ian Proudfoot

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

1 reply

Ian Proudfoot
Ian ProudfootCorrect answer
Legend
June 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,"");

and

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

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

Ian

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthor
Community Expert
June 18, 2018

Thank You, Ian,

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

Klaus