如何更改窗口面板标题大小?

时间:2014-12-17 15:16:01

标签: javascript extendscript after-effects

我创建了一个带有组窗口和面板的gui窗口的脚本。我的问题是当我从After Effects或Extendscript Debugger中激活脚本时,我无法在面板标题上看到整个标题。下面是图片的链接,突出显示我看到的错误。

https://drive.google.com/a/whirlpool.com/file/d/0B51dXC1EPNW7NGJHTUZtY1JKMVE/view?usp=sharing

以下是原始问题代码:

var myWin = (this instanceof Panel) ? this : new Window("palette", "Mozaik", undefined, {resizeable: true , maximizeButton: true});

var panelZero = myWin.add('panel', undefined, 'Define your Mozaik Size');
    panelZero.alignment = ['100','300'];
    panelZero.alignChildren = ['fill','fill'];
    sizePickGUI = panelZero.add('edittext', undefined, '100'); //sizePickGUI variable which is used as sizePick parameter in shape buillding functions
        sizePickGUI.value = 100;
       sizePickGUI.onChange = function(){
           this.value = this.text
        }
        sizePickGUIVal= sizePickGUI.value;

var panelOne = myWin.add('panel', undefined, 'Define Area');
    widthPickGUI = panelOne.add('edittext', undefined, '1000'); //widthPickGUI variable which is used as widthPick variable in shape building functions
        panelOne.alignment = ['100','fill'];
        panelOne.alignChildren = ['fill','fill'];
        widthPickGUI.value = 1000;
        widthPickGUI.onChange = function(){
            this.value = this.text
        }
        widthPickGUIVal = widthPickGUI.value;


    heightPickGUI = panelOne.add('edittext', undefined, '1000'); //heightPickGUI variable which is used as heightPick variable in shape building functions
        heightPickGUI.value = 1000;
        heightPickGUI.onChange = function(){
            this.value = this.text            
            }
            heightPickGUIVal = heightPickGUI.value



var groupTwo = myWin.add ('group', undefined, 'Shape Picker'); // Shape Picker GUI group
    groupTwo.add('statictext', undefined, 'Shape Picker');

    var square = groupTwo.add('radiobutton', undefined, 'Square'); //square radio button


    var triangle = groupTwo.add('radiobutton', undefined, 'Triangle');// triangle radio button


    var circle = groupTwo.add('radiobutton', undefined, 'Circle'); // circle radio button


var groupThree = myWin.add('group', undefined, 'Execute Mozaik'); // Execute Button GUI group
    var execute = groupThree.add('button', undefined, 'Build');





if (!(this instanceof Panel)) {
    myWin.center();
    myWin.show();
    //Setup Window sizing
    myWin.minimumSize = myWin.size;
    //myWin.preferredSize = [300,-1];
    //make the panel resizeable
    myWin.onResizing = myWin.onResize = function(){ this.layout.resize()};
}
else{
    myWin.layout.layout(true);
    myWin.preferredSize = [500,-1];

}

1 个答案:

答案 0 :(得分:0)

好的,我弄清楚为什么我的面板文本在作为ScriptUI运行时没有显示。调整 panel.margins 值可以让我在面板框架和它的子属性之间添加更大的间隙。

在这种情况下panel.margins = 60;为我工作。

这是完整的源代码。如果你保存它&作为scriptUi运行,面板标题将完整显示。

var myWin = (this instanceof Panel) ? this : new Window("palette", "Mozaik", undefined, {resizeable: true , maximizeButton: true});
    //myWin.orientation = 'row';

var panelZero = myWin.add('panel', undefined, 'Define your Mozaik Size');
    panelZero.preferredSize= [200, 50];
    panelZero.margins = 50;
    panelZero.alignment = ['100','300'];
    panelZero.alignChildren = ['fill','fill'];
    sizePickGUI = panelZero.add('edittext', undefined, '100'); //sizePickGUI variable which is used as sizePick parameter in shape buillding functions
        sizePickGUI.size = [80,18];
        sizePickGUI.value = 100;
       sizePickGUI.onChange = function(){
           this.value = this.text
        }
        sizePickGUIVal= sizePickGUI.value;

var panelOne = myWin.add('panel', undefined, 'Define Area');
    panelOne.margins = 45;
    widthPickGUI = panelOne.add('edittext', undefined, '1000'); //widthPickGUI variable which is used as widthPick variable in shape building functions
        widthPickGUI.size = [80,18];
        panelOne.alignment = ['100','fill'];
        panelOne.alignChildren = ['fill','fill'];
        widthPickGUI.value = 1000;
        widthPickGUI.onChange = function(){
            this.value = this.text
        }
        widthPickGUIVal = widthPickGUI.value;


    heightPickGUI = panelOne.add('edittext', undefined, '1000'); //heightPickGUI variable which is used as heightPick variable in shape building functions
        heightPickGUI.value = 1000;
        heightPickGUI.onChange = function(){
            this.value = this.text            
            }
            heightPickGUIVal = heightPickGUI.value



var groupTwo = myWin.add ('group', undefined, 'Shape Picker'); // Shape Picker GUI group
    groupTwo.add('statictext', undefined, 'Shape Picker');

    var square = groupTwo.add('radiobutton', undefined, 'Square'); //square radio button


    var triangle = groupTwo.add('radiobutton', undefined, 'Triangle');// triangle radio button


    var circle = groupTwo.add('radiobutton', undefined, 'Circle'); // circle radio button


var groupThree = myWin.add('group', undefined, 'Execute Mozaik'); // Execute Button GUI group
    var execute = groupThree.add('button', undefined, 'Build');





if (!(this instanceof Panel)) {
    myWin.center();
    myWin.show();
    //Setup Window sizing
    myWin.minimumSize = myWin.size;
    //myWin.preferredSize = [300,-1];
    //make the panel resizeable
    myWin.onResizing = myWin.onResize = function(){ this.layout.resize()};
}
else{
    myWin.layout.layout(true);
    myWin.preferredSize = [500,-1];

}