Steven Truppe wrote:
> 1.) Is there a way to create own events (application internal events
> for example) ?
Yes, there are several ways. For occasional event sending you can go
directly to the event queue, but for frequent event sending it may be
preferred to use the extra layer of indirection provided by an event outlet.
First way, only using iEventQueue:
csRef<iEvent> event = queue->CreateEvent(name);
// add data to the event here
queue->Post(event);
Second way, using general public iEventOutlet:
csRef<iEventOutlet> outlet = queue->GetEventOutlet();
csRef<iEvent> event = outlet->CreateEvent();
// add data to the event here
outlet->Post(event);
Third way, using specific iEventOutlet:
// The class sending the event must implement iEventPlug,
// and have a csRef<iEventOutlet> data member called, in this example,
outlet.
// Initialize outlet in the class's constructor, like this:
outlet = queue->CreateEventOutlet(this);
// with the usual caveats of using the 'this' pointer in a constructor.
// Then in a method when you want to send an event:
csRef<iEvent> event = outlet->CreateEvent();
// add data to the event here
outlet->Post(event);
Fourth and fifth ways are similar to second and third, except that
instead of using CreateEvent and Post, you can use the Joystick, Key or
Mouse convenience methods that exist in iEventOutlet to send one of
those types of events.
Sixth way(!), it is also possible to instantiate a csEvent yourself
using 'new' and csRef::AttachNew, and pass that to one of the Post
methods, as an alternative to using an event from the pool obtained by
calling one of the CreateEvent methods.
> 2.) How to use the config manager to get a list of loaded config
> domains (files), or are they read out from the final assembled config
> file ? If the second: How ?
Apparently that's not possible using the iConfigManager interface. It
would seem that you are expected to know which config domains exist, as
it ought to be you who adds them to the manager. You could keep your own
list of domains that have been added, or consider modifying your design
so you don't need to.
Well done on getting the wiki started - it's looking very good so far.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe:
mailto:[email protected]?subject=unsubscribe