Page 1 of 1

UserString Property for Window class

Posted: Wed Sep 29, 2004 12:17
by zola
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

Posted: Wed Sep 29, 2004 18:08
by CrazyEddie
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.

UserString Property for Window class

Posted: Wed Sep 29, 2004 20:26
by zola
Wow, yes please make it higher prio.

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

UserString Property for Window class

Posted: Thu Sep 30, 2004 08:23
by CrazyEddie
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.

UserString Property for Window class

Posted: Sat Oct 02, 2004 11:06
by CrazyEddie
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.