Esempio n. 1
0
 private void expand() {
   resize(new Coord(sz.x, 100));
   setcanfocus(true);
   if (sel != null) sel.show();
   chansel.show();
   expanded = true;
 }
Esempio n. 2
0
 private void contract() {
   resize(new Coord(sz.x, 50));
   setcanfocus(false);
   if (sel != null) sel.hide();
   chansel.hide();
   expanded = false;
 }
Esempio n. 3
0
 public void cdestroy(Widget w) {
   if (w instanceof Channel) {
     Channel chan = (Channel) w;
     if (chan == sel) sel = null;
     chansel.rm(chan);
   }
 }
Esempio n. 4
0
 public void newchild(Widget w) {
   if (w instanceof Channel) {
     Channel chan = (Channel) w;
     select(chan);
     chansel.add(chan);
     if (!expanded) chan.hide();
   }
 }
Esempio n. 5
0
 public ChatUI(Coord c, int w, Widget parent) {
   super(c.add(0, -50), new Coord(w, 50), parent);
   chansel = new Selector(Coord.z, new Coord(selw, sz.y));
   chansel.hide();
   base = c;
   setfocusctl(true);
   setcanfocus(false);
 }
Esempio n. 6
0
 public boolean keydown(KeyEvent ev) {
   boolean M = (ev.getModifiersEx() & (KeyEvent.META_DOWN_MASK | KeyEvent.ALT_DOWN_MASK)) != 0;
   if (qline != null) {
     if (M && (ev.getKeyCode() == KeyEvent.VK_UP)) {
       Channel prev = this.sel;
       while (chansel.up()) {
         if (this.sel instanceof EntryChannel) break;
       }
       if (!(this.sel instanceof EntryChannel)) {
         select(prev);
         return (true);
       }
       qline = new QuickLine((EntryChannel) sel);
       return (true);
     } else if (M && (ev.getKeyCode() == KeyEvent.VK_DOWN)) {
       Channel prev = this.sel;
       while (chansel.down()) {
         if (this.sel instanceof EntryChannel) break;
       }
       if (!(this.sel instanceof EntryChannel)) {
         select(prev);
         return (true);
       }
       qline = new QuickLine((EntryChannel) sel);
       return (true);
     }
     qline.key(ev);
     return (true);
   } else {
     if (M && (ev.getKeyCode() == KeyEvent.VK_UP)) {
       chansel.up();
       return (true);
     } else if (M && (ev.getKeyCode() == KeyEvent.VK_DOWN)) {
       chansel.down();
       return (true);
     }
     return (super.keydown(ev));
   }
 }
Esempio n. 7
0
 public void resize(Coord sz) {
   super.resize(sz);
   this.c = base.add(0, -this.sz.y);
   chansel.resize(new Coord(selw, this.sz.y));
   if (sel != null) sel.resize(new Coord(this.sz.x - selw, this.sz.y));
 }