IMenuNotifyHandler objects process events for all classes of menus.
This class is designed to handle events that require the menu class to generate a notification. If notifications are enabled for the menu object, a notification will be generated and sent to all its observers when the proper conditions for the specific notification exist.
If you create a class derived from IMenu that needs to notify observers of additional events, create a class derived from IMenuNotifyHandler that overrides dispatchHandlerEvent. In the class derived from IMenu, implement enableNotification to call IWindow::setNotificationHandler, passing it an object of the class derived from IMenuNotifyHandler.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IMenuNotifyHandler()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IMenuNotifyHandler()
Default constructor.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Notification handlers process events that are sent or posted to a window by calling observer objects interested in those events.
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
Notifies the menu observers when it receives any of the following events:
This function also calls IWindowNotifyHandler::dispatchHandlerEvent so that observers will also be notified of generic window events.
If you create a class derived from IMenuNotifyHandler, its dispatchHandlerEvent function should call IMenuNotifyHandler::dispatchHandlerEvent for events it does not process.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
virtual ~IWindowNotifyHandler()
IWindowNotifyHandler()
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0