Add new editor elements to Quest
The Pixie
23 Aug 2012, 08:33Is this possible? I want to add something equivalent to Object, Room and Function. You can right click in the right pane, and my new type will appear in the list. When I select it, I get an instance of that type, and in the left pane tabs and controls specific to that type appear.
The Wiki has a page about adding to the function list; I have had a go at that, and got it to work, so that is a step in the right direction.
http://quest5.net/wiki/Editor_User_Interface_Elements
I have had a look at the core libraries, and the following is based on what I found there. Let us suppose I want a new element called pixfunction, that does the same as function (just for keeping it simple).
Some editor libraries specify a "type" attribute, some do not. Is it necessary?
I was guessing that the first editor XML element adds this to the list of element for right and right-clicking and the add menu, but apparently not.
Also, setting the inherit type to editor_pixfunction or just pixfunction fails, with Quest complaining the object type is not known. I am clearly missing something (perhaps the fact that this is not possible...), so any help here would be appreciated.
The Wiki has a page about adding to the function list; I have had a go at that, and got it to work, so that is a step in the right direction.
http://quest5.net/wiki/Editor_User_Interface_Elements
I have had a look at the core libraries, and the following is based on what I found there. Let us suppose I want a new element called pixfunction, that does the same as function (just for keeping it simple).
Some editor libraries specify a "type" attribute, some do not. Is it necessary?
I was guessing that the first editor XML element adds this to the list of element for right and right-clicking and the add menu, but apparently not.
Also, setting the inherit type to editor_pixfunction or just pixfunction fails, with Quest complaining the object type is not known. I am clearly missing something (perhaps the fact that this is not possible...), so any help here would be appreciated.
<library type="editor">
<editor>
<appliesto>_pixfunctions</appliesto>
<tab>
<caption>Pix Functions</caption>
<control>
<controltype>elementslist</controltype>
<elementtype>pixfunction</elementtype>
<objecttype>pixfunction</objecttype>
<expand/>
</control>
</tab>
</editor>
<editor>
<appliesto>pixfunction</appliesto>
<tab>
<caption>Pix Function</caption>
<control>
<caption>Name</caption>
<controltype>textbox</controltype>
<attribute>name</attribute>
</control>
<control>
<caption>Return type</caption>
<controltype>dropdown</controltype>
<attribute>returntype</attribute>
<width>150</width>
<validvalues type="stringdictionary">=None; string=String; boolean=Boolean; int=Integer; double=Double; object=Object; stringlist=String List; objectlist=Object List; stringdictionary=String Dictionary; objectdictionary=Object Dictionary; scriptdictionary=Script Dictionary</validvalues>
</control>
<control>
<caption>Parameters</caption>
<controltype>list</controltype>
<attribute>paramnames</attribute>
<editprompt>Please enter an parameter name</editprompt>
</control>
<control>
<caption>Script</caption>
<controltype>script</controltype>
<attribute>script</attribute>
<expand/>
</control>
</tab>
</editor>
</library>