Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html?rhtocid=_6_1_8_23_1_1#t=Acro12_MasterBook%2FJS_API_AcroJS%2FField_methods.htm%23XREF_37472_setAction
- */
- app.addMenuItem({
- cParent: "SignMenu",
- cName: "mouse",
- cUser: "mouse",
- cExec: "Mouse()",
- });
- var Mouse = app.trustedFunction( function ()
- {
- app.beginPriv();
- console.show();
- doIt( dialog, this );
- app.endPriv();
- });
- function doIt(dialog,doc)
- {
- dialog.doc = doc;
- console.println(doc);
- doc.addField("z","text",0,this.getPageBox());
- z = this.getField("z");
- z.borderColor = color.green;
- //z.set
- doc.addField("a","text",0,[10,10,150,150]);
- doc.addField("b","text",0,[250,250,400,400]);
- a = this.getField("a");
- a.setAction( "MouseEnter", "nP()" );
- a.setAction( "MouseExit", "nP()" );
- a.setAction( "MouseUp", "rField()" );
- a.borderColor = color.red;
- a.lineWidth = 1;
- a.fillColor = color.yellow;
- b = this.getField("b");
- b.value = event.value;
- b.borderColor = color.blue;
- b.lineWidth = 3;
- //nP(doc);
- //rField();
- }
- nP = app.trustedFunction ( function(doc)
- {
- app.beginPriv();
- console.println(event.source +" "+event.target);
- console.println(this.getField("a"));
- this.borderWidth=5;
- app.endPriv();
- });
- rField = app.trustedFunction ( function(doc)
- {
- app.beginPriv();
- console.println("_"+this+"_");
- //this.removeField("b");
- app.endPriv();
- });
- myTrustedGetGlobal = app.trustedFunction ( function()
- {
- app.beginPriv();
- var y = global.x;
- return y
- app.endPriv();
- });
- myTrustedSetGlobal = app.trustedFunction ( function(value)
- {
- app.beginPriv();
- global.x=value;
- app.endPriv();
- });
Add Comment
Please, Sign In to add comment