RiCGEN_BY_GUI() or CGEN_BY_GUI()

The RiCGEN_BY_GUI() statement generates an event from a GUI application and sends the event to an instance.

RiCGEN_BY_GUI() has the same effect as CGEN_BY_GUI().

For example, to send a fault() event to an instance GtheFurnace from a GUI application, use:

RiCGEN_BY_GUI(GtheFurnace, fault()); 

The definition of RiCGEN_BY_GUI() is as follows:

#define RiCGEN_BY_GUI(INSTANCE,EVENT)                      \
{\
   if ((INSTANCE) != NULL) {                               \
      RiCReactive * reactive = &((INSTANCE)->ric_reactive);\
      RiCEvent * event = &(RiC_Create_##EVENT->ric_event); \
      RiCReactive_genBySender(reactive, event, RiCGui);    \
   }                                                        \
}

RiCGEN_BY_GUI() uses the framework routine RiCReactive_genBySender() rather than RiCReactive_gen() to actually send the event. With GUI applications, the GUI items are not part of the IBM® Rational® Rhapsody®model and the sender of the event, therefore, cannot be known. RiCReactive_genBySender() can identify a GUI item as the sender of the event.


Feedback