Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 5, 2009, 9:57:05 PM (15 years ago)
Author:
landauf
Message:

Again some changes in the event-system:

  • Added "mainstate" event-state to BaseObject. It leads to the state which was defined with the mainstate attribute in XML.
  • Support event-forwarding to the mainstate of event-listeners.
  • The "targets" subsection of the EventDispatcher now supports all kinds of objects (not just EventTargets).
  • EventTarget now works in all places of the XML-file, not just in the "targets" section of EventDispatcher.

Added a sample XML-file which explains several aspects of the event-system.

Location:
code/branches/core5/src/modules/objects/eventsystem
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc

    r5800 r5882  
    5454        SUPER(EventDispatcher, XMLPort, xmlelement, mode);
    5555
    56         XMLPortObject(EventDispatcher, EventTarget, "targets", addTarget, getTarget, xmlelement, mode);
     56        XMLPortObject(EventDispatcher, BaseObject, "targets", addTarget, getTarget, xmlelement, mode);
    5757    }
    5858
     
    6060    {
    6161        for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
    62             (*it)->fireEvent(event);
     62            (*it)->processEvent(event);
    6363    }
    6464
  • code/branches/core5/src/modules/objects/eventsystem/EventTarget.cc

    r5866 r5882  
    4242    {
    4343    }
     44   
     45    void EventTarget::processEvent(Event& event)
     46    {
     47        this->fireEvent(event);
     48    }
    4449
    4550    void EventTarget::changedName()
  • code/branches/core5/src/modules/objects/eventsystem/EventTarget.h

    r5866 r5882  
    4242            EventTarget(BaseObject* creator);
    4343            virtual ~EventTarget();
     44           
     45            virtual void processEvent(Event& event);
    4446
    4547            virtual void changedName();
Note: See TracChangeset for help on using the changeset viewer.