UserString Property for Window class

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

UserString Property for Window class

Postby zola » Wed Sep 29, 2004 12:17

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

UserString Property for Window class

Postby CrazyEddie » Wed Sep 29, 2004 18:08

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:

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.

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

UserString Property for Window class

Postby zola » Wed Sep 29, 2004 20:26

Wow, yes please make it higher prio.

I think I'll take the time then and implement the angelscript module ;)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

UserString Property for Window class

Postby CrazyEddie » Thu Sep 30, 2004 08:23

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

UserString Property for Window class

Postby CrazyEddie » Sat Oct 02, 2004 11:06

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.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 3 guests