> Quoting Christopher Nelson <[EMAIL PROTECTED]>:
> 
> Hm, one thing in your previous mail caught my eye (i don't 
> have time right now to comment on the rest..)
> 
> > For one thing, AWS2 itself *never* triggers your notification event.
> 
> So how am I going to get events for button presses, window 
> movement etc? I really hope you won't have two different 
> systems for such similar things (ie two ways of receiving events).

There is one system.  Events from Crystal Space propagate into AWS2 much the 
same way that they always have.  The manager in AWS2 discerns whether it's a 
mouse event or keyboard event, and delivers various events depending on whath 
as happened.

For all widgets in AWS2, events are delivered much the same as they were in 
AWS: onXXXX events.

Each widget can create member functions with names like "onMouseClick", 
"onActivate", etc.  These functions get called when the AWS2 manager receives 
user input triggering them.

A USER-DEFINED event is very similar.  You create an object via iAws2 in native 
code.  That object is implicitly provided with a function called "onEvent".  
When you wish to trigger the user-defined notification event you simply call 
object_name.onEvent(<args>).

This is setup so that you can create "wrapper" functions in the script that can 
be used as event sinks.  So, take the example of a button.

<widget type="Button">
        <setup>widget.Resize(10,0);</setup>
        <event name="onDrawContent" action="buttonDrawText('Pause')" />
        <event name="onMouseClick" action="particleFountain.Stop;" />
</widget> 

Where particleFountain.Stop is defined as:

particleFountain.Stop = function()
{
        var stopCmd = 0;
        particleFountain.onEvent(stopCmd);      
}

-------

Thus, when the button receives an "onMouseClick" event, the 
"particleFountain.Stop" method is called, which in turns calls 
particleFountain.onEvent(command), which is reflected back to the native code 
event handler that you registered on creation of "particleFountain."

-={C}=-  






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to