I want to provide the user with a stamp which asks them for an angle in degrees and rotates the stamp when they use it from the stamp pallet
here is the code I've got so far
Code: Select all
var Consentdialog =
{
degrees:"",
//this function is fired on pressing ok
commit: function(dialog)
{
var data = dialog.store();
console.println("commit");
this.degrees=data["stxt"];
},
description:
{
name:"Containment Diagram",
elements:
[
{
type: "static_text",
bold: true,
name: "Enter angle from north (degrees): "
},
{
item_id: "stxt",
width: 300,
type: "edit_text",
multiline: false,
},
{
type: "gap", //Add a small vertical gap between
height: 10 //..radio fields and buttons
},
{
type: "ok_cancel",
ok_name: "Ok",
cancel_Name: "Cancel"
}
]
}
}
if(event.source.forReal &&
((event.source.stampName == "h2yaK916D7gKH6wiDDHfe0")))
{
app.execDialog(Consentdialog)
if(Consentdialog.degrees !="")
{
console.println(Consentdialog.degrees);
}
}