Thread: Undocumented Tags?
-
August 7th, 2007, 13:26 #1
- Join Date
- Mar 2007
- Location
- South Africa
- Posts
- 103
Undocumented Tags?
Hi all,
I'm busy looking at Templates - more specifically, templates created from genericcontrol.
In the 'common_templates.xml' file I see this:
Code:<template name="checkbox"> <genericcontrol> <stateicons> <on>indicator_checkon</on> <off>indicator_checkoff</off> </stateicons> <script file="scripts/template_checkbox.lua" /> </genericcontrol> </template>
So, is it safe to assume that any tag not defined in the reference documentation is a custom property? If so, how does FG know what to do with it internally ???
Any help would be appreciated.
-
August 7th, 2007, 13:46 #2
Yes it is safe to assume that although with the case of the script tag its just not defined as such as its more of a global thing that applies in a variety of places.
But in the case above of StateIcons is just a custom property that the scriptfile makes use of. Essentially custom properties are only really useful with the LUA scripting and you can get access to them very easily.
-
August 7th, 2007, 15:13 #3
- Join Date
- Mar 2007
- Location
- South Africa
- Posts
- 103
Thanks joshuha.
So, to clarify:
1. Any 'control' can have a script.
2. Any 'control' can have custom tags, which are essentially ignored by FG, and only used in an accompanying script.
Am I right?
-
August 7th, 2007, 16:40 #4
Correct although ignored is probably not the right word. They are still processed and are sitting in memory but FG obviously doesn't do anything with them. They are only used for scripting purposes who can access the XML tags and their values.
-
August 7th, 2007, 18:42 #5
It is also worth noting that the tags use the same namespace as the object they declare: to be more specific, you can get unintentional collision between a tag name and, say, an event handler.
For example:
<mycontrol><onInit>somevalue</onInit></mycontrol>
Will cause a collision between the custom tag <onInit/> and the event handler onInit(). It will usually end in tears.
Stuart
(Foen)
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks