Adobe 12040118 Using Help - Page 210
stringPropertytext, builder.msgPnl.titleEt.text, arrayPropertybounds
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 210 highlights
Adobe After Effects Help Using Help Creating User Interface Elements Back 210 } //Attach event callback functions to controls /*'has buttons' checkbox enables or disables the panel that determines the justification of the 'alert' button group */ builder.hasBtnsCb.onClick = function () { this.parent.alertBtnsPnl.enabled = this.value; }; /*The edittext fields and scrollbars in sizePnl are connected */ with (builder.sizePnl) { widthEt.onChange = function () { this.parent.widthScrl.value = this.text; }; widthScrl.onChange = function () { this.parent.widthEt.text = this.value; }; heightEt.onChange = function () { this.parent.heightScrl.value = this.text; }; heightScrl.onChange = function () { this.parent.heightEt.text = this.value; }; } with (builder.btnPnl) { //T h e Tes t b utton crea tes a t r i a l Aler t box fro m the c u r rent spec ific ations testBtn.onClick = function () { Window.aler t('Ty pe Enter or Esc to dismiss the test Aler t box'); crea teTestDi a log(c reateResou rce( this.parent.parent) ) ; }; //The Build and Cancel buttons close this dialog buildBtn.onClick = function () { this.parent.parent.close(1); }; cancelBtn.onClick = function () { this.parent.parent.close(2 initializeBuilder function runBuilder(builder) { //Run the builder dialog, return its result return builder.show(); } /*This function creates and returns a string containing a dialog resource specification that will create an Alert dialog using the parameters the user entered. */ function createResource(builder) { //Define the initial part of the resource spec with dialog parameters var dlgWidth = Number(builder.sizePnl.widthEt.text); var dlgHeight = Number(builder.sizePnl.heightEt.text); var res = "dialog { " + stringProperty("text", builder.msgPnl.titleEt.text) + arrayProperty("bounds", 0, 0, dlgWidth, dlgHeight) + "\n"; //Define the alert message statictext element, sizing it to the alert box var margin = 15; var l, t; var msgWidth, msgHeight; var hasButtons = builder.hasBtnsCb.value; var btnsHeightUsed = hasButtons ? 20 + margin : 0; msgHeight = 60; msgWidth = dlgWidth - (margin * 2); l = margin; t = (dlgHeight - msgHeight - btnsHeightUsed) / 2; re s + = " m s g : S t a t i c Tex t { " + stringProperty("text", builder.msgPnl.msgEt.text) + arrayProperty("bounds", l, t, l + msgWidth, t + msgHeight) + "justify:'center', properties:{multiline:true} }"; //Define buttons if desired if (hasButtons) { var btnWidth = 90; //Align buttons as specified with (builder.alertBtnsPnl) { if (alignLeftRb.value) Using Help Back 210