01: /*
02: * CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
03: * NETSCAPE COMMUNICATIONS CORPORATION
04: *
05: * Copyright (c) 1996 Netscape Communications Corporation.
06: * All Rights Reserved.
07: * Use of this Source Code is subject to the terms of the applicable
08: * license agreement from Netscape Communications Corporation.
09: */
10:
11: package graphical;
12:
13: import netscape.application.InternalWindow;
14: import netscape.application.Rect;
15: import netscape.application.Window;
16:
17: /**
18: Transient internal window which is transient
19: in the sense that is hidden on loss of focus.
20: <p>
21: This widget was created to support the ComboBox.
22: The ComboBox uses and InternalWindow to display
23: it's option list.
24: Unfortunately, if the window containing the
25: ComboBox is moved or, more to the point,
26: if focus changed, the InternalWindow's
27: geometry and layer needed to be maintained.
28: It looked like an enormous amount of tricky code
29: would be required to accomplish this
30: without subclassing, so instead we have
31: a simple class that can become the main
32: and hides when it loses main.
33: <p>
34: <b>Open Issues</b>
35: <ul>
36: <li>I don't really know what document is,
37: so handling of that situation is deferred for now.
38: </ul>
39: *
40: */
41: public class TransInternalWindow extends InternalWindow {
42: public TransInternalWindow() {
43: super ();
44: setCanBecomeMain(true);
45: }
46:
47: public TransInternalWindow(int x, int y, int width, int height) {
48: super (x, y, width, height);
49: setCanBecomeMain(true);
50: }
51:
52: public TransInternalWindow(int type, int x, int y, int width,
53: int height) {
54: super (type, x, y, width, height);
55: setCanBecomeMain(true);
56: }
57:
58: public TransInternalWindow(Rect rect) {
59: super (rect);
60: setCanBecomeMain(true);
61: }
62:
63: public void didResignMain() {
64: super .didResignMain();
65: hide();
66: }
67:
68: /* SGP: don't really know what this means, leave for another day
69: public void didResignDocument()
70: {
71: super.didResignDocument();
72: }
73: */
74: }
|