classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Old style event fixes, part 2


From: Roman Kennke
Subject: [cp-patches] FYI: Old style event fixes, part 2
Date: Fri, 13 Jan 2006 21:29:07 +0000

This is the second part for the old (1.0) style AWT event handling. The
problem that is fixed here is that events that are targetted at menu
components (like ActionEvents) must be forwarded along the parent chain
and finally must end up in the frame that holds the menu bar (I have an
application here that expects exactly this). Unfortunatly, the MenuBar
knows nothing about its parent frame (MenuBars are not part of the
normal component hierarchy, also they are not derived from Component).
MenuBar.getParent() returns null. So I had to add a reference to the
parent frame to MenuBar and forward the event this way.

2006-01-13  Roman Kennke  <address@hidden>

        * java/awt/MenuBar.java
        (frame): New field.
        (removeNotify): Clear frame field when beeing removed from the
        frame.
        * java/awt/Frame.java
        (setMenuBar): Store a reference of the frame in the MenuBar.
        * java/awt/MenuComponent.java
        (postEvent): Implemented to forward the call to the parent until
        a parent can handle the event.
        (dispatchEvent): Moved handling of old style events from
        dispatchEventImpl() to here.
        (dispatchEventImpl): Moved handling of old style events to
        dispatchEvent().

/Roman

Attachment: patch.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]