1 /** Top level desktop dialog
11 //import xelfi.design.forms.XelfiDesignForm;
12 //import xelfi.compiler.Output;
14 /** Inherit this class to create a xelfi top level desktop dialog window.
16 public class TopDialog extends Dialog
18 private TopWindowBase base;
20 /** Calls matching constructor of Dialog. Parent will be xelfi main window.*/
21 public TopDialog(String title, boolean modal)
23 super(TopLevel.getMenu(), title, modal);
24 base = new TopWindowBase(this);
27 /** Calls matching constructor of Dialog. */
28 public TopDialog(Frame parent, boolean modal)
31 base = new TopWindowBase(this);
34 /** Calls matching constructor of Dialog. */
35 public TopDialog(Frame parent, String title, boolean modal)
37 super(parent, title, modal);
38 base = new TopWindowBase(this);
41 public boolean handleEvent(Event ev)
43 if(base.handleEvent(ev)) return true;
44 else return super.handleEvent(ev);
47 /** Handles Window menu items updating, setting window positions, etc. */
51 // Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
55 /** Handles Window menu items updating. */
62 /** Handles focus switchinhg. The system needs to know the window that has got the focus. */
63 public boolean gotFocus(Event ev, Object what)
65 boolean bas = base.gotFocus(ev, what);
66 boolean par = super.gotFocus(ev, what);
70 /** Handles focus switchinhg. The system needs to know the window that has got the focus. */
71 public boolean lostFocus(Event ev, Object what)
73 boolean bas = base.lostFocus(ev, what);
74 boolean par = super.lostFocus(ev, what);
79 public boolean keyDown(Event e, int key)
81 if(base.keyDown(e, key)) return true;
82 else return super.keyDown(e, key);
85 /** Should be called before closing the frame is no longer needed. */
92 /** Adds item to the list of focused items for this frame. Focused items are items that will be
93 automatically enabled/disabled when the frame receives/looses a focus.
94 @param itemId new focused item. */
95 public void addFocusedItem(int itemId)
97 base.addFocusedItem(itemId);
100 /** Removes item from the list of focused items for this frame. Focused items are items that will be
101 automatically enabled/disabled when the frame receives/looses a focus.
102 @param itemId focused item to remove */
103 public void removeFocusedItem(int itemId)
105 base.removeFocusedItem(itemId);
108 protected TopWindowBase getBase()