sorry if this has been asked before, but i didn't find it in the forum.
it would be great to have to possibility to add some user defined string to a window in the layout definition xml.
I have seen that there is a method get/setUserData but this is obviously only available through the API, it's a void* after all
How about a UserString property that we could access through API and XML? I'd use this to define in the xml which script function a button should trigger.
Cheers
Tom
UserString Property for Window class
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
UserString Property for Window class
That's a possibility, though I do have an <Event> XML element planned which allows you to specify an Event name and the name of a script function to execute.
Example:
This obviously would make use of the ScriptModule interface, so you'd have to write something to support that (very easily done, if you've not done it already, I can advise if required).
If you like the Event idea, I'll bump it up the TODO list and get it in over the coming weekend.
CE.
Example:
Code: Select all
<Window Type="TaharezLook/Button" Name="QuitButton>
<Property Name="Position" Value="x:0.5 y:0.5" />
<Property Name="Size" Value="w:0.1 h:0.1" />
<Property Name="Text" Value="Quit!" />
.
.
.
<Event Name="Clicked" Function="quitClicked" />
</Window>
This obviously would make use of the ScriptModule interface, so you'd have to write something to support that (very easily done, if you've not done it already, I can advise if required).
If you like the Event idea, I'll bump it up the TODO list and get it in over the coming weekend.
CE.
UserString Property for Window class
Wow, yes please make it higher prio.
I think I'll take the time then and implement the angelscript module
I think I'll take the time then and implement the angelscript module
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
UserString Property for Window class
Okay, this will be in by sometime Saturday morning.
For the scripting module all you're looking at is about three methods; one to execute a script function with no args, one to execute a script file, and one to execute a script function as an event handler, this last one is the one that will be called via an internal binding created from the <Event> XML tag.
CE.
For the scripting module all you're looking at is about three methods; one to execute a script function with no args, one to execute a script file, and one to execute a script function as an event handler, this last one is the one that will be called via an internal binding created from the <Event> XML tag.
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
UserString Property for Window class
The <Event> element is now available for layout XML files (CVS-head). Usage is exactly as described above, I hope you got your ScriptModule working
Please allow 5 hours for anon access to sync.
CE.
Please allow 5 hours for anon access to sync.
CE.
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 1 guest