Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Hide or show GUI parts

  • Hide or show GUI parts

    Posted by Jacob Danell on July 26, 2013 at 3:37 pm

    Hi! I’m really stuck on this one.
    What I want to do is, under my help-windows, be able to hide or show different parts of my GUI script.
    So far I have bin able to show and hide (by looking on this thread: https://forums.creativecow.net/thread/227/22849 ) but the space that the button occupied is still there. What I want is for everything under to move up so the whole GUI becomes smaller.

    This is how my code looks like right now:

    var res =
    "group {
    orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:[20,20,20,20], margins:[0,0,0,0],
    strt: Group {
    orientation:'row', alignment:['fill','top'], spacing:[0,0,0,0],
    LWbutton: Button { text:'Apply Linear Wipe', alignment:['fill','left'], preferredSize:[110,25]},
    Gbutton: Button { text:'Apply Grid', alignment:['fill','center'], preferredSize:[70,25] },
    Hbutton: Button { text:'?', alignment:['right','right'], preferredSize:[25,25] },
    },
    optsRow: Panel{text:'Cut at:',
    orientation:'column', alignment:['fill','top'],
    text_input: EditText { text:'50', alignment:['fill','top'], preferredSize:[100,20] },
    },
    cmds: Group {
    alignment:['fill','top'], margins:[0,5,0,0],
    okButton: Button { text:'Cut!', alignment:['fill','center'] },
    vCheck1: Checkbox {text:'hide1'},
    vCheck2: Checkbox {text:'hide1'},
    },
    }";

    my_palette.grp.strt.LWbutton.onClick = onLWClick; //Liniar Wipe button on click
    my_palette.grp.strt.Gbutton.onClick = onGClick; //Grid button on click
    my_palette.grp.strt.Hbutton.onClick = helpWindow; //Help button on click
    my_palette.grp.cmds.vCheck1.onClick = function ()
    {
    if (my_palette.grp.cmds.vCheck1.value == true) {
    my_palette.grp.optsRow.visible = 0;
    }else{
    my_palette.grp.optsRow.visible = 1;
    }}

    Jacob Danell replied 13 years ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    July 26, 2013 at 5:17 pm

    Hello,
    you can play with the maximumSize.height of your panel (optsRow) as is explained in this thread: https://forums.adobe.com/message/3708111#3708111.

    Something like this:
    my_palette.grp.cmds.vCheck1.onClick = function ()
    {
    if (my_palette.grp.cmds.vCheck1.value) my_palette.grp.optsRow.maximumSize.height = 50;
    else my_palette.grp.optsRow.maximumSize.height = 0;
    my_palette.layout.layout(true);
    }

    Xavier

  • Jacob Danell

    July 26, 2013 at 10:11 pm

    Worked perfect! The effect gave me a shadow where the textbox were before but with the script I already had I made it disapear, but it looked better with the shadow so I kept it that way 🙂
    Thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy