Set values to objects in currently open document. Can be used for changing or creating objects.

DEOS("@SetDefinition","object",[WHAT],[NAME],[HOW][JSON])

current

Change values to the currently selected object. When you create a object my GUI, it is automatically selected, so you can use this command to change the object you just created after it is inserted.

DEOS("@SetDefinition", "object", "current", JSON)

Used to set more than one value at a time.

Ex. DEOS("@SetDefinition", "object", "current", '{"pos" : {"left" : "100", "right" : "800"}}') set left corner to 100 and right corner to 800

DEOS("@SetDefinition", "object", "current", key, value)

Used if you only want to change one value. 

Ex. DEOS("@SetDefinition", "object", "current", "pos.left", 100) set the objects left corner to 100px

create

Create a new object into the main object tree.

Parameters

- [name] | used by create to tell where to create, can be @root, @mainform, @mainrecord or a object name. Then a check to see if object is compound is done, and if not the first parent that are a compound is found. This is then used for inserting the created object.

- json | a JSON string with values that are used to create a object. I must at least have to "classname" key to be able to create a object of a specific type and a pos.top end pos.left inside the compound object where it should be created. The object is then added using the same method (deSupInsert) as objects created in the GUI.

Ex. DEOS("@SetDefinition", "object", "create", "@mainrecord", '{"pos" : {"left" : "100", "top" : "200"}, "classname" : "LabelTemplate", "labeltext" : "Hello", "stylename" : "Header 1"}') created a new label inside the main record object with a text, style and a posistion.

definition

Set definition on the object that is going to be inserted by the user. The parameter should be either a command, a single value or a JSON string.

Commands supported is "clear" to remove previous settings so you can start fresh. The settings are automatically cleared when it is used by a insert new object command, but if you select another object before you insert, it is not automatically cleared.

Ex. DEOS("@SetDefinition", "object", "definition", "clear") will remove any settings from previous.

A singe value is having the format key, value like we have seen in remote.

Ex. DEOS("@SetDefinition", "object", "definition", "width", "200") will change the width of the object to 200px before inserting it.

If it is a JSON string, you can set several values at the same time.

Ex. DEOS("@SetDefinition", "object", "definition", '{"width":"600", "hight": "200" }') will change the width of the object to 600px and the hight to 200px.

The final object is merged with the object before the object is inserted into the object under the cursor.

any object name

Select a object by name to set values to.