Commit ebf96c13 by Scott Gilbertson Committed by Tom Tromey

Container.java (addImpl): Enable paint events if adding a lightweight to a heavyweight.

2003-04-20  Scott Gilbertson  <scottg@mantatest.com>

	* java/awt/Container.java (addImpl): Enable paint events if adding
	a lightweight to a heavyweight.
	(addNotify): Ensure that peer is created before
	addNotifyContainerChildren.
	(addNotifyContainerChildren): Enable paint events if a heavyweight
	container contains a lightweight.

From-SVN: r65870
parent b39b8084
2003-04-20 Scott Gilbertson <scottg@mantatest.com>
* java/awt/Container.java (addImpl): Enable paint events if adding
a lightweight to a heavyweight.
(addNotify): Ensure that peer is created before
addNotifyContainerChildren.
(addNotifyContainerChildren): Enable paint events if a heavyweight
container contains a lightweight.
2003-04-20 Tom Tromey <tromey@redhat.com> 2003-04-20 Tom Tromey <tromey@redhat.com>
* java/io/BufferedReader.java, java/io/BufferedWriter.java, * java/io/BufferedReader.java, java/io/BufferedWriter.java,
......
...@@ -297,9 +297,13 @@ public class Container extends Component ...@@ -297,9 +297,13 @@ public class Container extends Component
if (peer != null) if (peer != null)
{ {
comp.addNotify(); comp.addNotify();
if (comp.isLightweight()) if (comp.isLightweight ())
enableEvents(comp.eventMask); {
enableEvents (comp.eventMask);
if (!isLightweight ())
enableEvents (AWTEvent.PAINT_EVENT_MASK);
}
} }
invalidate(); invalidate();
...@@ -907,8 +911,8 @@ public class Container extends Component ...@@ -907,8 +911,8 @@ public class Container extends Component
*/ */
public void addNotify() public void addNotify()
{ {
addNotifyContainerChildren();
super.addNotify(); super.addNotify();
addNotifyContainerChildren();
} }
/** /**
...@@ -1288,8 +1292,12 @@ public class Container extends Component ...@@ -1288,8 +1292,12 @@ public class Container extends Component
for (int i = ncomponents; --i >= 0; ) for (int i = ncomponents; --i >= 0; )
{ {
component[i].addNotify(); component[i].addNotify();
if (component[i].isLightweight()) if (component[i].isLightweight ())
enableEvents(component[i].eventMask); {
enableEvents(component[i].eventMask);
if (peer != null && !isLightweight ())
enableEvents (AWTEvent.PAINT_EVENT_MASK);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment