Highlighted

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

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

TOPICS
Scripting

Views

307

Likes

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

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

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

TOPICS
Scripting

Views

308

Likes

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
Jun 18, 2018 0
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
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2018 0
K.Daube 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
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 18, 2018 1